@@ -47,7 +47,6 @@ JSHeapBroker::JSHeapBroker(Isolate* isolate, Zone* broker_zone,
4747 refs_(zone()->New<RefsMap>(kMinimalRefsBucketCount , AddressMatcher(),
4848 zone())),
4949 root_index_map_(isolate),
50- array_and_object_prototypes_(zone()),
5150 tracing_enabled_(tracing_enabled),
5251 code_kind_(code_kind),
5352 feedback_(zone()),
@@ -118,28 +117,6 @@ void JSHeapBroker::SetTargetNativeContextRef(
118117 target_native_context_ = MakeRef (this , *native_context);
119118}
120119
121- void JSHeapBroker::CollectArrayAndObjectPrototypes () {
122- DisallowGarbageCollection no_gc;
123- CHECK_EQ (mode (), kSerializing );
124- CHECK (array_and_object_prototypes_.empty ());
125-
126- Tagged<Object> maybe_context = isolate ()->heap ()->native_contexts_list ();
127- while (!IsUndefined (maybe_context, isolate ())) {
128- Tagged<Context> context = Cast<Context>(maybe_context);
129- Tagged<Object> array_prot =
130- context->get (Context::INITIAL_ARRAY_PROTOTYPE_INDEX );
131- Tagged<Object> object_prot =
132- context->get (Context::INITIAL_OBJECT_PROTOTYPE_INDEX );
133- array_and_object_prototypes_.emplace (
134- CanonicalPersistentHandle (Cast<JSObject>(array_prot)));
135- array_and_object_prototypes_.emplace (
136- CanonicalPersistentHandle (Cast<JSObject>(object_prot)));
137- maybe_context = context->next_context_link ();
138- }
139-
140- CHECK (!array_and_object_prototypes_.empty ());
141- }
142-
143120StringRef JSHeapBroker::GetTypedArrayStringTag (ElementsKind kind) {
144121 DCHECK (IsTypedArrayOrRabGsabTypedArrayElementsKind (kind));
145122 switch (kind) {
@@ -159,14 +136,9 @@ bool JSHeapBroker::IsArrayOrObjectPrototype(JSObjectRef object) const {
159136}
160137
161138bool JSHeapBroker::IsArrayOrObjectPrototype (Handle<JSObject> object) const {
162- if (mode () == kDisabled ) {
163- return isolate ()->IsInCreationContext (
164- *object, Context::INITIAL_ARRAY_PROTOTYPE_INDEX ) ||
165- object->map (isolate_)->instance_type () == JS_OBJECT_PROTOTYPE_TYPE ;
166- }
167- CHECK (!array_and_object_prototypes_.empty ());
168- return array_and_object_prototypes_.find (object) !=
169- array_and_object_prototypes_.end ();
139+ return isolate ()->IsInCreationContext (
140+ *object, Context::INITIAL_ARRAY_PROTOTYPE_INDEX ) ||
141+ object->map (isolate_)->instance_type () == JS_OBJECT_PROTOTYPE_TYPE ;
170142}
171143
172144ObjectData* JSHeapBroker::TryGetOrCreateData (Tagged<Object> object,
0 commit comments