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_INTERPRETER_BYTECODE_GENERATOR_H_ | 5 #ifndef V8_INTERPRETER_BYTECODE_GENERATOR_H_ |
6 #define V8_INTERPRETER_BYTECODE_GENERATOR_H_ | 6 #define V8_INTERPRETER_BYTECODE_GENERATOR_H_ |
7 | 7 |
8 #include "src/ast/ast.h" | 8 #include "src/ast/ast.h" |
9 #include "src/interpreter/bytecode-array-builder.h" | 9 #include "src/interpreter/bytecode-array-builder.h" |
10 #include "src/interpreter/bytecode-label.h" | 10 #include "src/interpreter/bytecode-label.h" |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 class ExpressionResultScope; | 46 class ExpressionResultScope; |
47 class EffectResultScope; | 47 class EffectResultScope; |
48 class GlobalDeclarationsBuilder; | 48 class GlobalDeclarationsBuilder; |
49 class RegisterAllocationScope; | 49 class RegisterAllocationScope; |
50 class TestResultScope; | 50 class TestResultScope; |
51 class ValueResultScope; | 51 class ValueResultScope; |
52 | 52 |
53 enum class TestFallthrough { kThen, kElse, kNone }; | 53 enum class TestFallthrough { kThen, kElse, kNone }; |
54 | 54 |
55 void GenerateBytecodeBody(); | 55 void GenerateBytecodeBody(); |
56 void AllocateDeferredConstants(); | 56 void AllocateDeferredConstants(Isolate* isolate); |
57 | 57 |
58 DEFINE_AST_VISITOR_SUBCLASS_MEMBERS(); | 58 DEFINE_AST_VISITOR_SUBCLASS_MEMBERS(); |
59 | 59 |
60 // Dispatched from VisitBinaryOperation. | 60 // Dispatched from VisitBinaryOperation. |
61 void VisitArithmeticExpression(BinaryOperation* binop); | 61 void VisitArithmeticExpression(BinaryOperation* binop); |
62 void VisitCommaExpression(BinaryOperation* binop); | 62 void VisitCommaExpression(BinaryOperation* binop); |
63 void VisitLogicalOrExpression(BinaryOperation* binop); | 63 void VisitLogicalOrExpression(BinaryOperation* binop); |
64 void VisitLogicalAndExpression(BinaryOperation* binop); | 64 void VisitLogicalAndExpression(BinaryOperation* binop); |
65 | 65 |
66 // Dispatched from VisitUnaryOperation. | 66 // Dispatched from VisitUnaryOperation. |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
203 Zone* zone_; | 203 Zone* zone_; |
204 BytecodeArrayBuilder* builder_; | 204 BytecodeArrayBuilder* builder_; |
205 CompilationInfo* info_; | 205 CompilationInfo* info_; |
206 DeclarationScope* scope_; | 206 DeclarationScope* scope_; |
207 | 207 |
208 GlobalDeclarationsBuilder* globals_builder_; | 208 GlobalDeclarationsBuilder* globals_builder_; |
209 ZoneVector<GlobalDeclarationsBuilder*> global_declarations_; | 209 ZoneVector<GlobalDeclarationsBuilder*> global_declarations_; |
210 ZoneVector<std::pair<FunctionLiteral*, size_t>> function_literals_; | 210 ZoneVector<std::pair<FunctionLiteral*, size_t>> function_literals_; |
211 ZoneVector<std::pair<NativeFunctionLiteral*, size_t>> | 211 ZoneVector<std::pair<NativeFunctionLiteral*, size_t>> |
212 native_function_literals_; | 212 native_function_literals_; |
| 213 ZoneVector<std::pair<ObjectLiteral*, size_t>> object_literals_; |
| 214 ZoneVector<std::pair<ArrayLiteral*, size_t>> array_literals_; |
213 | 215 |
214 ControlScope* execution_control_; | 216 ControlScope* execution_control_; |
215 ContextScope* execution_context_; | 217 ContextScope* execution_context_; |
216 ExpressionResultScope* execution_result_; | 218 ExpressionResultScope* execution_result_; |
217 | 219 |
218 ZoneVector<BytecodeLabel> generator_resume_points_; | 220 ZoneVector<BytecodeLabel> generator_resume_points_; |
219 Register generator_state_; | 221 Register generator_state_; |
220 int loop_depth_; | 222 int loop_depth_; |
221 | 223 |
222 Handle<Name> home_object_symbol_; | 224 Handle<Name> home_object_symbol_; |
223 Handle<Name> iterator_symbol_; | 225 Handle<Name> iterator_symbol_; |
224 Handle<Name> prototype_string_; | 226 Handle<Name> prototype_string_; |
225 Handle<FixedArray> empty_fixed_array_; | 227 Handle<FixedArray> empty_fixed_array_; |
226 const AstRawString* undefined_string_; | 228 const AstRawString* undefined_string_; |
227 }; | 229 }; |
228 | 230 |
229 } // namespace interpreter | 231 } // namespace interpreter |
230 } // namespace internal | 232 } // namespace internal |
231 } // namespace v8 | 233 } // namespace v8 |
232 | 234 |
233 #endif // V8_INTERPRETER_BYTECODE_GENERATOR_H_ | 235 #endif // V8_INTERPRETER_BYTECODE_GENERATOR_H_ |
OLD | NEW |