Commit d2881cd3 authored by Leszek Swirski's avatar Leszek Swirski Committed by Commit Bot

[objects] Use field definition macro for bytecode array

Use the DEFINE_FIELD_OFFSET_CONSTANTS macro to define the fields in the
BytecodeArray layout description.

Change-Id: I89ff2d7cd967aa1a503cbedd5d95dcd80f4d038c
Reviewed-on: https://chromium-review.googlesource.com/643130Reviewed-by: 's avatarIgor Sheludko <ishell@chromium.org>
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47713}
parent 3121449b
...@@ -3357,28 +3357,29 @@ class BytecodeArray : public FixedArrayBase { ...@@ -3357,28 +3357,29 @@ class BytecodeArray : public FixedArrayBase {
inline void clear_padding(); inline void clear_padding();
// Layout description. // Layout description.
static const int kConstantPoolOffset = FixedArrayBase::kHeaderSize; #define BYTECODE_ARRAY_FIELDS(V) \
static const int kHandlerTableOffset = kConstantPoolOffset + kPointerSize; /* Pointer fields. */ \
static const int kSourcePositionTableOffset = V(kConstantPoolOffset, kPointerSize) \
kHandlerTableOffset + kPointerSize; V(kHandlerTableOffset, kPointerSize) \
static const int kFrameSizeOffset = kSourcePositionTableOffset + kPointerSize; V(kSourcePositionTableOffset, kPointerSize) \
static const int kParameterSizeOffset = kFrameSizeOffset + kIntSize; V(kFrameSizeOffset, kIntSize) \
static const int kIncomingNewTargetOrGeneratorRegisterOffset = V(kParameterSizeOffset, kIntSize) \
kParameterSizeOffset + kIntSize; V(kIncomingNewTargetOrGeneratorRegisterOffset, kIntSize) \
static const int kInterruptBudgetOffset = V(kInterruptBudgetOffset, kIntSize) \
kIncomingNewTargetOrGeneratorRegisterOffset + kIntSize; V(kOSRNestingLevelOffset, kCharSize) \
static const int kOSRNestingLevelOffset = kInterruptBudgetOffset + kIntSize; V(kBytecodeAgeOffset, kCharSize) \
static const int kBytecodeAgeOffset = kOSRNestingLevelOffset + kCharSize; /* Total size. */ \
static const int kHeaderSize = kBytecodeAgeOffset + kCharSize; V(kHeaderSize, 0)
DEFINE_FIELD_OFFSET_CONSTANTS(FixedArrayBase::kHeaderSize,
BYTECODE_ARRAY_FIELDS)
#undef BYTECODE_ARRAY_FIELDS
// Maximal memory consumption for a single BytecodeArray. // Maximal memory consumption for a single BytecodeArray.
static const int kMaxSize = 512 * MB; static const int kMaxSize = 512 * MB;
// Maximal length of a single BytecodeArray. // Maximal length of a single BytecodeArray.
static const int kMaxLength = kMaxSize - kHeaderSize; static const int kMaxLength = kMaxSize - kHeaderSize;
static const int kPointerFieldsBeginOffset = kConstantPoolOffset;
static const int kPointerFieldsEndOffset = kFrameSizeOffset;
class BodyDescriptor; class BodyDescriptor;
// No weak fields. // No weak fields.
typedef BodyDescriptor BodyDescriptorWeak; typedef BodyDescriptor BodyDescriptorWeak;
......
...@@ -446,6 +446,7 @@ class SharedFunctionInfo : public HeapObject { ...@@ -446,6 +446,7 @@ class SharedFunctionInfo : public HeapObject {
DEFINE_FIELD_OFFSET_CONSTANTS(HeapObject::kHeaderSize, DEFINE_FIELD_OFFSET_CONSTANTS(HeapObject::kHeaderSize,
SHARED_FUNCTION_INFO_FIELDS) SHARED_FUNCTION_INFO_FIELDS)
#undef SHARED_FUNCTION_INFO_FIELDS
static const int kAlignedSize = POINTER_SIZE_ALIGN(kSize); static const int kAlignedSize = POINTER_SIZE_ALIGN(kSize);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment