| 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" |
| 11 #include "src/interpreter/bytecode-register.h" | 11 #include "src/interpreter/bytecode-register.h" |
| 12 #include "src/interpreter/bytecodes.h" | 12 #include "src/interpreter/bytecodes.h" |
| 13 | 13 |
| 14 namespace v8 { | 14 namespace v8 { |
| 15 namespace internal { | 15 namespace internal { |
| 16 | 16 |
| 17 class CompilationInfo; | 17 class CompilationInfo; |
| 18 | 18 |
| 19 namespace interpreter { | 19 namespace interpreter { |
| 20 | 20 |
| 21 class LoopBuilder; | 21 class LoopBuilder; |
| 22 | 22 |
| 23 class BytecodeGenerator final : public AstVisitor<BytecodeGenerator> { | 23 class BytecodeGenerator final : public AstVisitor<BytecodeGenerator> { |
| 24 public: | 24 public: |
| 25 explicit BytecodeGenerator(CompilationInfo* info); | 25 explicit BytecodeGenerator(CompilationInfo* info); |
| 26 | 26 |
| 27 void GenerateBytecode(); | 27 void GenerateBytecode(uintptr_t stack_limit); |
| 28 Handle<BytecodeArray> FinalizeBytecode(Isolate* isolate); | 28 Handle<BytecodeArray> FinalizeBytecode(Isolate* isolate); |
| 29 | 29 |
| 30 #define DECLARE_VISIT(type) void Visit##type(type* node); | 30 #define DECLARE_VISIT(type) void Visit##type(type* node); |
| 31 AST_NODE_LIST(DECLARE_VISIT) | 31 AST_NODE_LIST(DECLARE_VISIT) |
| 32 #undef DECLARE_VISIT | 32 #undef DECLARE_VISIT |
| 33 | 33 |
| 34 // Visiting function for declarations list and statements are overridden. | 34 // Visiting function for declarations list and statements are overridden. |
| 35 void VisitDeclarations(ZoneList<Declaration*>* declarations); | 35 void VisitDeclarations(ZoneList<Declaration*>* declarations); |
| 36 void VisitStatements(ZoneList<Statement*>* statments); | 36 void VisitStatements(ZoneList<Statement*>* statments); |
| 37 | 37 |
| (...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 230 | 230 |
| 231 Handle<Name> home_object_symbol_; | 231 Handle<Name> home_object_symbol_; |
| 232 Handle<Name> prototype_string_; | 232 Handle<Name> prototype_string_; |
| 233 }; | 233 }; |
| 234 | 234 |
| 235 } // namespace interpreter | 235 } // namespace interpreter |
| 236 } // namespace internal | 236 } // namespace internal |
| 237 } // namespace v8 | 237 } // namespace v8 |
| 238 | 238 |
| 239 #endif // V8_INTERPRETER_BYTECODE_GENERATOR_H_ | 239 #endif // V8_INTERPRETER_BYTECODE_GENERATOR_H_ |
| OLD | NEW |