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_SIMPLIFIED_LOWERING_H_ | 5 #ifndef V8_COMPILER_SIMPLIFIED_LOWERING_H_ |
6 #define V8_COMPILER_SIMPLIFIED_LOWERING_H_ | 6 #define V8_COMPILER_SIMPLIFIED_LOWERING_H_ |
7 | 7 |
8 #include "src/compiler/graph-reducer.h" | 8 #include "src/compiler/graph-reducer.h" |
9 #include "src/compiler/js-graph.h" | 9 #include "src/compiler/js-graph.h" |
10 #include "src/compiler/lowering-builder.h" | |
11 #include "src/compiler/machine-operator.h" | 10 #include "src/compiler/machine-operator.h" |
12 #include "src/compiler/node.h" | 11 #include "src/compiler/node.h" |
13 #include "src/compiler/simplified-operator.h" | 12 #include "src/compiler/simplified-operator.h" |
14 | 13 |
15 namespace v8 { | 14 namespace v8 { |
16 namespace internal { | 15 namespace internal { |
17 namespace compiler { | 16 namespace compiler { |
18 | 17 |
19 class SimplifiedLowering : public LoweringBuilder { | 18 class SimplifiedLowering : public Reducer { |
20 public: | 19 public: |
21 explicit SimplifiedLowering(JSGraph* jsgraph, | 20 explicit SimplifiedLowering(JSGraph* jsgraph) |
22 SourcePositionTable* source_positions) | 21 : jsgraph_(jsgraph), machine_(jsgraph->zone()) {} |
23 : LoweringBuilder(jsgraph->graph(), source_positions), | |
24 jsgraph_(jsgraph), | |
25 machine_(jsgraph->zone()) {} | |
26 virtual ~SimplifiedLowering() {} | 22 virtual ~SimplifiedLowering() {} |
27 | 23 |
28 void LowerAllNodes(); | 24 void LowerAllNodes(); |
29 | 25 |
30 virtual void Lower(Node* node); | 26 virtual Reduction Reduce(Node* node); |
31 void LowerChange(Node* node, Node* effect, Node* control); | 27 void LowerChange(Node* node, Node* effect, Node* control); |
32 | 28 |
33 // TODO(titzer): These are exposed for direct testing. Use a friend class. | 29 // TODO(titzer): These are exposed for direct testing. Use a friend class. |
34 void DoLoadField(Node* node); | 30 void DoLoadField(Node* node); |
35 void DoStoreField(Node* node); | 31 void DoStoreField(Node* node); |
36 void DoLoadElement(Node* node); | 32 void DoLoadElement(Node* node); |
37 void DoStoreElement(Node* node); | 33 void DoStoreElement(Node* node); |
38 | 34 |
39 private: | 35 private: |
40 JSGraph* jsgraph_; | 36 JSGraph* jsgraph_; |
(...skipping 21 matching lines...) Expand all Loading... |
62 Graph* graph() { return jsgraph()->graph(); } | 58 Graph* graph() { return jsgraph()->graph(); } |
63 CommonOperatorBuilder* common() { return jsgraph()->common(); } | 59 CommonOperatorBuilder* common() { return jsgraph()->common(); } |
64 MachineOperatorBuilder* machine() { return &machine_; } | 60 MachineOperatorBuilder* machine() { return &machine_; } |
65 }; | 61 }; |
66 | 62 |
67 } // namespace compiler | 63 } // namespace compiler |
68 } // namespace internal | 64 } // namespace internal |
69 } // namespace v8 | 65 } // namespace v8 |
70 | 66 |
71 #endif // V8_COMPILER_SIMPLIFIED_LOWERING_H_ | 67 #endif // V8_COMPILER_SIMPLIFIED_LOWERING_H_ |
OLD | NEW |