Chromium Code Reviews| 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 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 118 | 118 |
| 119 Node* ProcessCallArguments(const Operator* call_op, Node* callee, | 119 Node* ProcessCallArguments(const Operator* call_op, Node* callee, |
| 120 interpreter::Register receiver, size_t arity); | 120 interpreter::Register receiver, size_t arity); |
| 121 Node* ProcessCallNewArguments(const Operator* call_new_op, | 121 Node* ProcessCallNewArguments(const Operator* call_new_op, |
| 122 interpreter::Register callee, | 122 interpreter::Register callee, |
| 123 interpreter::Register first_arg, size_t arity); | 123 interpreter::Register first_arg, size_t arity); |
| 124 Node* ProcessCallRuntimeArguments(const Operator* call_runtime_op, | 124 Node* ProcessCallRuntimeArguments(const Operator* call_runtime_op, |
| 125 interpreter::Register first_arg, | 125 interpreter::Register first_arg, |
| 126 size_t arity); | 126 size_t arity); |
| 127 | 127 |
| 128 void BuildCreateLiteral(const Operator* op, | 128 void BuildCreateLiteral(const Operator* op); |
| 129 const interpreter::BytecodeArrayIterator& iterator); | 129 void BuildCreateRegExpLiteral(); |
| 130 void BuildCreateRegExpLiteral( | 130 void BuildCreateArrayLiteral(); |
| 131 const interpreter::BytecodeArrayIterator& iterator); | 131 void BuildCreateObjectLiteral(); |
| 132 void BuildCreateArrayLiteral( | 132 void BuildCreateArguments(CreateArgumentsParameters::Type type); |
| 133 const interpreter::BytecodeArrayIterator& iterator); | 133 void BuildLoadGlobal(TypeofMode typeof_mode); |
| 134 void BuildCreateObjectLiteral( | 134 void BuildStoreGlobal(); |
| 135 const interpreter::BytecodeArrayIterator& iterator); | 135 void BuildNamedLoad(); |
| 136 void BuildCreateArguments(CreateArgumentsParameters::Type type, | 136 void BuildKeyedLoad(); |
| 137 const interpreter::BytecodeArrayIterator& iterator); | 137 void BuildNamedStore(); |
| 138 void BuildLoadGlobal(const interpreter::BytecodeArrayIterator& iterator, | 138 void BuildKeyedStore(); |
| 139 TypeofMode typeof_mode); | 139 void BuildLdaLookupSlot(TypeofMode typeof_mode); |
| 140 void BuildStoreGlobal(const interpreter::BytecodeArrayIterator& iterator); | 140 void BuildStaLookupSlot(LanguageMode language_mode); |
| 141 void BuildNamedLoad(const interpreter::BytecodeArrayIterator& iterator); | 141 void BuildCall(); |
| 142 void BuildKeyedLoad(const interpreter::BytecodeArrayIterator& iterator); | 142 void BuildCallJSRuntime(); |
| 143 void BuildNamedStore(const interpreter::BytecodeArrayIterator& iterator); | 143 void BuildCallRuntime(); |
| 144 void BuildKeyedStore(const interpreter::BytecodeArrayIterator& iterator); | 144 void BuildCallRuntimeForPair(); |
| 145 void BuildLdaLookupSlot(TypeofMode typeof_mode, | 145 void BuildCallConstruct(); |
| 146 const interpreter::BytecodeArrayIterator& iterator); | 146 void BuildBinaryOp(const Operator* op); |
| 147 void BuildStaLookupSlot(LanguageMode language_mode, | 147 void BuildCompareOp(const Operator* op); |
| 148 const interpreter::BytecodeArrayIterator& iterator); | 148 void BuildDelete(); |
| 149 void BuildCall(const interpreter::BytecodeArrayIterator& iterator); | 149 void BuildCastOperator(const Operator* js_op); |
| 150 void BuildCallJSRuntime(const interpreter::BytecodeArrayIterator& iterator); | 150 void BuildForInPrepare(); |
| 151 void BuildCallRuntime(const interpreter::BytecodeArrayIterator& iterator); | 151 void BuildForInNext(); |
| 152 void BuildCallRuntimeForPair( | |
| 153 const interpreter::BytecodeArrayIterator& iterator); | |
| 154 void BuildCallConstruct(const interpreter::BytecodeArrayIterator& iterator); | |
| 155 void BuildBinaryOp(const Operator* op, | |
| 156 const interpreter::BytecodeArrayIterator& iterator); | |
| 157 void BuildCompareOp(const Operator* op, | |
| 158 const interpreter::BytecodeArrayIterator& iterator); | |
| 159 void BuildDelete(const interpreter::BytecodeArrayIterator& iterator); | |
| 160 void BuildCastOperator(const Operator* js_op, | |
| 161 const interpreter::BytecodeArrayIterator& iterator); | |
| 162 void BuildForInPrepare(const interpreter::BytecodeArrayIterator& iterator); | |
| 163 void BuildForInNext(const interpreter::BytecodeArrayIterator& iterator); | |
| 164 | 152 |
| 165 // Control flow plumbing. | 153 // Control flow plumbing. |
| 166 void BuildJump(int source_offset, int target_offset); | 154 void BuildJump(int source_offset, int target_offset); |
| 167 void BuildJump(); | 155 void BuildJump(); |
| 168 void BuildConditionalJump(Node* condition); | 156 void BuildConditionalJump(Node* condition); |
| 169 void BuildJumpIfEqual(Node* comperand); | 157 void BuildJumpIfEqual(Node* comperand); |
| 170 void BuildJumpIfToBooleanEqual(Node* boolean_comperand); | 158 void BuildJumpIfToBooleanEqual(Node* boolean_comperand); |
| 171 | 159 |
| 172 // Constructing merge and loop headers. | 160 // Constructing merge and loop headers. |
| 173 void MergeEnvironmentsOfBackwardBranches(int source_offset, | 161 void MergeEnvironmentsOfBackwardBranches(int source_offset, |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 210 } | 198 } |
| 211 const FrameStateFunctionInfo* frame_state_function_info() const { | 199 const FrameStateFunctionInfo* frame_state_function_info() const { |
| 212 return frame_state_function_info_; | 200 return frame_state_function_info_; |
| 213 } | 201 } |
| 214 | 202 |
| 215 LanguageMode language_mode() const { | 203 LanguageMode language_mode() const { |
| 216 // TODO(mythria): Don't rely on parse information to get language mode. | 204 // TODO(mythria): Don't rely on parse information to get language mode. |
| 217 return info()->language_mode(); | 205 return info()->language_mode(); |
| 218 } | 206 } |
| 219 | 207 |
| 208 const interpreter::BytecodeArrayIterator& iterator() const { | |
|
rmcilroy
2016/01/28 18:15:04
Nit - could you call this bytecodes_iterator()
Michael Starzinger
2016/01/29 09:42:03
Done.
| |
| 209 return *bytecode_iterator_; | |
| 210 } | |
| 220 const interpreter::BytecodeArrayIterator* bytecode_iterator() const { | 211 const interpreter::BytecodeArrayIterator* bytecode_iterator() const { |
| 221 return bytecode_iterator_; | 212 return bytecode_iterator_; |
| 222 } | 213 } |
| 223 | 214 |
| 224 void set_bytecode_iterator( | 215 void set_bytecode_iterator( |
| 225 const interpreter::BytecodeArrayIterator* bytecode_iterator) { | 216 const interpreter::BytecodeArrayIterator* bytecode_iterator) { |
| 226 bytecode_iterator_ = bytecode_iterator; | 217 bytecode_iterator_ = bytecode_iterator; |
| 227 } | 218 } |
| 228 | 219 |
| 229 const BytecodeBranchAnalysis* branch_analysis() const { | 220 const BytecodeBranchAnalysis* branch_analysis() const { |
| 230 return branch_analysis_; | 221 return branch_analysis_; |
| 231 } | 222 } |
| 232 | 223 |
| 233 void set_branch_analysis(BytecodeBranchAnalysis* branch_analysis) { | 224 void set_branch_analysis(BytecodeBranchAnalysis* branch_analysis) { |
| 234 branch_analysis_ = branch_analysis; | 225 branch_analysis_ = branch_analysis; |
| 235 } | 226 } |
| 236 | 227 |
| 237 #define DECLARE_VISIT_BYTECODE(name, ...) \ | 228 #define DECLARE_VISIT_BYTECODE(name, ...) void Visit##name(); |
| 238 void Visit##name(const interpreter::BytecodeArrayIterator& iterator); | |
| 239 BYTECODE_LIST(DECLARE_VISIT_BYTECODE) | 229 BYTECODE_LIST(DECLARE_VISIT_BYTECODE) |
| 240 #undef DECLARE_VISIT_BYTECODE | 230 #undef DECLARE_VISIT_BYTECODE |
| 241 | 231 |
| 242 Zone* local_zone_; | 232 Zone* local_zone_; |
| 243 CompilationInfo* info_; | 233 CompilationInfo* info_; |
| 244 JSGraph* jsgraph_; | 234 JSGraph* jsgraph_; |
| 245 Handle<BytecodeArray> bytecode_array_; | 235 Handle<BytecodeArray> bytecode_array_; |
| 246 Handle<HandlerTable> exception_handler_table_; | 236 Handle<HandlerTable> exception_handler_table_; |
| 247 const FrameStateFunctionInfo* frame_state_function_info_; | 237 const FrameStateFunctionInfo* frame_state_function_info_; |
| 248 const interpreter::BytecodeArrayIterator* bytecode_iterator_; | 238 const interpreter::BytecodeArrayIterator* bytecode_iterator_; |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 362 Node* accumulator_state_values_; | 352 Node* accumulator_state_values_; |
| 363 int register_base_; | 353 int register_base_; |
| 364 int accumulator_base_; | 354 int accumulator_base_; |
| 365 }; | 355 }; |
| 366 | 356 |
| 367 } // namespace compiler | 357 } // namespace compiler |
| 368 } // namespace internal | 358 } // namespace internal |
| 369 } // namespace v8 | 359 } // namespace v8 |
| 370 | 360 |
| 371 #endif // V8_COMPILER_BYTECODE_GRAPH_BUILDER_H_ | 361 #endif // V8_COMPILER_BYTECODE_GRAPH_BUILDER_H_ |
| OLD | NEW |