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_OBJECTS_H_ | 5 #ifndef V8_OBJECTS_H_ |
6 #define V8_OBJECTS_H_ | 6 #define V8_OBJECTS_H_ |
7 | 7 |
8 #include <iosfwd> | 8 #include <iosfwd> |
9 | 9 |
10 #include "src/allocation.h" | 10 #include "src/allocation.h" |
(...skipping 4433 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4444 inline int frame_size() const; | 4444 inline int frame_size() const; |
4445 inline void set_frame_size(int frame_size); | 4445 inline void set_frame_size(int frame_size); |
4446 | 4446 |
4447 // Accessor for register count (derived from frame_size). | 4447 // Accessor for register count (derived from frame_size). |
4448 inline int register_count() const; | 4448 inline int register_count() const; |
4449 | 4449 |
4450 // Accessors for parameter count (including implicit 'this' receiver). | 4450 // Accessors for parameter count (including implicit 'this' receiver). |
4451 inline int parameter_count() const; | 4451 inline int parameter_count() const; |
4452 inline void set_parameter_count(int number_of_parameters); | 4452 inline void set_parameter_count(int number_of_parameters); |
4453 | 4453 |
| 4454 // Accessors for profiling count. |
| 4455 inline int interrupt_budget() const; |
| 4456 inline void set_interrupt_budget(int interrupt_budget); |
| 4457 |
4454 // Accessors for the constant pool. | 4458 // Accessors for the constant pool. |
4455 DECL_ACCESSORS(constant_pool, FixedArray) | 4459 DECL_ACCESSORS(constant_pool, FixedArray) |
4456 | 4460 |
4457 // Accessors for handler table containing offsets of exception handlers. | 4461 // Accessors for handler table containing offsets of exception handlers. |
4458 DECL_ACCESSORS(handler_table, FixedArray) | 4462 DECL_ACCESSORS(handler_table, FixedArray) |
4459 | 4463 |
4460 // Accessors for source position table containing mappings between byte code | 4464 // Accessors for source position table containing mappings between byte code |
4461 // offset and source position. | 4465 // offset and source position. |
4462 DECL_ACCESSORS(source_position_table, FixedArray) | 4466 DECL_ACCESSORS(source_position_table, FixedArray) |
4463 | 4467 |
4464 DECLARE_CAST(BytecodeArray) | 4468 DECLARE_CAST(BytecodeArray) |
4465 | 4469 |
4466 // Dispatched behavior. | 4470 // Dispatched behavior. |
4467 inline int BytecodeArraySize(); | 4471 inline int BytecodeArraySize(); |
4468 | 4472 |
4469 inline int instruction_size(); | 4473 inline int instruction_size(); |
4470 | 4474 |
4471 int SourcePosition(int offset); | 4475 int SourcePosition(int offset); |
4472 int SourceStatementPosition(int offset); | 4476 int SourceStatementPosition(int offset); |
4473 | 4477 |
4474 DECLARE_PRINTER(BytecodeArray) | 4478 DECLARE_PRINTER(BytecodeArray) |
4475 DECLARE_VERIFIER(BytecodeArray) | 4479 DECLARE_VERIFIER(BytecodeArray) |
4476 | 4480 |
4477 void Disassemble(std::ostream& os); | 4481 void Disassemble(std::ostream& os); |
4478 | 4482 |
4479 // Layout description. | 4483 // Layout description. |
4480 static const int kFrameSizeOffset = FixedArrayBase::kHeaderSize; | 4484 static const int kConstantPoolOffset = FixedArrayBase::kHeaderSize; |
4481 static const int kParameterSizeOffset = kFrameSizeOffset + kIntSize; | |
4482 static const int kConstantPoolOffset = kParameterSizeOffset + kIntSize; | |
4483 static const int kHandlerTableOffset = kConstantPoolOffset + kPointerSize; | 4485 static const int kHandlerTableOffset = kConstantPoolOffset + kPointerSize; |
4484 static const int kSourcePositionTableOffset = | 4486 static const int kSourcePositionTableOffset = |
4485 kHandlerTableOffset + kPointerSize; | 4487 kHandlerTableOffset + kPointerSize; |
4486 static const int kHeaderSize = kSourcePositionTableOffset + kPointerSize; | 4488 static const int kFrameSizeOffset = kSourcePositionTableOffset + kPointerSize; |
| 4489 static const int kParameterSizeOffset = kFrameSizeOffset + kIntSize; |
| 4490 static const int kInterruptBudgetOffset = kParameterSizeOffset + kIntSize; |
| 4491 static const int kHeaderSize = kInterruptBudgetOffset + kIntSize; |
4487 | 4492 |
4488 // Maximal memory consumption for a single BytecodeArray. | 4493 // Maximal memory consumption for a single BytecodeArray. |
4489 static const int kMaxSize = 512 * MB; | 4494 static const int kMaxSize = 512 * MB; |
4490 // Maximal length of a single BytecodeArray. | 4495 // Maximal length of a single BytecodeArray. |
4491 static const int kMaxLength = kMaxSize - kHeaderSize; | 4496 static const int kMaxLength = kMaxSize - kHeaderSize; |
4492 | 4497 |
4493 class BodyDescriptor; | 4498 class BodyDescriptor; |
4494 | 4499 |
4495 private: | 4500 private: |
4496 DISALLOW_IMPLICIT_CONSTRUCTORS(BytecodeArray); | 4501 DISALLOW_IMPLICIT_CONSTRUCTORS(BytecodeArray); |
(...skipping 6335 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10832 } | 10837 } |
10833 return value; | 10838 return value; |
10834 } | 10839 } |
10835 }; | 10840 }; |
10836 | 10841 |
10837 | 10842 |
10838 } // NOLINT, false-positive due to second-order macros. | 10843 } // NOLINT, false-positive due to second-order macros. |
10839 } // NOLINT, false-positive due to second-order macros. | 10844 } // NOLINT, false-positive due to second-order macros. |
10840 | 10845 |
10841 #endif // V8_OBJECTS_H_ | 10846 #endif // V8_OBJECTS_H_ |
OLD | NEW |