From: verwaest@chromium.org Date: Mon, 2 Dec 2013 09:51:37 +0000 (+0000) Subject: Remove special "store global proxy" IC, use as slow_stub(). X-Git-Tag: upstream/4.7.83~11476 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=98897182f52b0860cb27df2a3099e6187d44d403;p=platform%2Fupstream%2Fv8.git Remove special "store global proxy" IC, use as slow_stub(). R=mvstanton@chromium.org Review URL: https://chromiumcodereview.appspot.com/95503003 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@18173 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- diff --git a/src/builtins.cc b/src/builtins.cc index 19e8336..bc6dceb 100644 --- a/src/builtins.cc +++ b/src/builtins.cc @@ -1421,16 +1421,6 @@ static void Generate_StoreIC_Megamorphic_Strict(MacroAssembler* masm) { } -static void Generate_StoreIC_GlobalProxy(MacroAssembler* masm) { - StoreIC::GenerateRuntimeSetProperty(masm, kNonStrictMode); -} - - -static void Generate_StoreIC_GlobalProxy_Strict(MacroAssembler* masm) { - StoreIC::GenerateRuntimeSetProperty(masm, kStrictMode); -} - - static void Generate_StoreIC_Setter_ForDeopt(MacroAssembler* masm) { StoreStubCompiler::GenerateStoreViaSetter(masm, Handle()); } diff --git a/src/builtins.h b/src/builtins.h index f76ed02..edc13f7 100644 --- a/src/builtins.h +++ b/src/builtins.h @@ -157,16 +157,12 @@ enum BuiltinExtraArguments { kNoExtraICState) \ V(StoreIC_Generic_Strict, STORE_IC, GENERIC, \ StoreIC::kStrictModeState) \ - V(StoreIC_GlobalProxy, STORE_IC, GENERIC, \ - kNoExtraICState) \ V(StoreIC_Initialize_Strict, STORE_IC, UNINITIALIZED, \ StoreIC::kStrictModeState) \ V(StoreIC_PreMonomorphic_Strict, STORE_IC, PREMONOMORPHIC, \ StoreIC::kStrictModeState) \ V(StoreIC_Megamorphic_Strict, STORE_IC, MEGAMORPHIC, \ StoreIC::kStrictModeState) \ - V(StoreIC_GlobalProxy_Strict, STORE_IC, GENERIC, \ - StoreIC::kStrictModeState) \ V(StoreIC_Setter_ForDeopt, STORE_IC, MONOMORPHIC, \ StoreIC::kStrictModeState) \ \ diff --git a/src/ic.cc b/src/ic.cc index 46820fe..6ee728a 100644 --- a/src/ic.cc +++ b/src/ic.cc @@ -1454,7 +1454,8 @@ static bool LookupForWrite(Handle receiver, } if (lookup->IsPropertyCallbacks()) return true; - + // JSGlobalProxy always goes via the runtime, so it's safe to cache. + if (receiver->IsJSGlobalProxy()) return true; // Currently normal holders in the prototype chain are not supported. They // would require a runtime positive lookup and verification that the details // have not changed. @@ -1561,20 +1562,6 @@ MaybeObject* StoreIC::Store(Handle object, return *result; } - if (receiver->IsJSGlobalProxy()) { - if (FLAG_use_ic && kind() != Code::KEYED_STORE_IC) { - // Generate a generic stub that goes to the runtime when we see a global - // proxy as receiver. - Handle stub = global_proxy_stub(); - set_target(*stub); - TRACE_IC("StoreIC", name); - } - Handle result = JSReceiver::SetProperty( - receiver, name, value, NONE, strict_mode(), store_mode); - RETURN_IF_EMPTY_HANDLE(isolate(), result); - return *result; - } - LookupResult lookup(isolate()); bool can_store = LookupForWrite(receiver, name, value, &lookup, this); if (!can_store && @@ -1611,7 +1598,6 @@ void StoreIC::UpdateCaches(LookupResult* lookup, Handle receiver, Handle name, Handle value) { - ASSERT(!receiver->IsJSGlobalProxy()); ASSERT(lookup->IsFound()); // These are not cacheable, so we never see such LookupResults here. @@ -1629,6 +1615,7 @@ Handle StoreIC::CompileHandler(LookupResult* lookup, Handle name, Handle value, InlineCacheHolderFlag cache_holder) { + if (object->IsJSGlobalProxy()) return slow_stub(); ASSERT(cache_holder == OWN_MAP); // This is currently guaranteed by checks in StoreIC::Store. Handle receiver = Handle::cast(object); diff --git a/src/ic.h b/src/ic.h index 3db352a..b1a47e2 100644 --- a/src/ic.h +++ b/src/ic.h @@ -642,14 +642,6 @@ class StoreIC: public IC { } } - virtual Handle global_proxy_stub() { - if (strict_mode() == kStrictMode) { - return isolate()->builtins()->StoreIC_GlobalProxy_Strict(); - } else { - return isolate()->builtins()->StoreIC_GlobalProxy(); - } - } - // Update the inline cache and the global stub cache based on the // lookup result. void UpdateCaches(LookupResult* lookup, diff --git a/src/type-info.cc b/src/type-info.cc index 79134ca..e4eb7db 100644 --- a/src/type-info.cc +++ b/src/type-info.cc @@ -522,11 +522,7 @@ void TypeFeedbackOracle::CollectReceiverTypes(TypeFeedbackId ast_id, Handle object = GetInfo(ast_id); if (object->IsUndefined() || object->IsSmi()) return; - if (object.is_identical_to(isolate_->builtins()->StoreIC_GlobalProxy())) { - // TODO(fschneider): We could collect the maps and signal that - // we need a generic store (or load) here. - ASSERT(Handle::cast(object)->ic_state() == GENERIC); - } else if (object->IsMap()) { + if (object->IsMap()) { types->AddMapIfMissing(Handle::cast(object), zone()); } else if (Handle::cast(object)->ic_state() == POLYMORPHIC || Handle::cast(object)->ic_state() == MONOMORPHIC) {