Commit 35c0d461 authored by Tobias Tebbi's avatar Tobias Tebbi Committed by Commit Bot

[torque] fully port UncompiledData classes

Drive-by change: Fix wrong reference to FixedRangeBodyDescriptor in
                 implementation-visitor.cc

TBR: ulan@chromium.org
Change-Id: I8a1f468f35c38f5be1f4e8d1cfcc9f0fd2a16381
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2540546
Commit-Queue: Tobias Tebbi <tebbi@chromium.org>
Auto-Submit: Tobias Tebbi <tebbi@chromium.org>
Reviewed-by: 's avatarUlan Degenbaev <ulan@chromium.org>
Reviewed-by: 's avatarLeszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/master@{#71223}
parent b777c1f9
......@@ -2330,23 +2330,6 @@ void PreparseData::PreparseDataPrint(std::ostream& os) { // NOLINT
os << "\n";
}
void UncompiledDataWithoutPreparseData::UncompiledDataWithoutPreparseDataPrint(
std::ostream& os) { // NOLINT
PrintHeader(os, "UncompiledDataWithoutPreparseData");
os << "\n - start position: " << start_position();
os << "\n - end position: " << end_position();
os << "\n";
}
void UncompiledDataWithPreparseData::UncompiledDataWithPreparseDataPrint(
std::ostream& os) { // NOLINT
PrintHeader(os, "UncompiledDataWithPreparseData");
os << "\n - start position: " << start_position();
os << "\n - end position: " << end_position();
os << "\n - preparse_data: " << Brief(preparse_data());
os << "\n";
}
void InterpreterData::InterpreterDataPrint(std::ostream& os) { // NOLINT
PrintHeader(os, "InterpreterData");
os << "\n - bytecode_array: " << Brief(bytecode_array());
......
......@@ -275,14 +275,8 @@ Handle<UncompiledDataWithoutPreparseData>
FactoryBase<Impl>::NewUncompiledDataWithoutPreparseData(
Handle<String> inferred_name, int32_t start_position,
int32_t end_position) {
Handle<UncompiledDataWithoutPreparseData> result = handle(
UncompiledDataWithoutPreparseData::cast(NewWithImmortalMap(
impl()->read_only_roots().uncompiled_data_without_preparse_data_map(),
AllocationType::kOld)),
isolate());
result->Init(impl(), *inferred_name, start_position, end_position);
return result;
return TorqueGeneratedFactory<Impl>::NewUncompiledDataWithoutPreparseData(
inferred_name, start_position, end_position, AllocationType::kOld);
}
template <typename Impl>
......@@ -290,16 +284,9 @@ Handle<UncompiledDataWithPreparseData>
FactoryBase<Impl>::NewUncompiledDataWithPreparseData(
Handle<String> inferred_name, int32_t start_position, int32_t end_position,
Handle<PreparseData> preparse_data) {
Handle<UncompiledDataWithPreparseData> result = handle(
UncompiledDataWithPreparseData::cast(NewWithImmortalMap(
impl()->read_only_roots().uncompiled_data_with_preparse_data_map(),
AllocationType::kOld)),
isolate());
result->Init(impl(), *inferred_name, start_position, end_position,
*preparse_data);
return result;
return TorqueGeneratedFactory<Impl>::NewUncompiledDataWithPreparseData(
inferred_name, start_position, end_position, preparse_data,
AllocationType::kOld);
}
template <typename Impl>
......
......@@ -51,8 +51,6 @@ namespace internal {
V(Symbol) \
V(SyntheticModule) \
V(TransitionArray) \
V(UncompiledDataWithoutPreparseData) \
V(UncompiledDataWithPreparseData) \
V(WasmArray) \
V(WasmIndirectFunctionTable) \
V(WasmInstanceObject) \
......
......@@ -495,12 +495,6 @@ bool Heap::CreateInitialMaps() {
next_call_side_effect_free_call_handler_info)
ALLOCATE_VARSIZE_MAP(PREPARSE_DATA_TYPE, preparse_data)
ALLOCATE_MAP(UNCOMPILED_DATA_WITHOUT_PREPARSE_DATA_TYPE,
UncompiledDataWithoutPreparseData::kSize,
uncompiled_data_without_preparse_data)
ALLOCATE_MAP(UNCOMPILED_DATA_WITH_PREPARSE_DATA_TYPE,
UncompiledDataWithPreparseData::kSize,
uncompiled_data_with_preparse_data)
ALLOCATE_MAP(SHARED_FUNCTION_INFO_TYPE, SharedFunctionInfo::kAlignedSize,
shared_function_info)
ALLOCATE_MAP(SOURCE_TEXT_MODULE_TYPE, SourceTextModule::kSize,
......
......@@ -277,11 +277,6 @@ TYPED_ARRAYS(TYPED_ARRAY_IS_TYPE_FUNCTION_DECL)
V(_, SymbolMap, symbol_map, Symbol) \
V(_, TransitionArrayMap, transition_array_map, TransitionArray) \
V(_, Tuple2Map, tuple2_map, Tuple2) \
V(_, UncompiledDataWithoutPreparseDataMap, \
uncompiled_data_without_preparse_data_map, \
UncompiledDataWithoutPreparseData) \
V(_, UncompiledDataWithPreparseDataMap, \
uncompiled_data_with_preparse_data_map, UncompiledDataWithPreparseData) \
V(_, WeakFixedArrayMap, weak_fixed_array_map, WeakFixedArray) \
TORQUE_DEFINED_MAP_CSA_LIST_GENERATOR(V, _)
......
......@@ -248,12 +248,6 @@ VisitorId Map::GetVisitorId(Map map) {
case PREPARSE_DATA_TYPE:
return kVisitPreparseData;
case UNCOMPILED_DATA_WITHOUT_PREPARSE_DATA_TYPE:
return kVisitUncompiledDataWithoutPreparseData;
case UNCOMPILED_DATA_WITH_PREPARSE_DATA_TYPE:
return kVisitUncompiledDataWithPreparseData;
case COVERAGE_INFO_TYPE:
return kVisitCoverageInfo;
......
......@@ -68,8 +68,6 @@ enum InstanceType : uint16_t;
V(Symbol) \
V(SyntheticModule) \
V(TransitionArray) \
V(UncompiledDataWithoutPreparseData) \
V(UncompiledDataWithPreparseData) \
V(WasmIndirectFunctionTable) \
V(WasmInstanceObject) \
V(WasmArray) \
......
......@@ -215,9 +215,6 @@ class ZoneForwardList;
V(TemplateList) \
V(ThinString) \
V(TransitionArray) \
V(UncompiledData) \
V(UncompiledDataWithPreparseData) \
V(UncompiledDataWithoutPreparseData) \
V(Undetectable) \
V(UniqueName) \
V(WasmArray) \
......
......@@ -1062,12 +1062,6 @@ ReturnType BodyDescriptorApply(InstanceType type, T1 p1, T2 p2, T3 p3, T4 p4) {
p4);
case PREPARSE_DATA_TYPE:
return Op::template apply<PreparseData::BodyDescriptor>(p1, p2, p3, p4);
case UNCOMPILED_DATA_WITHOUT_PREPARSE_DATA_TYPE:
return Op::template apply<
UncompiledDataWithoutPreparseData::BodyDescriptor>(p1, p2, p3, p4);
case UNCOMPILED_DATA_WITH_PREPARSE_DATA_TYPE:
return Op::template apply<UncompiledDataWithPreparseData::BodyDescriptor>(
p1, p2, p3, p4);
case HEAP_NUMBER_TYPE:
case FILLER_TYPE:
case BYTE_ARRAY_TYPE:
......
......@@ -644,14 +644,6 @@ void SharedFunctionInfo::ClearPreparseData() {
DCHECK(HasUncompiledDataWithoutPreparseData());
}
template <typename LocalIsolate>
void UncompiledData::Init(LocalIsolate* isolate, String inferred_name,
int start_position, int end_position) {
set_inferred_name(inferred_name);
set_start_position(start_position);
set_end_position(end_position);
}
void UncompiledData::InitAfterBytecodeFlush(
String inferred_name, int start_position, int end_position,
std::function<void(HeapObject object, ObjectSlot slot, HeapObject target)>
......@@ -663,16 +655,6 @@ void UncompiledData::InitAfterBytecodeFlush(
set_end_position(end_position);
}
template <typename LocalIsolate>
void UncompiledDataWithPreparseData::Init(LocalIsolate* isolate,
String inferred_name,
int start_position, int end_position,
PreparseData scope_data) {
this->UncompiledData::Init(isolate, inferred_name, start_position,
end_position);
set_preparse_data(scope_data);
}
bool SharedFunctionInfo::HasWasmExportedFunctionData() const {
return function_data(kAcquireLoad).IsWasmExportedFunctionData();
}
......
......@@ -101,19 +101,11 @@ class PreparseData
class UncompiledData
: public TorqueGeneratedUncompiledData<UncompiledData, HeapObject> {
public:
template <typename LocalIsolate>
inline void Init(LocalIsolate* isolate, String inferred_name,
int start_position, int end_position);
inline void InitAfterBytecodeFlush(
String inferred_name, int start_position, int end_position,
std::function<void(HeapObject object, ObjectSlot slot, HeapObject target)>
gc_notify_updated_slot);
using BodyDescriptor =
FixedBodyDescriptor<kStartOfStrongFieldsOffset, kEndOfStrongFieldsOffset,
kHeaderSize>;
TQ_OBJECT_CONSTRUCTORS(UncompiledData)
};
......@@ -124,10 +116,7 @@ class UncompiledDataWithoutPreparseData
: public TorqueGeneratedUncompiledDataWithoutPreparseData<
UncompiledDataWithoutPreparseData, UncompiledData> {
public:
DECL_PRINTER(UncompiledDataWithoutPreparseData)
// No extra fields compared to UncompiledData.
using BodyDescriptor = UncompiledData::BodyDescriptor;
class BodyDescriptor;
TQ_OBJECT_CONSTRUCTORS(UncompiledDataWithoutPreparseData)
};
......@@ -138,17 +127,7 @@ class UncompiledDataWithPreparseData
: public TorqueGeneratedUncompiledDataWithPreparseData<
UncompiledDataWithPreparseData, UncompiledData> {
public:
DECL_PRINTER(UncompiledDataWithPreparseData)
template <typename LocalIsolate>
inline void Init(LocalIsolate* isolate, String inferred_name,
int start_position, int end_position,
PreparseData scope_data);
using BodyDescriptor = SubclassBodyDescriptor<
UncompiledData::BodyDescriptor,
FixedBodyDescriptor<kStartOfStrongFieldsOffset, kEndOfStrongFieldsOffset,
kSize>>;
class BodyDescriptor;
TQ_OBJECT_CONSTRUCTORS(UncompiledDataWithPreparseData)
};
......
......@@ -63,19 +63,22 @@ extern class SharedFunctionInfo extends HeapObject {
}
@abstract
@generateCppClass
extern class UncompiledData extends HeapObject {
@export
@customCppClass
class UncompiledData extends HeapObject {
inferred_name: String;
start_position: int32;
end_position: int32;
}
@generateCppClass
extern class UncompiledDataWithoutPreparseData extends UncompiledData {
@export
@customCppClass
class UncompiledDataWithoutPreparseData extends UncompiledData {
}
@generateCppClass
extern class UncompiledDataWithPreparseData extends UncompiledData {
@export
@customCppClass
class UncompiledDataWithPreparseData extends UncompiledData {
preparse_data: PreparseData;
}
......
......@@ -109,10 +109,6 @@ class Symbol;
V(Map, small_ordered_name_dictionary_map, SmallOrderedNameDictionaryMap) \
V(Map, source_text_module_map, SourceTextModuleMap) \
V(Map, synthetic_module_map, SyntheticModuleMap) \
V(Map, uncompiled_data_without_preparse_data_map, \
UncompiledDataWithoutPreparseDataMap) \
V(Map, uncompiled_data_with_preparse_data_map, \
UncompiledDataWithPreparseDataMap) \
V(Map, wasm_type_info_map, WasmTypeInfoMap) \
V(Map, weak_fixed_array_map, WeakFixedArrayMap) \
V(Map, weak_array_list_map, WeakArrayListMap) \
......
......@@ -4425,8 +4425,8 @@ base::Optional<std::string> MatchSimpleBodyDescriptor(const ClassType* type) {
"BodyDescriptor<", start_offset, ">");
}
if (!has_weak_pointers) {
return ToString("FixedRangeDescriptor<", start_offset, ", ", end_offset,
", ", *type->size().SingleValue(), ">");
return ToString("FixedRangeBodyDescriptor<", start_offset, ", ", end_offset,
">");
}
return base::nullopt;
}
......
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