| Index: src/objects-inl.h
|
| diff --git a/src/objects-inl.h b/src/objects-inl.h
|
| index f5900849b7021765ca523186995cc541d38690d3..c6c417f419f7de5195e6b0e7616ee100e0e55d74 100644
|
| --- a/src/objects-inl.h
|
| +++ b/src/objects-inl.h
|
| @@ -4021,13 +4021,20 @@ int BytecodeArray::parameter_count() const {
|
|
|
| ACCESSORS(BytecodeArray, constant_pool, FixedArray, kConstantPoolOffset)
|
| ACCESSORS(BytecodeArray, handler_table, FixedArray, kHandlerTableOffset)
|
| -ACCESSORS(BytecodeArray, source_position_table, ByteArray,
|
| +ACCESSORS(BytecodeArray, source_position_table, Object,
|
| kSourcePositionTableOffset)
|
|
|
| Address BytecodeArray::GetFirstBytecodeAddress() {
|
| return reinterpret_cast<Address>(this) - kHeapObjectTag + kHeaderSize;
|
| }
|
|
|
| +ByteArray* BytecodeArray::SourcePositionTable() {
|
| + Object* maybe_table = source_position_table();
|
| + if (maybe_table->IsByteArray()) return ByteArray::cast(maybe_table);
|
| + DCHECK(maybe_table->IsSourcePositionTableWithFrameCache());
|
| + return SourcePositionTableWithFrameCache::cast(maybe_table)
|
| + ->source_position_table();
|
| +}
|
|
|
| int BytecodeArray::BytecodeArraySize() { return SizeFor(this->length()); }
|
|
|
| @@ -4035,7 +4042,7 @@ int BytecodeArray::SizeIncludingMetadata() {
|
| int size = BytecodeArraySize();
|
| size += constant_pool()->Size();
|
| size += handler_table()->Size();
|
| - size += source_position_table()->Size();
|
| + size += SourcePositionTable()->Size();
|
| return size;
|
| }
|
|
|
| @@ -5235,9 +5242,9 @@ int AbstractCode::instruction_size() {
|
|
|
| ByteArray* AbstractCode::source_position_table() {
|
| if (IsCode()) {
|
| - return GetCode()->source_position_table();
|
| + return GetCode()->SourcePositionTable();
|
| } else {
|
| - return GetBytecodeArray()->source_position_table();
|
| + return GetBytecodeArray()->SourcePositionTable();
|
| }
|
| }
|
|
|
| @@ -5249,6 +5256,20 @@ void AbstractCode::set_source_position_table(ByteArray* source_position_table) {
|
| }
|
| }
|
|
|
| +Object* AbstractCode::stack_frame_cache() {
|
| + Object* maybe_table;
|
| + if (IsCode()) {
|
| + maybe_table = GetCode()->source_position_table();
|
| + } else {
|
| + maybe_table = GetBytecodeArray()->source_position_table();
|
| + }
|
| + if (maybe_table->IsSourcePositionTableWithFrameCache()) {
|
| + return SourcePositionTableWithFrameCache::cast(maybe_table)
|
| + ->stack_frame_cache();
|
| + }
|
| + return Smi::kZero;
|
| +}
|
| +
|
| int AbstractCode::SizeIncludingMetadata() {
|
| if (IsCode()) {
|
| return GetCode()->SizeIncludingMetadata();
|
| @@ -5824,6 +5845,11 @@ BOOL_ACCESSORS(StackFrameInfo, flag, is_wasm, kIsWasmBit)
|
| ACCESSORS(StackTraceInfo, frames, FixedArray, kFramesIndex)
|
| SMI_ACCESSORS(StackTraceInfo, options, kOptionsIndex)
|
|
|
| +ACCESSORS(SourcePositionTableWithFrameCache, source_position_table, ByteArray,
|
| + kSourcePositionTableIndex)
|
| +ACCESSORS(SourcePositionTableWithFrameCache, stack_frame_cache,
|
| + UnseededNumberDictionary, kStackFrameCacheIndex)
|
| +
|
| ACCESSORS(SharedFunctionInfo, name, Object, kNameOffset)
|
| ACCESSORS(SharedFunctionInfo, optimized_code_map, FixedArray,
|
| kOptimizedCodeMapOffset)
|
| @@ -6650,7 +6676,7 @@ INT_ACCESSORS(Code, constant_pool_offset, kConstantPoolOffset)
|
| CODE_ACCESSORS(relocation_info, ByteArray, kRelocationInfoOffset)
|
| CODE_ACCESSORS(handler_table, FixedArray, kHandlerTableOffset)
|
| CODE_ACCESSORS(deoptimization_data, FixedArray, kDeoptimizationDataOffset)
|
| -CODE_ACCESSORS(source_position_table, ByteArray, kSourcePositionTableOffset)
|
| +CODE_ACCESSORS(source_position_table, Object, kSourcePositionTableOffset)
|
| CODE_ACCESSORS(trap_handler_index, Smi, kTrapHandlerIndex)
|
| CODE_ACCESSORS(raw_type_feedback_info, Object, kTypeFeedbackInfoOffset)
|
| CODE_ACCESSORS(next_code_link, Object, kNextCodeLinkOffset)
|
| @@ -6683,6 +6709,13 @@ void Code::set_type_feedback_info(Object* value, WriteBarrierMode mode) {
|
| value, mode);
|
| }
|
|
|
| +ByteArray* Code::SourcePositionTable() {
|
| + Object* maybe_table = source_position_table();
|
| + if (maybe_table->IsByteArray()) return ByteArray::cast(maybe_table);
|
| + DCHECK(maybe_table->IsSourcePositionTableWithFrameCache());
|
| + return SourcePositionTableWithFrameCache::cast(maybe_table)
|
| + ->source_position_table();
|
| +}
|
|
|
| uint32_t Code::stub_key() {
|
| DCHECK(IsCodeStubOrIC());
|
| @@ -6749,7 +6782,9 @@ int Code::SizeIncludingMetadata() {
|
| size += relocation_info()->Size();
|
| size += deoptimization_data()->Size();
|
| size += handler_table()->Size();
|
| - if (kind() == FUNCTION) size += source_position_table()->Size();
|
| + if (kind() == FUNCTION) {
|
| + size += SourcePositionTable()->Size();
|
| + }
|
| return size;
|
| }
|
|
|
|
|