| 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 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 } | 110 } |
| 111 | 111 |
| 112 // Creates a dummy Constant node, used to satisfy calling conventions of | 112 // Creates a dummy Constant node, used to satisfy calling conventions of |
| 113 // stubs and runtime functions that do not require a context. | 113 // stubs and runtime functions that do not require a context. |
| 114 Node* NoContextConstant() { return ZeroConstant(); } | 114 Node* NoContextConstant() { return ZeroConstant(); } |
| 115 | 115 |
| 116 // Creates an empty frame states for cases where we know that a function | 116 // Creates an empty frame states for cases where we know that a function |
| 117 // cannot deopt. | 117 // cannot deopt. |
| 118 Node* EmptyFrameState(); | 118 Node* EmptyFrameState(); |
| 119 | 119 |
| 120 // Create a control node that serves as control dependency for dead nodes. | 120 // Creates a value node that servers as value input for dead nodes. |
| 121 Node* DeadValue(); |
| 122 |
| 123 // Creates a control node that serves as control dependency for dead nodes. |
| 121 Node* DeadControl(); | 124 Node* DeadControl(); |
| 122 | 125 |
| 123 JSOperatorBuilder* javascript() const { return javascript_; } | 126 JSOperatorBuilder* javascript() const { return javascript_; } |
| 124 CommonOperatorBuilder* common() const { return common_; } | 127 CommonOperatorBuilder* common() const { return common_; } |
| 125 MachineOperatorBuilder* machine() const { return machine_; } | 128 MachineOperatorBuilder* machine() const { return machine_; } |
| 126 Graph* graph() const { return graph_; } | 129 Graph* graph() const { return graph_; } |
| 127 Zone* zone() const { return graph()->zone(); } | 130 Zone* zone() const { return graph()->zone(); } |
| 128 Isolate* isolate() const { return isolate_; } | 131 Isolate* isolate() const { return isolate_; } |
| 129 Factory* factory() const { return isolate()->factory(); } | 132 Factory* factory() const { return isolate()->factory(); } |
| 130 | 133 |
| 131 void GetCachedNodes(NodeVector* nodes); | 134 void GetCachedNodes(NodeVector* nodes); |
| 132 | 135 |
| 133 private: | 136 private: |
| 134 enum CachedNode { | 137 enum CachedNode { |
| 135 kCEntryStubConstant, | 138 kCEntryStubConstant, |
| 136 kUndefinedConstant, | 139 kUndefinedConstant, |
| 137 kTheHoleConstant, | 140 kTheHoleConstant, |
| 138 kTrueConstant, | 141 kTrueConstant, |
| 139 kFalseConstant, | 142 kFalseConstant, |
| 140 kNullConstant, | 143 kNullConstant, |
| 141 kZeroConstant, | 144 kZeroConstant, |
| 142 kOneConstant, | 145 kOneConstant, |
| 143 kNaNConstant, | 146 kNaNConstant, |
| 144 kEmptyFrameState, | 147 kEmptyFrameState, |
| 148 kDeadValue, |
| 145 kDeadControl, | 149 kDeadControl, |
| 146 kNumCachedNodes // Must remain last. | 150 kNumCachedNodes // Must remain last. |
| 147 }; | 151 }; |
| 148 | 152 |
| 149 Isolate* isolate_; | 153 Isolate* isolate_; |
| 150 Graph* graph_; | 154 Graph* graph_; |
| 151 CommonOperatorBuilder* common_; | 155 CommonOperatorBuilder* common_; |
| 152 JSOperatorBuilder* javascript_; | 156 JSOperatorBuilder* javascript_; |
| 153 MachineOperatorBuilder* machine_; | 157 MachineOperatorBuilder* machine_; |
| 154 CommonNodeCache cache_; | 158 CommonNodeCache cache_; |
| 155 Node* cached_nodes_[kNumCachedNodes]; | 159 Node* cached_nodes_[kNumCachedNodes]; |
| 156 | 160 |
| 157 Node* ImmovableHeapConstant(Handle<HeapObject> value); | 161 Node* ImmovableHeapConstant(Handle<HeapObject> value); |
| 158 Node* NumberConstant(double value); | 162 Node* NumberConstant(double value); |
| 159 | 163 |
| 160 DISALLOW_COPY_AND_ASSIGN(JSGraph); | 164 DISALLOW_COPY_AND_ASSIGN(JSGraph); |
| 161 }; | 165 }; |
| 162 | 166 |
| 163 } // namespace compiler | 167 } // namespace compiler |
| 164 } // namespace internal | 168 } // namespace internal |
| 165 } // namespace v8 | 169 } // namespace v8 |
| 166 | 170 |
| 167 #endif | 171 #endif |
| OLD | NEW |