diff --git a/src/counters.h b/src/counters.h index dc16a98aec..f45650cc95 100644 --- a/src/counters.h +++ b/src/counters.h @@ -999,7 +999,6 @@ class RuntimeCallTimer final { V(LoadIC_StringWrapperLength) \ V(StoreGlobalIC_SlowStub) \ V(StoreGlobalIC_StoreScriptContextField) \ - V(StoreGlobalIC_Premonomorphic) \ V(StoreIC_HandlerCacheHit_Accessor) \ V(StoreIC_NonReceiver) \ V(StoreIC_Premonomorphic) \ diff --git a/src/feedback-vector.cc b/src/feedback-vector.cc index 6b5af59b82..0f65c4609d 100644 --- a/src/feedback-vector.cc +++ b/src/feedback-vector.cc @@ -570,13 +570,6 @@ InlineCacheState FeedbackNexus::StateFromFeedback() const { case FeedbackSlotKind::kLoadGlobalInsideTypeof: { if (feedback->IsSmi()) return MONOMORPHIC; - if (feedback == MaybeObject::FromObject( - *FeedbackVector::PremonomorphicSentinel(isolate))) { - DCHECK(kind() == FeedbackSlotKind::kStoreGlobalSloppy || - kind() == FeedbackSlotKind::kStoreGlobalStrict); - return PREMONOMORPHIC; - } - DCHECK(feedback->IsWeakOrCleared()); MaybeObject extra = GetFeedbackExtra(); if (!feedback->IsCleared() || diff --git a/src/ic/accessor-assembler.cc b/src/ic/accessor-assembler.cc index df3933911a..fb05e16c0d 100644 --- a/src/ic/accessor-assembler.cc +++ b/src/ic/accessor-assembler.cc @@ -2895,18 +2895,14 @@ void AccessorAssembler::StoreIC(const StoreICParameters* p) { } void AccessorAssembler::StoreGlobalIC(const StoreICParameters* pp) { - Label if_lexical_var(this), if_heapobject(this); + Label if_lexical_var(this), if_property_cell(this); TNode maybe_weak_ref = LoadFeedbackVectorSlot(pp->vector, pp->slot, 0, SMI_PARAMETERS); - Branch(TaggedIsSmi(maybe_weak_ref), &if_lexical_var, &if_heapobject); + Branch(TaggedIsSmi(maybe_weak_ref), &if_lexical_var, &if_property_cell); - BIND(&if_heapobject); + BIND(&if_property_cell); { Label try_handler(this), miss(this, Label::kDeferred); - GotoIf( - WordEqual(maybe_weak_ref, LoadRoot(RootIndex::kpremonomorphic_symbol)), - &miss); - CSA_ASSERT(this, IsWeakOrCleared(maybe_weak_ref)); TNode property_cell = CAST(GetHeapObjectAssumeWeak(maybe_weak_ref, &try_handler)); diff --git a/src/ic/ic.cc b/src/ic/ic.cc index f67b42e8fd..d131df409e 100644 --- a/src/ic/ic.cc +++ b/src/ic/ic.cc @@ -1471,24 +1471,6 @@ void StoreIC::UpdateCaches(LookupIterator* lookup, Handle value, } handler = ComputeHandler(lookup); } else { - if (state() == UNINITIALIZED && IsStoreGlobalIC() && - lookup->state() == LookupIterator::INTERCEPTOR) { - InterceptorInfo info = - lookup->GetHolder()->GetNamedInterceptor(); - if (!lookup->HolderIsReceiverOrHiddenPrototype() && - !info->getter()->IsUndefined(isolate())) { - // Utilize premonomorphic state for global store ics that run into - // an interceptor because the property doesn't exist yet. - // After we actually set the property, we'll have more information. - // Premonomorphism gives us a chance to find more information the - // second time. - TRACE_HANDLER_STATS(isolate(), StoreGlobalIC_Premonomorphic); - ConfigureVectorState(receiver_map()); - TraceIC("StoreGlobalIC", lookup->name()); - return; - } - } - set_slow_stub_reason("LookupForWrite said 'false'"); // TODO(marja): change slow_stub to return MaybeObjectHandle. handler = MaybeObjectHandle(slow_stub()); diff --git a/test/cctest/test-api.cc b/test/cctest/test-api.cc index 8f3fa6d21d..bab22cd545 100644 --- a/test/cctest/test-api.cc +++ b/test/cctest/test-api.cc @@ -45,8 +45,6 @@ #include "src/compilation-cache.h" #include "src/debug/debug.h" #include "src/execution.h" -#include "src/feedback-vector-inl.h" -#include "src/feedback-vector.h" #include "src/futex-emulation.h" #include "src/global-handles.h" #include "src/heap/incremental-marking.h" @@ -10953,6 +10951,7 @@ static void ShadowIndexedGet(uint32_t index, static void ShadowNamedGet(Local key, const v8::PropertyCallbackInfo&) {} + THREADED_TEST(ShadowObject) { shadow_y = shadow_y_setter_call_count = shadow_y_getter_call_count = 0; v8::Isolate* isolate = CcTest::isolate(); @@ -11003,55 +11002,6 @@ THREADED_TEST(ShadowObject) { CHECK_EQ(42, value->Int32Value(context.local()).FromJust()); } -THREADED_TEST(ShadowObjectAndDataProperty) { - // This test mimics the kind of shadow property the Chromium embedder - // uses for undeclared globals. The IC subsystem has special handling - // for this case, using a PREMONOMORPHIC state to delay entering - // MONOMORPHIC state until enough information is available to support - // efficient access and good feedback for optimization. - v8::Isolate* isolate = CcTest::isolate(); - v8::HandleScope handle_scope(isolate); - - Local global_template = v8::ObjectTemplate::New(isolate); - LocalContext context(nullptr, global_template); - - Local t = v8::FunctionTemplate::New(isolate); - t->InstanceTemplate()->SetHandler( - v8::NamedPropertyHandlerConfiguration(ShadowNamedGet)); - - Local o = t->GetFunction(context.local()) - .ToLocalChecked() - ->NewInstance(context.local()) - .ToLocalChecked(); - CHECK(context->Global() - ->Set(context.local(), v8_str("__proto__"), o) - .FromJust()); - - CompileRun( - "function foo(x) { i = x; }" - "foo(0)"); - - i::Handle foo(i::Handle::cast( - v8::Utils::OpenHandle(*context->Global() - ->Get(context.local(), v8_str("foo")) - .ToLocalChecked()))); - CHECK(foo->has_feedback_vector()); - i::FeedbackSlot slot = i::FeedbackVector::ToSlot(0); - i::FeedbackNexus nexus(foo->feedback_vector(), slot); - CHECK_EQ(i::FeedbackSlotKind::kStoreGlobalSloppy, nexus.kind()); - CHECK_EQ(i::PREMONOMORPHIC, nexus.StateFromFeedback()); - CompileRun("foo(1)"); - CHECK_EQ(i::MONOMORPHIC, nexus.StateFromFeedback()); - // We go a bit further, checking that the form of monomorphism is - // a PropertyCell in the vector. This is because we want to make sure - // we didn't settle for a "poor man's monomorphism," such as a - // slow_stub bailout which would mean a trip to the runtime on all - // subsequent stores, and a lack of feedback for the optimizing - // compiler downstream. - i::HeapObject heap_object; - CHECK(nexus.GetFeedback().GetHeapObject(&heap_object)); - CHECK(heap_object->IsPropertyCell()); -} THREADED_TEST(SetPrototype) { LocalContext context;