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