Commit 7d13c215 authored by Georg Neis's avatar Georg Neis Committed by V8 LUCI CQ

[compiler] Remove NativeContextRef::Serialize

Instead create the appropriate data on demand. Note that this
changes behavior of the default configuration.

Bug: v8:7790
Change-Id: Ia6bfcaace655c0fd72e2dcc0c2547195dc1cc4a7
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3123419Reviewed-by: 's avatarJakob Gruber <jgruber@chromium.org>
Commit-Queue: Georg Neis <neis@chromium.org>
Cr-Commit-Position: refs/heads/main@{#76570}
parent ed6a7173
......@@ -1584,8 +1584,6 @@ void JSHeapBroker::InitializeAndStartSerializing() {
SetTargetNativeContextRef(target_native_context().object());
if (!is_concurrent_inlining()) {
target_native_context().Serialize(NotConcurrentInliningTag{this});
Factory* const f = isolate()->factory();
ObjectData* data;
data = GetOrCreateData(f->array_buffer_detaching_protector());
......@@ -2502,32 +2500,6 @@ ZoneVector<const CFunctionInfo*> FunctionTemplateInfoRef::c_signatures() const {
bool StringRef::IsSeqString() const { return object()->IsSeqString(); }
void NativeContextRef::Serialize(NotConcurrentInliningTag tag) {
// TODO(jgruber): Disable visitation if should_access_heap() once all
// NativeContext element refs can be created on background threads. Until
// then, we *must* iterate them and create refs at serialization-time (even
// though NativeContextRef itself is never-serialized).
CHECK_EQ(broker()->mode(), JSHeapBroker::kSerializing);
#define SERIALIZE_MEMBER(type, name) \
{ \
ObjectData* member_data = broker()->GetOrCreateData(object()->name()); \
if (member_data->IsMap() && !InstanceTypeChecker::IsContext( \
member_data->AsMap()->instance_type())) { \
member_data->AsMap()->SerializeConstructor(broker(), tag); \
} \
}
BROKER_NATIVE_CONTEXT_FIELDS(SERIALIZE_MEMBER)
#undef SERIALIZE_MEMBER
for (int i = Context::FIRST_FUNCTION_MAP_INDEX;
i <= Context::LAST_FUNCTION_MAP_INDEX; i++) {
MapData* member_data = broker()->GetOrCreateData(object()->get(i))->AsMap();
if (!InstanceTypeChecker::IsContext(member_data->instance_type())) {
member_data->SerializeConstructor(broker(), tag);
}
}
}
ScopeInfoRef NativeContextRef::scope_info() const {
// The scope_info is immutable after initialization.
return MakeRefAssumeMemoryFence(broker(), object()->scope_info());
......
......@@ -535,9 +535,6 @@ class ContextRef : public HeapObjectRef {
base::Optional<ObjectRef> get(int index) const;
};
// TODO(jgruber): Don't serialize NativeContext fields once all refs can be
// created concurrently.
#define BROKER_NATIVE_CONTEXT_FIELDS(V) \
V(JSFunction, array_function) \
V(JSFunction, bigint_function) \
......
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