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 {
inline void clear_padding();
// Layout description.
static const int kConstantPoolOffset = FixedArrayBase::kHeaderSize;
static const int kHandlerTableOffset = kConstantPoolOffset + kPointerSize;
static const int kSourcePositionTableOffset =
kHandlerTableOffset + kPointerSize;
static const int kFrameSizeOffset = kSourcePositionTableOffset + kPointerSize;
static const int kParameterSizeOffset = kFrameSizeOffset + kIntSize;
static const int kIncomingNewTargetOrGeneratorRegisterOffset =
kParameterSizeOffset + kIntSize;
static const int kInterruptBudgetOffset =
kIncomingNewTargetOrGeneratorRegisterOffset + kIntSize;
static const int kOSRNestingLevelOffset = kInterruptBudgetOffset + kIntSize;
static const int kBytecodeAgeOffset = kOSRNestingLevelOffset + kCharSize;
static const int kHeaderSize = kBytecodeAgeOffset + kCharSize;
#define BYTECODE_ARRAY_FIELDS(V) \
/* Pointer fields. */ \
V(kConstantPoolOffset, kPointerSize) \
V(kHandlerTableOffset, kPointerSize) \
V(kSourcePositionTableOffset, kPointerSize) \
V(kFrameSizeOffset, kIntSize) \
V(kParameterSizeOffset, kIntSize) \
V(kIncomingNewTargetOrGeneratorRegisterOffset, kIntSize) \
V(kInterruptBudgetOffset, kIntSize) \
V(kOSRNestingLevelOffset, kCharSize) \
V(kBytecodeAgeOffset, kCharSize) \
/* Total size. */ \
V(kHeaderSize, 0)
DEFINE_FIELD_OFFSET_CONSTANTS(FixedArrayBase::kHeaderSize,
BYTECODE_ARRAY_FIELDS)
#undef BYTECODE_ARRAY_FIELDS
// Maximal memory consumption for a single BytecodeArray.
static const int kMaxSize = 512 * MB;
// Maximal length of a single BytecodeArray.
static const int kMaxLength = kMaxSize - kHeaderSize;
static const int kPointerFieldsBeginOffset = kConstantPoolOffset;
static const int kPointerFieldsEndOffset = kFrameSizeOffset;
class BodyDescriptor;
// No weak fields.
typedef BodyDescriptor BodyDescriptorWeak;
......
......@@ -446,6 +446,7 @@ class SharedFunctionInfo : public HeapObject {
DEFINE_FIELD_OFFSET_CONSTANTS(HeapObject::kHeaderSize,
SHARED_FUNCTION_INFO_FIELDS)
#undef SHARED_FUNCTION_INFO_FIELDS
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