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_ARRAY_BUILDER_H_ | 5 #ifndef V8_INTERPRETER_BYTECODE_ARRAY_BUILDER_H_ |
6 #define V8_INTERPRETER_BYTECODE_ARRAY_BUILDER_H_ | 6 #define V8_INTERPRETER_BYTECODE_ARRAY_BUILDER_H_ |
7 | 7 |
8 #include "src/ast/ast.h" | 8 #include "src/ast/ast.h" |
9 #include "src/interpreter/bytecode-register-allocator.h" | 9 #include "src/interpreter/bytecode-register-allocator.h" |
10 #include "src/interpreter/bytecodes.h" | 10 #include "src/interpreter/bytecodes.h" |
(...skipping 10 matching lines...) Expand all Loading... |
21 namespace interpreter { | 21 namespace interpreter { |
22 | 22 |
23 class BytecodeLabel; | 23 class BytecodeLabel; |
24 class Register; | 24 class Register; |
25 | 25 |
26 class BytecodeArrayBuilder final : public ZoneObject { | 26 class BytecodeArrayBuilder final : public ZoneObject { |
27 public: | 27 public: |
28 BytecodeArrayBuilder(Isolate* isolate, Zone* zone, int parameter_count, | 28 BytecodeArrayBuilder(Isolate* isolate, Zone* zone, int parameter_count, |
29 int context_count, int locals_count, | 29 int context_count, int locals_count, |
30 FunctionLiteral* literal = nullptr); | 30 FunctionLiteral* literal = nullptr); |
31 ~BytecodeArrayBuilder(); | |
32 | 31 |
33 Handle<BytecodeArray> ToBytecodeArray(); | 32 Handle<BytecodeArray> ToBytecodeArray(); |
34 | 33 |
35 // Get the number of parameters expected by function. | 34 // Get the number of parameters expected by function. |
36 int parameter_count() const { | 35 int parameter_count() const { |
37 DCHECK_GE(parameter_count_, 0); | 36 DCHECK_GE(parameter_count_, 0); |
38 return parameter_count_; | 37 return parameter_count_; |
39 } | 38 } |
40 | 39 |
41 // Get the number of locals required for bytecode array. | 40 // Get the number of locals required for bytecode array. |
(...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
424 size_t offset_; | 423 size_t offset_; |
425 | 424 |
426 friend class BytecodeArrayBuilder; | 425 friend class BytecodeArrayBuilder; |
427 }; | 426 }; |
428 | 427 |
429 } // namespace interpreter | 428 } // namespace interpreter |
430 } // namespace internal | 429 } // namespace internal |
431 } // namespace v8 | 430 } // namespace v8 |
432 | 431 |
433 #endif // V8_INTERPRETER_BYTECODE_ARRAY_BUILDER_H_ | 432 #endif // V8_INTERPRETER_BYTECODE_ARRAY_BUILDER_H_ |
OLD | NEW |