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" |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 | 102 |
103 Node* SmiConstant(int32_t immediate) { | 103 Node* SmiConstant(int32_t immediate) { |
104 DCHECK(Smi::IsValid(immediate)); | 104 DCHECK(Smi::IsValid(immediate)); |
105 return Constant(immediate); | 105 return Constant(immediate); |
106 } | 106 } |
107 | 107 |
108 // Creates a dummy Constant node, used to satisfy calling conventions of | 108 // Creates a dummy Constant node, used to satisfy calling conventions of |
109 // stubs and runtime functions that do not require a context. | 109 // stubs and runtime functions that do not require a context. |
110 Node* NoContextConstant() { return ZeroConstant(); } | 110 Node* NoContextConstant() { return ZeroConstant(); } |
111 | 111 |
| 112 // Creates an empty frame states for cases where we know that a function |
| 113 // cannot deopt. |
| 114 Node* EmptyFrameState(); |
| 115 |
112 JSOperatorBuilder* javascript() { return javascript_; } | 116 JSOperatorBuilder* javascript() { return javascript_; } |
113 CommonOperatorBuilder* common() { return common_; } | 117 CommonOperatorBuilder* common() { return common_; } |
114 MachineOperatorBuilder* machine() { return machine_; } | 118 MachineOperatorBuilder* machine() { return machine_; } |
115 Graph* graph() { return graph_; } | 119 Graph* graph() { return graph_; } |
116 Zone* zone() { return graph()->zone(); } | 120 Zone* zone() { return graph()->zone(); } |
117 Isolate* isolate() { return zone()->isolate(); } | 121 Isolate* isolate() { return zone()->isolate(); } |
118 Factory* factory() { return isolate()->factory(); } | 122 Factory* factory() { return isolate()->factory(); } |
119 | 123 |
120 void GetCachedNodes(NodeVector* nodes); | 124 void GetCachedNodes(NodeVector* nodes); |
121 | 125 |
122 private: | 126 private: |
123 Graph* graph_; | 127 Graph* graph_; |
124 CommonOperatorBuilder* common_; | 128 CommonOperatorBuilder* common_; |
125 JSOperatorBuilder* javascript_; | 129 JSOperatorBuilder* javascript_; |
126 MachineOperatorBuilder* machine_; | 130 MachineOperatorBuilder* machine_; |
127 | 131 |
128 // TODO(titzer): make this into a simple array. | 132 // TODO(titzer): make this into a simple array. |
129 SetOncePointer<Node> c_entry_stub_constant_; | 133 SetOncePointer<Node> c_entry_stub_constant_; |
130 SetOncePointer<Node> undefined_constant_; | 134 SetOncePointer<Node> undefined_constant_; |
131 SetOncePointer<Node> the_hole_constant_; | 135 SetOncePointer<Node> the_hole_constant_; |
132 SetOncePointer<Node> true_constant_; | 136 SetOncePointer<Node> true_constant_; |
133 SetOncePointer<Node> false_constant_; | 137 SetOncePointer<Node> false_constant_; |
134 SetOncePointer<Node> null_constant_; | 138 SetOncePointer<Node> null_constant_; |
135 SetOncePointer<Node> zero_constant_; | 139 SetOncePointer<Node> zero_constant_; |
136 SetOncePointer<Node> one_constant_; | 140 SetOncePointer<Node> one_constant_; |
137 SetOncePointer<Node> nan_constant_; | 141 SetOncePointer<Node> nan_constant_; |
| 142 SetOncePointer<Node> empty_frame_state_; |
138 | 143 |
139 CommonNodeCache cache_; | 144 CommonNodeCache cache_; |
140 | 145 |
141 Node* ImmovableHeapConstant(Handle<HeapObject> value); | 146 Node* ImmovableHeapConstant(Handle<HeapObject> value); |
142 Node* NumberConstant(double value); | 147 Node* NumberConstant(double value); |
143 | 148 |
144 DISALLOW_COPY_AND_ASSIGN(JSGraph); | 149 DISALLOW_COPY_AND_ASSIGN(JSGraph); |
145 }; | 150 }; |
146 | 151 |
147 } // namespace compiler | 152 } // namespace compiler |
148 } // namespace internal | 153 } // namespace internal |
149 } // namespace v8 | 154 } // namespace v8 |
150 | 155 |
151 #endif | 156 #endif |
OLD | NEW |