| OLD | NEW |
| 1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef V8_COMPILER_JS_GENERIC_LOWERING_H_ | 5 #ifndef V8_COMPILER_JS_GENERIC_LOWERING_H_ |
| 6 #define V8_COMPILER_JS_GENERIC_LOWERING_H_ | 6 #define V8_COMPILER_JS_GENERIC_LOWERING_H_ |
| 7 | 7 |
| 8 #include "src/allocation.h" | 8 #include "src/allocation.h" |
| 9 #include "src/code-factory.h" | 9 #include "src/code-factory.h" |
| 10 #include "src/compiler/graph.h" | 10 #include "src/compiler/graph.h" |
| 11 #include "src/compiler/graph-reducer.h" | 11 #include "src/compiler/graph-reducer.h" |
| 12 #include "src/compiler/js-graph.h" | 12 #include "src/compiler/js-graph.h" |
| 13 #include "src/compiler/linkage.h" | 13 #include "src/compiler/linkage.h" |
| 14 #include "src/compiler/opcodes.h" | 14 #include "src/compiler/opcodes.h" |
| 15 | 15 |
| 16 namespace v8 { | 16 namespace v8 { |
| 17 namespace internal { | 17 namespace internal { |
| 18 namespace compiler { | 18 namespace compiler { |
| 19 | 19 |
| 20 // Forward declarations. | 20 // Forward declarations. |
| 21 class CommonOperatorBuilder; | 21 class CommonOperatorBuilder; |
| 22 class MachineOperatorBuilder; | 22 class MachineOperatorBuilder; |
| 23 class Linkage; | 23 class Linkage; |
| 24 | 24 |
| 25 |
| 25 // Lowers JS-level operators to runtime and IC calls in the "generic" case. | 26 // Lowers JS-level operators to runtime and IC calls in the "generic" case. |
| 26 class JSGenericLowering : public Reducer { | 27 class JSGenericLowering FINAL : public Reducer { |
| 27 public: | 28 public: |
| 28 JSGenericLowering(CompilationInfo* info, JSGraph* graph); | 29 JSGenericLowering(CompilationInfo* info, JSGraph* graph); |
| 29 virtual ~JSGenericLowering() {} | 30 ~JSGenericLowering() FINAL {} |
| 30 | 31 |
| 31 virtual Reduction Reduce(Node* node); | 32 Reduction Reduce(Node* node) FINAL; |
| 32 | 33 |
| 33 protected: | 34 protected: |
| 34 #define DECLARE_LOWER(x) void Lower##x(Node* node); | 35 #define DECLARE_LOWER(x) void Lower##x(Node* node); |
| 35 // Dispatched depending on opcode. | 36 // Dispatched depending on opcode. |
| 36 JS_OP_LIST(DECLARE_LOWER) | 37 JS_OP_LIST(DECLARE_LOWER) |
| 37 #undef DECLARE_LOWER | 38 #undef DECLARE_LOWER |
| 38 | 39 |
| 39 // Helpers to patch existing nodes in the graph. | 40 // Helpers to patch existing nodes in the graph. |
| 40 void PatchOperator(Node* node, const Operator* new_op); | 41 void PatchOperator(Node* node, const Operator* new_op); |
| 41 void PatchInsertInput(Node* node, int index, Node* input); | 42 void PatchInsertInput(Node* node, int index, Node* input); |
| (...skipping 20 matching lines...) Expand all Loading... |
| 62 CompilationInfo* info_; | 63 CompilationInfo* info_; |
| 63 JSGraph* jsgraph_; | 64 JSGraph* jsgraph_; |
| 64 Linkage* linkage_; | 65 Linkage* linkage_; |
| 65 }; | 66 }; |
| 66 | 67 |
| 67 } // namespace compiler | 68 } // namespace compiler |
| 68 } // namespace internal | 69 } // namespace internal |
| 69 } // namespace v8 | 70 } // namespace v8 |
| 70 | 71 |
| 71 #endif // V8_COMPILER_JS_GENERIC_LOWERING_H_ | 72 #endif // V8_COMPILER_JS_GENERIC_LOWERING_H_ |
| OLD | NEW |