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_GRAPH_H_ | 5 #ifndef V8_COMPILER_JS_GRAPH_H_ |
6 #define V8_COMPILER_JS_GRAPH_H_ | 6 #define V8_COMPILER_JS_GRAPH_H_ |
7 | 7 |
8 #include "src/compiler/common-node-cache.h" | 8 #include "src/compiler/common-node-cache.h" |
9 #include "src/compiler/common-operator.h" | 9 #include "src/compiler/common-operator.h" |
10 #include "src/compiler/graph.h" | 10 #include "src/compiler/graph.h" |
11 #include "src/compiler/js-operator.h" | 11 #include "src/compiler/js-operator.h" |
12 #include "src/compiler/machine-operator.h" | 12 #include "src/compiler/machine-operator.h" |
13 #include "src/compiler/node-properties.h" | 13 #include "src/compiler/node-properties.h" |
14 | 14 |
15 namespace v8 { | 15 namespace v8 { |
16 namespace internal { | 16 namespace internal { |
17 namespace compiler { | 17 namespace compiler { |
18 | 18 |
19 class Typer; | 19 class Typer; |
20 | 20 |
21 // Implements a facade on a Graph, enhancing the graph with JS-specific | 21 // Implements a facade on a Graph, enhancing the graph with JS-specific |
22 // notions, including a builder for for JS* operators, canonicalized global | 22 // notions, including a builder for for JS* operators, canonicalized global |
23 // constants, and various helper methods. | 23 // constants, and various helper methods. |
24 class JSGraph : public ZoneObject { | 24 class JSGraph : public ZoneObject { |
25 public: | 25 public: |
26 JSGraph(Graph* graph, CommonOperatorBuilder* common, | 26 JSGraph(Graph* graph, CommonOperatorBuilder* common, |
27 JSOperatorBuilder* javascript, Typer* typer, | 27 JSOperatorBuilder* javascript, MachineOperatorBuilder* machine) |
28 MachineOperatorBuilder* machine) | |
29 : graph_(graph), | 28 : graph_(graph), |
30 common_(common), | 29 common_(common), |
31 javascript_(javascript), | 30 javascript_(javascript), |
32 typer_(typer), | |
33 machine_(machine), | 31 machine_(machine), |
34 cache_(zone()) {} | 32 cache_(zone()) {} |
35 | 33 |
36 // Canonicalized global constants. | 34 // Canonicalized global constants. |
37 Node* CEntryStubConstant(); | 35 Node* CEntryStubConstant(); |
38 Node* UndefinedConstant(); | 36 Node* UndefinedConstant(); |
39 Node* TheHoleConstant(); | 37 Node* TheHoleConstant(); |
40 Node* TrueConstant(); | 38 Node* TrueConstant(); |
41 Node* FalseConstant(); | 39 Node* FalseConstant(); |
42 Node* NullConstant(); | 40 Node* NullConstant(); |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 CommonOperatorBuilder* common() { return common_; } | 100 CommonOperatorBuilder* common() { return common_; } |
103 MachineOperatorBuilder* machine() { return machine_; } | 101 MachineOperatorBuilder* machine() { return machine_; } |
104 Graph* graph() { return graph_; } | 102 Graph* graph() { return graph_; } |
105 Zone* zone() { return graph()->zone(); } | 103 Zone* zone() { return graph()->zone(); } |
106 Isolate* isolate() { return zone()->isolate(); } | 104 Isolate* isolate() { return zone()->isolate(); } |
107 | 105 |
108 private: | 106 private: |
109 Graph* graph_; | 107 Graph* graph_; |
110 CommonOperatorBuilder* common_; | 108 CommonOperatorBuilder* common_; |
111 JSOperatorBuilder* javascript_; | 109 JSOperatorBuilder* javascript_; |
112 Typer* typer_; | |
113 MachineOperatorBuilder* machine_; | 110 MachineOperatorBuilder* machine_; |
114 | 111 |
115 SetOncePointer<Node> c_entry_stub_constant_; | 112 SetOncePointer<Node> c_entry_stub_constant_; |
116 SetOncePointer<Node> undefined_constant_; | 113 SetOncePointer<Node> undefined_constant_; |
117 SetOncePointer<Node> the_hole_constant_; | 114 SetOncePointer<Node> the_hole_constant_; |
118 SetOncePointer<Node> true_constant_; | 115 SetOncePointer<Node> true_constant_; |
119 SetOncePointer<Node> false_constant_; | 116 SetOncePointer<Node> false_constant_; |
120 SetOncePointer<Node> null_constant_; | 117 SetOncePointer<Node> null_constant_; |
121 SetOncePointer<Node> zero_constant_; | 118 SetOncePointer<Node> zero_constant_; |
122 SetOncePointer<Node> one_constant_; | 119 SetOncePointer<Node> one_constant_; |
123 SetOncePointer<Node> nan_constant_; | 120 SetOncePointer<Node> nan_constant_; |
124 | 121 |
125 CommonNodeCache cache_; | 122 CommonNodeCache cache_; |
126 | 123 |
127 Node* ImmovableHeapConstant(Handle<HeapObject> value); | 124 Node* ImmovableHeapConstant(Handle<HeapObject> value); |
128 Node* NumberConstant(double value); | 125 Node* NumberConstant(double value); |
129 Node* NewNode(const Operator* op); | |
130 | 126 |
131 Factory* factory() { return isolate()->factory(); } | 127 Factory* factory() { return isolate()->factory(); } |
132 }; | 128 }; |
133 | 129 |
134 } // namespace compiler | 130 } // namespace compiler |
135 } // namespace internal | 131 } // namespace internal |
136 } // namespace v8 | 132 } // namespace v8 |
137 | 133 |
138 #endif | 134 #endif |
OLD | NEW |