Commit ca88d049 authored by Irina Yatsenko's avatar Irina Yatsenko Committed by Commit Bot

Derive SourcePositionTableWithFrameCache directly from Struct

Bug: v8:9158
Change-Id: I40a419a65485a5f407710cbe0cc44275c3fc9739
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1575037Reviewed-by: 's avatarJakob Gruber <jgruber@chromium.org>
Reviewed-by: 's avatarTobias Tebbi <tebbi@chromium.org>
Reviewed-by: 's avatarMichael Starzinger <mstarzinger@chromium.org>
Reviewed-by: 's avatarUlan Degenbaev <ulan@chromium.org>
Commit-Queue: Irina Yatsenko <irinayat@microsoft.com>
Cr-Commit-Position: refs/heads/master@{#61022}
parent 2974a184
......@@ -159,6 +159,12 @@ extern class EnumCache extends Struct {
indices: FixedArray;
}
@generatePrint
extern class SourcePositionTableWithFrameCache extends Struct {
source_position_table: ByteArray;
stack_frame_cache: Object;
}
// These intrinsics should never be called from Torque code. They're used
// internally by the 'new' operator and only declared here because it's simpler
// than building the definition from C++.
......
......@@ -351,6 +351,7 @@ Type::bitset BitsetType::Lub(const MapRefLike& map) {
case TUPLE2_TYPE:
case TUPLE3_TYPE:
case ENUM_CACHE_TYPE:
case SOURCE_POSITION_TABLE_WITH_FRAME_CACHE_TYPE:
case WASM_DEBUG_INFO_TYPE:
case WASM_EXCEPTION_TAG_TYPE:
case WASM_EXPORTED_FUNCTION_DATA_TYPE:
......
......@@ -3962,7 +3962,8 @@ Factory::NewSourcePositionTableWithFrameCache(
Handle<SourcePositionTableWithFrameCache>
source_position_table_with_frame_cache =
Handle<SourcePositionTableWithFrameCache>::cast(
NewStruct(TUPLE2_TYPE, AllocationType::kOld));
NewStruct(SOURCE_POSITION_TABLE_WITH_FRAME_CACHE_TYPE,
AllocationType::kOld));
source_position_table_with_frame_cache->set_source_position_table(
*source_position_table);
source_position_table_with_frame_cache->set_stack_frame_cache(
......
......@@ -1858,6 +1858,13 @@ void EnumCache::EnumCacheVerify(Isolate* isolate) {
}
}
void SourcePositionTableWithFrameCache::SourcePositionTableWithFrameCacheVerify(
Isolate* isolate) {
VerifyObjectField(isolate, kSourcePositionTableOffset);
VerifyObjectField(isolate, kStackFrameCacheOffset);
CHECK(source_position_table()->IsByteArray());
}
void Tuple3::Tuple3Verify(Isolate* isolate) {
CHECK(IsTuple3());
VerifyObjectField(isolate, kValue1Offset);
......
......@@ -108,6 +108,7 @@ namespace internal {
V(PROMISE_REACTION_TYPE) \
V(PROTOTYPE_INFO_TYPE) \
V(SCRIPT_TYPE) \
V(SOURCE_POSITION_TABLE_WITH_FRAME_CACHE_TYPE) \
V(STACK_FRAME_INFO_TYPE) \
V(STACK_TRACE_FRAME_TYPE) \
V(TUPLE2_TYPE) \
......@@ -323,6 +324,8 @@ namespace internal {
V(_, PROMISE_REACTION_TYPE, PromiseReaction, promise_reaction) \
V(_, PROTOTYPE_INFO_TYPE, PrototypeInfo, prototype_info) \
V(_, SCRIPT_TYPE, Script, script) \
V(_, SOURCE_POSITION_TABLE_WITH_FRAME_CACHE_TYPE, \
SourcePositionTableWithFrameCache, source_position_table_with_frame_cache)\
V(_, STACK_FRAME_INFO_TYPE, StackFrameInfo, stack_frame_info) \
V(_, STACK_TRACE_FRAME_TYPE, StackTraceFrame, stack_trace_frame) \
V(_, TUPLE2_TYPE, Tuple2, tuple2) \
......
......@@ -467,7 +467,6 @@ class ZoneForwardList;
V(SmallOrderedHashMap) \
V(SmallOrderedHashSet) \
V(SmallOrderedNameDictionary) \
V(SourcePositionTableWithFrameCache) \
V(StoreHandler) \
V(String) \
V(StringSet) \
......
......@@ -29,7 +29,7 @@ OBJECT_CONSTRUCTORS_IMPL(BytecodeArray, FixedArrayBase)
OBJECT_CONSTRUCTORS_IMPL(AbstractCode, HeapObject)
OBJECT_CONSTRUCTORS_IMPL(DependentCode, WeakFixedArray)
OBJECT_CONSTRUCTORS_IMPL(CodeDataContainer, HeapObject)
OBJECT_CONSTRUCTORS_IMPL(SourcePositionTableWithFrameCache, Tuple2)
OBJECT_CONSTRUCTORS_IMPL(SourcePositionTableWithFrameCache, Struct)
NEVER_READ_ONLY_SPACE_IMPL(AbstractCode)
......@@ -42,9 +42,9 @@ CAST_ACCESSOR(DeoptimizationData)
CAST_ACCESSOR(SourcePositionTableWithFrameCache)
ACCESSORS(SourcePositionTableWithFrameCache, source_position_table, ByteArray,
kSourcePositionTableIndex)
kSourcePositionTableOffset)
ACCESSORS(SourcePositionTableWithFrameCache, stack_frame_cache,
SimpleNumberDictionary, kStackFrameCacheIndex)
SimpleNumberDictionary, kStackFrameCacheOffset)
int AbstractCode::raw_instruction_size() {
if (IsCode()) {
......
......@@ -948,25 +948,22 @@ class DeoptimizationData : public FixedArray {
OBJECT_CONSTRUCTORS(DeoptimizationData, FixedArray);
};
class SourcePositionTableWithFrameCache : public Tuple2 {
class SourcePositionTableWithFrameCache : public Struct {
public:
DECL_ACCESSORS(source_position_table, ByteArray)
DECL_ACCESSORS(stack_frame_cache, SimpleNumberDictionary)
DECL_CAST(SourcePositionTableWithFrameCache)
// Layout description.
#define SOURCE_POSITION_TABLE_WITH_FRAME_FIELDS(V) \
V(kSourcePositionTableIndex, kTaggedSize) \
V(kStackFrameCacheIndex, kTaggedSize) \
/* Total size. */ \
V(kSize, 0)
DECL_PRINTER(SourcePositionTableWithFrameCache)
DECL_VERIFIER(SourcePositionTableWithFrameCache)
DEFINE_FIELD_OFFSET_CONSTANTS(Struct::kHeaderSize,
SOURCE_POSITION_TABLE_WITH_FRAME_FIELDS)
#undef SOURCE_POSITION_TABLE_WITH_FRAME_FIELDS
// Layout description.
DEFINE_FIELD_OFFSET_CONSTANTS(
Struct::kHeaderSize,
TORQUE_GENERATED_SOURCE_POSITION_TABLE_WITH_FRAME_CACHE_FIELDS)
OBJECT_CONSTRUCTORS(SourcePositionTableWithFrameCache, Tuple2);
OBJECT_CONSTRUCTORS(SourcePositionTableWithFrameCache, Struct);
};
} // namespace internal
......
......@@ -168,6 +168,7 @@ enum InstanceType : uint16_t {
PROMISE_REACTION_TYPE,
PROTOTYPE_INFO_TYPE,
SCRIPT_TYPE,
SOURCE_POSITION_TABLE_WITH_FRAME_CACHE_TYPE,
STACK_FRAME_INFO_TYPE,
STACK_TRACE_FRAME_TYPE,
TUPLE2_TYPE,
......@@ -471,7 +472,6 @@ V8_EXPORT_PRIVATE std::ostream& operator<<(std::ostream& os,
V(SmallOrderedHashMap, SMALL_ORDERED_HASH_MAP_TYPE) \
V(SmallOrderedHashSet, SMALL_ORDERED_HASH_SET_TYPE) \
V(SmallOrderedNameDictionary, SMALL_ORDERED_NAME_DICTIONARY_TYPE) \
V(SourcePositionTableWithFrameCache, TUPLE2_TYPE) \
V(StoreHandler, STORE_HANDLER_TYPE) \
V(StringTable, STRING_TABLE_TYPE) \
V(Symbol, SYMBOL_TYPE) \
......
This diff is collapsed.
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