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/assert-scope.h" | 10 #include "src/assert-scope.h" |
(...skipping 4430 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4441 // offset and source position. | 4441 // offset and source position. |
4442 DECL_ACCESSORS(source_position_table, ByteArray) | 4442 DECL_ACCESSORS(source_position_table, ByteArray) |
4443 | 4443 |
4444 DECLARE_CAST(BytecodeArray) | 4444 DECLARE_CAST(BytecodeArray) |
4445 | 4445 |
4446 // Dispatched behavior. | 4446 // Dispatched behavior. |
4447 inline int BytecodeArraySize(); | 4447 inline int BytecodeArraySize(); |
4448 | 4448 |
4449 inline int instruction_size(); | 4449 inline int instruction_size(); |
4450 | 4450 |
| 4451 // Returns the size of bytecode and its metadata. This includes the size of |
| 4452 // bytecode, constant pool, source position table, and handler table. |
| 4453 inline int SizeIncludingMetadata(); |
| 4454 |
4451 int SourcePosition(int offset); | 4455 int SourcePosition(int offset); |
4452 int SourceStatementPosition(int offset); | 4456 int SourceStatementPosition(int offset); |
4453 | 4457 |
4454 DECLARE_PRINTER(BytecodeArray) | 4458 DECLARE_PRINTER(BytecodeArray) |
4455 DECLARE_VERIFIER(BytecodeArray) | 4459 DECLARE_VERIFIER(BytecodeArray) |
4456 | 4460 |
4457 void Disassemble(std::ostream& os); | 4461 void Disassemble(std::ostream& os); |
4458 | 4462 |
4459 void CopyBytecodesTo(BytecodeArray* to); | 4463 void CopyBytecodesTo(BytecodeArray* to); |
4460 | 4464 |
(...skipping 657 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5118 | 5122 |
5119 // Returns the address of the first instruction. | 5123 // Returns the address of the first instruction. |
5120 inline byte* instruction_start(); | 5124 inline byte* instruction_start(); |
5121 | 5125 |
5122 // Returns the address right after the last instruction. | 5126 // Returns the address right after the last instruction. |
5123 inline byte* instruction_end(); | 5127 inline byte* instruction_end(); |
5124 | 5128 |
5125 // Returns the size of the instructions, padding, and relocation information. | 5129 // Returns the size of the instructions, padding, and relocation information. |
5126 inline int body_size(); | 5130 inline int body_size(); |
5127 | 5131 |
| 5132 // Returns the size of code and its metadata. This includes the size of code |
| 5133 // relocation information, deoptimization data and handler table. |
| 5134 inline int SizeIncludingMetadata(); |
| 5135 |
5128 // Returns the address of the first relocation info (read backwards!). | 5136 // Returns the address of the first relocation info (read backwards!). |
5129 inline byte* relocation_start(); | 5137 inline byte* relocation_start(); |
5130 | 5138 |
5131 // Code entry point. | 5139 // Code entry point. |
5132 inline byte* entry(); | 5140 inline byte* entry(); |
5133 | 5141 |
5134 // Returns true if pc is inside this object's instructions. | 5142 // Returns true if pc is inside this object's instructions. |
5135 inline bool contains(byte* pc); | 5143 inline bool contains(byte* pc); |
5136 | 5144 |
5137 // Relocate the code by delta bytes. Called to signal that this code | 5145 // Relocate the code by delta bytes. Called to signal that this code |
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5349 }; | 5357 }; |
5350 | 5358 |
5351 class AbstractCode : public HeapObject { | 5359 class AbstractCode : public HeapObject { |
5352 public: | 5360 public: |
5353 // All code kinds and INTERPRETED_FUNCTION. | 5361 // All code kinds and INTERPRETED_FUNCTION. |
5354 enum Kind { | 5362 enum Kind { |
5355 #define DEFINE_CODE_KIND_ENUM(name) name, | 5363 #define DEFINE_CODE_KIND_ENUM(name) name, |
5356 CODE_KIND_LIST(DEFINE_CODE_KIND_ENUM) | 5364 CODE_KIND_LIST(DEFINE_CODE_KIND_ENUM) |
5357 #undef DEFINE_CODE_KIND_ENUM | 5365 #undef DEFINE_CODE_KIND_ENUM |
5358 INTERPRETED_FUNCTION, | 5366 INTERPRETED_FUNCTION, |
| 5367 NUMBER_OF_KINDS |
5359 }; | 5368 }; |
5360 | 5369 |
| 5370 static const char* Kind2String(Kind kind); |
| 5371 |
5361 int SourcePosition(int offset); | 5372 int SourcePosition(int offset); |
5362 int SourceStatementPosition(int offset); | 5373 int SourceStatementPosition(int offset); |
5363 | 5374 |
5364 // Returns the address of the first instruction. | 5375 // Returns the address of the first instruction. |
5365 inline Address instruction_start(); | 5376 inline Address instruction_start(); |
5366 | 5377 |
5367 // Returns the address right after the last instruction. | 5378 // Returns the address right after the last instruction. |
5368 inline Address instruction_end(); | 5379 inline Address instruction_end(); |
5369 | 5380 |
5370 // Returns the of the code instructions. | 5381 // Returns the size of the code instructions. |
5371 inline int instruction_size(); | 5382 inline int instruction_size(); |
5372 | 5383 |
| 5384 // Returns the size of instructions and the metadata. |
| 5385 inline int SizeIncludingMetadata(); |
| 5386 |
5373 // Returns true if pc is inside this object's instructions. | 5387 // Returns true if pc is inside this object's instructions. |
5374 inline bool contains(byte* pc); | 5388 inline bool contains(byte* pc); |
5375 | 5389 |
5376 // Returns the AbstractCode::Kind of the code. | 5390 // Returns the AbstractCode::Kind of the code. |
5377 inline Kind kind(); | 5391 inline Kind kind(); |
5378 | 5392 |
5379 // Calculate the size of the code object to report for log events. This takes | 5393 // Calculate the size of the code object to report for log events. This takes |
5380 // the layout of the code object into account. | 5394 // the layout of the code object into account. |
5381 inline int ExecutableSize(); | 5395 inline int ExecutableSize(); |
5382 | 5396 |
(...skipping 5366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10749 } | 10763 } |
10750 return value; | 10764 return value; |
10751 } | 10765 } |
10752 }; | 10766 }; |
10753 | 10767 |
10754 | 10768 |
10755 } // NOLINT, false-positive due to second-order macros. | 10769 } // NOLINT, false-positive due to second-order macros. |
10756 } // NOLINT, false-positive due to second-order macros. | 10770 } // NOLINT, false-positive due to second-order macros. |
10757 | 10771 |
10758 #endif // V8_OBJECTS_H_ | 10772 #endif // V8_OBJECTS_H_ |
OLD | NEW |