Commit 149f7f4d authored by Leszek Swirski's avatar Leszek Swirski Committed by Commit Bot

[objects] Make UncompiledData::Init a member function

Since it doesn't allocate, make UncompiledData::Init a member function,
consistent with SharedFunctionInfo::Init.

Bug: chromium:1011762
Change-Id: I984adf9004193eb9da504ddd39dd95345eccaf82
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1926031
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Auto-Submit: Leszek Swirski <leszeks@chromium.org>
Reviewed-by: 's avatarUlan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#65076}
parent 7a0ae73b
...@@ -2557,8 +2557,7 @@ Factory::NewUncompiledDataWithoutPreparseData(Handle<String> inferred_name, ...@@ -2557,8 +2557,7 @@ Factory::NewUncompiledDataWithoutPreparseData(Handle<String> inferred_name,
uncompiled_data_without_preparse_data_map(), AllocationType::kOld)), uncompiled_data_without_preparse_data_map(), AllocationType::kOld)),
isolate()); isolate());
UncompiledData::Initialize(*result, *inferred_name, start_position, result->Init(*inferred_name, start_position, end_position);
end_position);
return result; return result;
} }
...@@ -2572,8 +2571,7 @@ Factory::NewUncompiledDataWithPreparseData(Handle<String> inferred_name, ...@@ -2572,8 +2571,7 @@ Factory::NewUncompiledDataWithPreparseData(Handle<String> inferred_name,
New(uncompiled_data_with_preparse_data_map(), AllocationType::kOld)), New(uncompiled_data_with_preparse_data_map(), AllocationType::kOld)),
isolate()); isolate());
UncompiledDataWithPreparseData::Initialize( result->Init(*inferred_name, start_position, end_position, *preparse_data);
*result, *inferred_name, start_position, end_position, *preparse_data);
return result; return result;
} }
......
...@@ -2119,8 +2119,8 @@ void MarkCompactCollector::FlushBytecodeFromSFI( ...@@ -2119,8 +2119,8 @@ void MarkCompactCollector::FlushBytecodeFromSFI(
// Initialize the uncompiled data. // Initialize the uncompiled data.
UncompiledData uncompiled_data = UncompiledData::cast(compiled_data); UncompiledData uncompiled_data = UncompiledData::cast(compiled_data);
UncompiledData::Initialize( uncompiled_data.Init(
uncompiled_data, inferred_name, start_position, end_position, inferred_name, start_position, end_position,
[](HeapObject object, ObjectSlot slot, HeapObject target) { [](HeapObject object, ObjectSlot slot, HeapObject target) {
RecordSlot(object, slot, target); RecordSlot(object, slot, target);
}); });
......
...@@ -609,29 +609,27 @@ void SharedFunctionInfo::ClearPreparseData() { ...@@ -609,29 +609,27 @@ void SharedFunctionInfo::ClearPreparseData() {
DCHECK(HasUncompiledDataWithoutPreparseData()); DCHECK(HasUncompiledDataWithoutPreparseData());
} }
// static void UncompiledData::Init(
void UncompiledData::Initialize( String inferred_name, int start_position, int end_position,
UncompiledData data, 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) {
data.set_inferred_name(inferred_name); set_inferred_name(inferred_name);
gc_notify_updated_slot( gc_notify_updated_slot(*this, RawField(UncompiledData::kInferredNameOffset),
data, data.RawField(UncompiledData::kInferredNameOffset), inferred_name); inferred_name);
data.set_start_position(start_position); set_start_position(start_position);
data.set_end_position(end_position); set_end_position(end_position);
} }
void UncompiledDataWithPreparseData::Initialize( void UncompiledDataWithPreparseData::Init(
UncompiledDataWithPreparseData data, String inferred_name, String inferred_name, int start_position, int end_position,
int start_position, int end_position, PreparseData scope_data, PreparseData scope_data,
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) {
UncompiledData::Initialize(data, inferred_name, start_position, end_position, this->UncompiledData::Init(inferred_name, start_position, end_position,
gc_notify_updated_slot); gc_notify_updated_slot);
data.set_preparse_data(scope_data); set_preparse_data(scope_data);
gc_notify_updated_slot( gc_notify_updated_slot(
data, data.RawField(UncompiledDataWithPreparseData::kPreparseDataOffset), *this, RawField(UncompiledDataWithPreparseData::kPreparseDataOffset),
scope_data); scope_data);
} }
......
...@@ -97,9 +97,8 @@ class PreparseData ...@@ -97,9 +97,8 @@ class PreparseData
class UncompiledData class UncompiledData
: public TorqueGeneratedUncompiledData<UncompiledData, HeapObject> { : public TorqueGeneratedUncompiledData<UncompiledData, HeapObject> {
public: public:
inline static void Initialize( inline void Init(
UncompiledData data, String inferred_name, int start_position, String inferred_name, int start_position, int end_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 =
[](HeapObject object, ObjectSlot slot, HeapObject target) {}); [](HeapObject object, ObjectSlot slot, HeapObject target) {});
...@@ -134,9 +133,9 @@ class UncompiledDataWithPreparseData ...@@ -134,9 +133,9 @@ class UncompiledDataWithPreparseData
public: public:
DECL_PRINTER(UncompiledDataWithPreparseData) DECL_PRINTER(UncompiledDataWithPreparseData)
inline static void Initialize( inline void Init(
UncompiledDataWithPreparseData data, String inferred_name, String inferred_name, int start_position, int end_position,
int start_position, int end_position, PreparseData scope_data, PreparseData scope_data,
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 =
[](HeapObject object, ObjectSlot slot, HeapObject target) {}); [](HeapObject object, ObjectSlot slot, HeapObject target) {});
......
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