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-array-writer.h" | 9 #include "src/interpreter/bytecode-array-writer.h" |
10 #include "src/interpreter/bytecode-register-allocator.h" | 10 #include "src/interpreter/bytecode-register-allocator.h" |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 DCHECK_GE(local_register_count_, 0); | 44 DCHECK_GE(local_register_count_, 0); |
45 return local_register_count_; | 45 return local_register_count_; |
46 } | 46 } |
47 | 47 |
48 // Get number of contexts required for bytecode array. | 48 // Get number of contexts required for bytecode array. |
49 int context_count() const { | 49 int context_count() const { |
50 DCHECK_GE(context_register_count_, 0); | 50 DCHECK_GE(context_register_count_, 0); |
51 return context_register_count_; | 51 return context_register_count_; |
52 } | 52 } |
53 | 53 |
| 54 FunctionLiteral* literal() const { return literal_; } |
| 55 |
54 Register first_context_register() const; | 56 Register first_context_register() const; |
55 Register last_context_register() const; | 57 Register last_context_register() const; |
56 | 58 |
57 // Returns the number of fixed (non-temporary) registers. | 59 // Returns the number of fixed (non-temporary) registers. |
58 int fixed_register_count() const { return context_count() + locals_count(); } | 60 int fixed_register_count() const { return context_count() + locals_count(); } |
59 | 61 |
60 // Returns the number of fixed and temporary registers. | 62 // Returns the number of fixed and temporary registers. |
61 int fixed_and_temporary_register_count() const { | 63 int fixed_and_temporary_register_count() const { |
62 return fixed_register_count() + temporary_register_count(); | 64 return fixed_register_count() + temporary_register_count(); |
63 } | 65 } |
(...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
353 | 355 |
354 Isolate* isolate_; | 356 Isolate* isolate_; |
355 Zone* zone_; | 357 Zone* zone_; |
356 bool bytecode_generated_; | 358 bool bytecode_generated_; |
357 ConstantArrayBuilder constant_array_builder_; | 359 ConstantArrayBuilder constant_array_builder_; |
358 HandlerTableBuilder handler_table_builder_; | 360 HandlerTableBuilder handler_table_builder_; |
359 bool return_seen_in_block_; | 361 bool return_seen_in_block_; |
360 int parameter_count_; | 362 int parameter_count_; |
361 int local_register_count_; | 363 int local_register_count_; |
362 int context_register_count_; | 364 int context_register_count_; |
363 int return_position_; | 365 FunctionLiteral* literal_; |
364 TemporaryRegisterAllocator temporary_allocator_; | 366 TemporaryRegisterAllocator temporary_allocator_; |
365 BytecodeArrayWriter bytecode_array_writer_; | 367 BytecodeArrayWriter bytecode_array_writer_; |
366 BytecodePipelineStage* pipeline_; | 368 BytecodePipelineStage* pipeline_; |
367 BytecodeSourceInfo latest_source_info_; | 369 BytecodeSourceInfo latest_source_info_; |
368 | 370 |
369 DISALLOW_COPY_AND_ASSIGN(BytecodeArrayBuilder); | 371 DISALLOW_COPY_AND_ASSIGN(BytecodeArrayBuilder); |
370 }; | 372 }; |
371 | 373 |
372 } // namespace interpreter | 374 } // namespace interpreter |
373 } // namespace internal | 375 } // namespace internal |
374 } // namespace v8 | 376 } // namespace v8 |
375 | 377 |
376 #endif // V8_INTERPRETER_BYTECODE_ARRAY_BUILDER_H_ | 378 #endif // V8_INTERPRETER_BYTECODE_ARRAY_BUILDER_H_ |
OLD | NEW |