OLD | NEW |
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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_BYTECODE_GRAPH_BUILDER_H_ | 5 #ifndef V8_COMPILER_BYTECODE_GRAPH_BUILDER_H_ |
6 #define V8_COMPILER_BYTECODE_GRAPH_BUILDER_H_ | 6 #define V8_COMPILER_BYTECODE_GRAPH_BUILDER_H_ |
7 | 7 |
8 #include "src/compiler.h" | 8 #include "src/compiler.h" |
9 #include "src/compiler/bytecode-branch-analysis.h" | 9 #include "src/compiler/bytecode-branch-analysis.h" |
10 #include "src/compiler/js-graph.h" | 10 #include "src/compiler/js-graph.h" |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 // Helpers for merging control, effect or value dependencies. | 100 // Helpers for merging control, effect or value dependencies. |
101 Node* MergeControl(Node* control, Node* other); | 101 Node* MergeControl(Node* control, Node* other); |
102 Node* MergeEffect(Node* effect, Node* other_effect, Node* control); | 102 Node* MergeEffect(Node* effect, Node* other_effect, Node* control); |
103 Node* MergeValue(Node* value, Node* other_value, Node* control); | 103 Node* MergeValue(Node* value, Node* other_value, Node* control); |
104 | 104 |
105 // The main node creation chokepoint. Adds context, frame state, effect, | 105 // The main node creation chokepoint. Adds context, frame state, effect, |
106 // and control dependencies depending on the operator. | 106 // and control dependencies depending on the operator. |
107 Node* MakeNode(const Operator* op, int value_input_count, Node** value_inputs, | 107 Node* MakeNode(const Operator* op, int value_input_count, Node** value_inputs, |
108 bool incomplete); | 108 bool incomplete); |
109 | 109 |
110 // Helper to indicate a node exits the function body. | |
111 void UpdateControlDependencyToLeaveFunction(Node* exit); | |
112 | |
113 Node** EnsureInputBufferSize(int size); | 110 Node** EnsureInputBufferSize(int size); |
114 | 111 |
115 Node* ProcessCallArguments(const Operator* call_op, Node* callee, | 112 Node* ProcessCallArguments(const Operator* call_op, Node* callee, |
116 interpreter::Register receiver, size_t arity); | 113 interpreter::Register receiver, size_t arity); |
117 Node* ProcessCallNewArguments(const Operator* call_new_op, | 114 Node* ProcessCallNewArguments(const Operator* call_new_op, |
118 interpreter::Register callee, | 115 interpreter::Register callee, |
119 interpreter::Register first_arg, size_t arity); | 116 interpreter::Register first_arg, size_t arity); |
120 Node* ProcessCallRuntimeArguments(const Operator* call_runtime_op, | 117 Node* ProcessCallRuntimeArguments(const Operator* call_runtime_op, |
121 interpreter::Register first_arg, | 118 interpreter::Register first_arg, |
122 size_t arity); | 119 size_t arity); |
123 | 120 |
124 void BuildCreateLiteral(const Operator* op); | 121 void BuildCreateLiteral(const Operator* op); |
125 void BuildCreateRegExpLiteral(); | 122 void BuildCreateRegExpLiteral(); |
126 void BuildCreateArrayLiteral(); | 123 void BuildCreateArrayLiteral(); |
127 void BuildCreateObjectLiteral(); | 124 void BuildCreateObjectLiteral(); |
128 void BuildCreateArguments(CreateArgumentsParameters::Type type); | 125 void BuildCreateArguments(CreateArgumentsParameters::Type type); |
129 void BuildLoadGlobal(TypeofMode typeof_mode); | 126 void BuildLoadGlobal(TypeofMode typeof_mode); |
130 void BuildStoreGlobal(); | 127 void BuildStoreGlobal(); |
131 void BuildNamedLoad(); | 128 void BuildNamedLoad(); |
132 void BuildKeyedLoad(); | 129 void BuildKeyedLoad(); |
133 void BuildNamedStore(); | 130 void BuildNamedStore(); |
134 void BuildKeyedStore(); | 131 void BuildKeyedStore(); |
135 void BuildLdaLookupSlot(TypeofMode typeof_mode); | 132 void BuildLdaLookupSlot(TypeofMode typeof_mode); |
136 void BuildStaLookupSlot(LanguageMode language_mode); | 133 void BuildStaLookupSlot(LanguageMode language_mode); |
137 void BuildCall(); | 134 void BuildCall(); |
138 void BuildCallJSRuntime(); | 135 void BuildCallJSRuntime(); |
139 void BuildCallRuntime(); | 136 void BuildCallRuntime(); |
140 void BuildCallRuntimeForPair(); | 137 void BuildCallRuntimeForPair(); |
141 void BuildCallConstruct(); | 138 void BuildCallConstruct(); |
| 139 void BuildThrowOp(const Operator* op); |
142 void BuildBinaryOp(const Operator* op); | 140 void BuildBinaryOp(const Operator* op); |
143 void BuildCompareOp(const Operator* op); | 141 void BuildCompareOp(const Operator* op); |
144 void BuildDelete(); | 142 void BuildDelete(); |
145 void BuildCastOperator(const Operator* js_op); | 143 void BuildCastOperator(const Operator* op); |
146 void BuildForInPrepare(); | 144 void BuildForInPrepare(); |
147 void BuildForInNext(); | 145 void BuildForInNext(); |
148 | 146 |
149 // Control flow plumbing. | 147 // Control flow plumbing. |
150 void BuildJump(); | 148 void BuildJump(); |
151 void BuildConditionalJump(Node* condition); | 149 void BuildConditionalJump(Node* condition); |
152 void BuildJumpIfEqual(Node* comperand); | 150 void BuildJumpIfEqual(Node* comperand); |
153 void BuildJumpIfToBooleanEqual(Node* boolean_comperand); | 151 void BuildJumpIfToBooleanEqual(Node* boolean_comperand); |
154 | 152 |
155 // Simulates control flow by forward-propagating environments. | 153 // Simulates control flow by forward-propagating environments. |
156 void MergeIntoSuccessorEnvironment(int target_offset); | 154 void MergeIntoSuccessorEnvironment(int target_offset); |
157 void BuildLoopHeaderEnvironment(int current_offset); | 155 void BuildLoopHeaderEnvironment(int current_offset); |
158 void SwitchToMergeEnvironment(int current_offset); | 156 void SwitchToMergeEnvironment(int current_offset); |
159 | 157 |
| 158 // Simulates control flow that exits the function body. |
| 159 void MergeControlToLeaveFunction(Node* exit); |
| 160 |
160 // Simulates entry and exit of exception handlers. | 161 // Simulates entry and exit of exception handlers. |
161 void EnterAndExitExceptionHandlers(int current_offset); | 162 void EnterAndExitExceptionHandlers(int current_offset); |
162 | 163 |
163 // Attaches a frame state to |node| for the entry to the function. | 164 // Attaches a frame state to |node| for the entry to the function. |
164 void PrepareEntryFrameState(Node* node); | 165 void PrepareEntryFrameState(Node* node); |
165 | 166 |
166 // Growth increment for the temporary buffer used to construct input lists to | 167 // Growth increment for the temporary buffer used to construct input lists to |
167 // new nodes. | 168 // new nodes. |
168 static const int kInputBufferSizeIncrement = 64; | 169 static const int kInputBufferSizeIncrement = 64; |
169 | 170 |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
256 ZoneVector<Node*> exit_controls_; | 257 ZoneVector<Node*> exit_controls_; |
257 | 258 |
258 DISALLOW_COPY_AND_ASSIGN(BytecodeGraphBuilder); | 259 DISALLOW_COPY_AND_ASSIGN(BytecodeGraphBuilder); |
259 }; | 260 }; |
260 | 261 |
261 } // namespace compiler | 262 } // namespace compiler |
262 } // namespace internal | 263 } // namespace internal |
263 } // namespace v8 | 264 } // namespace v8 |
264 | 265 |
265 #endif // V8_COMPILER_BYTECODE_GRAPH_BUILDER_H_ | 266 #endif // V8_COMPILER_BYTECODE_GRAPH_BUILDER_H_ |
OLD | NEW |