1 // Copyright 2019 the V8 project authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 #ifndef V8_COMPILER_ADD_TYPE_ASSERTIONS_REDUCER_H_ 6 #define V8_COMPILER_ADD_TYPE_ASSERTIONS_REDUCER_H_ 7 8 #include "src/common/globals.h" 9 #include "src/compiler/graph-reducer.h" 10 #include "src/compiler/js-graph.h" 11 #include "src/compiler/node-aux-data.h" 12 #include "src/compiler/simplified-operator.h" 13 14 namespace v8 { 15 namespace internal { 16 17 namespace compiler { 18 19 class V8_EXPORT_PRIVATE AddTypeAssertionsReducer final NON_EXPORTED_BASE(AdvancedReducer)20 : public NON_EXPORTED_BASE(AdvancedReducer) { 21 public: 22 AddTypeAssertionsReducer(Editor* editor, JSGraph* jsgraph, Zone* zone); 23 ~AddTypeAssertionsReducer() final; 24 25 AddTypeAssertionsReducer(const AddTypeAssertionsReducer&) = delete; 26 AddTypeAssertionsReducer& operator=(const AddTypeAssertionsReducer&) = delete; 27 28 const char* reducer_name() const override { 29 return "AddTypeAssertionsReducer"; 30 } 31 32 Reduction Reduce(Node* node) final; 33 34 private: 35 JSGraph* const jsgraph_; 36 NodeAuxData<bool> visited_; 37 38 Graph* graph() { return jsgraph_->graph(); } 39 SimplifiedOperatorBuilder* simplified() { return jsgraph_->simplified(); } 40 }; 41 42 } // namespace compiler 43 } // namespace internal 44 } // namespace v8 45 46 #endif // V8_COMPILER_ADD_TYPE_ASSERTIONS_REDUCER_H_ 47