| Index: src/objects.h
|
| diff --git a/src/objects.h b/src/objects.h
|
| index 16938972ba28f1a2af618a731cb2314502adf6d2..2b62a477119a441317781aecd9e149979a2672a3 100644
|
| --- a/src/objects.h
|
| +++ b/src/objects.h
|
| @@ -73,6 +73,7 @@
|
| // - JSFunctionProxy
|
| // - FixedArrayBase
|
| // - ByteArray
|
| +// - BytecodeArray
|
| // - FixedArray
|
| // - DescriptorArray
|
| // - HashTable
|
| @@ -398,6 +399,7 @@ const int kStubMinorKeyBits = kSmiValueSize - kStubMajorKeyBits - 1;
|
| V(FLOAT32X4_TYPE) \
|
| V(FOREIGN_TYPE) \
|
| V(BYTE_ARRAY_TYPE) \
|
| + V(BYTECODE_ARRAY_TYPE) \
|
| V(FREE_SPACE_TYPE) \
|
| /* Note: the order of these external array */ \
|
| /* types is relied upon in */ \
|
| @@ -694,6 +696,7 @@ enum InstanceType {
|
| FLOAT32X4_TYPE, // FIRST_SIMD_TYPE, LAST_SIMD_TYPE
|
| FOREIGN_TYPE,
|
| BYTE_ARRAY_TYPE,
|
| + BYTECODE_ARRAY_TYPE,
|
| FREE_SPACE_TYPE,
|
| EXTERNAL_INT8_ARRAY_TYPE, // FIRST_EXTERNAL_ARRAY_TYPE
|
| EXTERNAL_UINT8_ARRAY_TYPE,
|
| @@ -960,6 +963,7 @@ template <class C> inline bool Is(Object* obj);
|
| V(FixedUint8ClampedArray) \
|
| V(Float32x4) \
|
| V(ByteArray) \
|
| + V(BytecodeArray) \
|
| V(FreeSpace) \
|
| V(JSReceiver) \
|
| V(JSObject) \
|
| @@ -4260,6 +4264,43 @@ class ByteArray: public FixedArrayBase {
|
| };
|
|
|
|
|
| +// BytecodeArray represents a sequence of interpreter bytecodes.
|
| +class BytecodeArray : public ByteArray {
|
| + public:
|
| + static int SizeFor(int length) {
|
| + return OBJECT_POINTER_ALIGN(kHeaderSize + length);
|
| + }
|
| +
|
| + // Returns data start address.
|
| + inline Address GetFirstBytecodeAddress() {
|
| + return ByteArray::GetDataStartAddress();
|
| + }
|
| +
|
| + DECLARE_CAST(BytecodeArray)
|
| +
|
| + // Dispatched behavior.
|
| + inline int BytecodeArraySize() {
|
| + return SizeFor(this->length());
|
| + }
|
| +
|
| + DECLARE_PRINTER(BytecodeArray)
|
| + DECLARE_VERIFIER(BytecodeArray)
|
| +
|
| + void Disassemble(std::ostream& os);
|
| +
|
| + // Layout description.
|
| + static const int kAlignedSize = OBJECT_POINTER_ALIGN(kHeaderSize);
|
| +
|
| + // Maximal memory consumption for a single BytecodeArray.
|
| + static const int kMaxSize = ByteArray::kMaxSize;
|
| + // Maximal length of a single BytecodeArray.
|
| + static const int kMaxLength = kMaxSize - kHeaderSize;
|
| +
|
| + private:
|
| + DISALLOW_IMPLICIT_CONSTRUCTORS(BytecodeArray);
|
| +};
|
| +
|
| +
|
| // FreeSpace are fixed-size free memory blocks used by the heap and GC.
|
| // They look like heap objects (are heap object tagged and have a map) so that
|
| // the heap remains iterable. They have a size and a next pointer.
|
| @@ -6659,6 +6700,9 @@ class SharedFunctionInfo: public HeapObject {
|
| // Clear the type feedback vector with a more subtle policy at GC time.
|
| void ClearTypeFeedbackInfoAtGCTime();
|
|
|
| + // [bytecode_array]: Interpreter bytecodes.
|
| + DECL_ACCESSORS(bytecode_array, BytecodeArray)
|
| +
|
| #if TRACE_MAPS
|
| // [unique_id] - For --trace-maps purposes, an identifier that's persistent
|
| // even if the GC moves this SharedFunctionInfo.
|
| @@ -6932,13 +6976,14 @@ class SharedFunctionInfo: public HeapObject {
|
| static const int kInferredNameOffset = kDebugInfoOffset + kPointerSize;
|
| static const int kFeedbackVectorOffset =
|
| kInferredNameOffset + kPointerSize;
|
| + static const int kBytecodeArrayOffset = kFeedbackVectorOffset + kPointerSize;
|
| #if TRACE_MAPS
|
| - static const int kUniqueIdOffset = kFeedbackVectorOffset + kPointerSize;
|
| + static const int kUniqueIdOffset = kBytecodeArrayOffset + kPointerSize;
|
| static const int kLastPointerFieldOffset = kUniqueIdOffset;
|
| #else
|
| // Just to not break the postmortrem support with conditional offsets
|
| - static const int kUniqueIdOffset = kFeedbackVectorOffset;
|
| - static const int kLastPointerFieldOffset = kFeedbackVectorOffset;
|
| + static const int kUniqueIdOffset = kBytecodeArrayOffset;
|
| + static const int kLastPointerFieldOffset = kBytecodeArrayOffset;
|
| #endif
|
|
|
| #if V8_HOST_ARCH_32_BIT
|
|
|