Reviewers: mvstanton,
Message:
PTAL
Description:
Remove special "store global proxy" IC, use as slow_stub().
Please review this at https://chromiumcodereview.appspot.com/95503003/
SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge
Affected files (+4, -43 lines):
src/builtins.h
src/builtins.cc
src/ic.h
src/ic.cc
src/type-info.cc
Index: src/builtins.cc
diff --git a/src/builtins.cc b/src/builtins.cc
index
fbc426a92dff97b25e24d831f8f9f92432e95ee9..df1f845724e1a5fcb4aff254a791bc68eed06ddc
100644
--- a/src/builtins.cc
+++ b/src/builtins.cc
@@ -1425,16 +1425,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<JSFunction>());
}
Index: src/builtins.h
diff --git a/src/builtins.h b/src/builtins.h
index
f76ed0223b0e4ea4f01644545b74858908bc196f..edc13f7511a2f18c08e096aa3c96ae9f76461813
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) \
\
Index: src/ic.cc
diff --git a/src/ic.cc b/src/ic.cc
index
46820fe0c0f6c6b0223400e85151d1ea6cc9f310..6ee728a73f1cdb2f2a4ab1459892825bb3c787c9
100644
--- a/src/ic.cc
+++ b/src/ic.cc
@@ -1454,7 +1454,8 @@ static bool LookupForWrite(Handle<JSObject> 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> 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<Code> stub = global_proxy_stub();
- set_target(*stub);
- TRACE_IC("StoreIC", name);
- }
- Handle<Object> 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<JSObject> receiver,
Handle<String> name,
Handle<Object> value) {
- ASSERT(!receiver->IsJSGlobalProxy());
ASSERT(lookup->IsFound());
// These are not cacheable, so we never see such LookupResults here.
@@ -1629,6 +1615,7 @@ Handle<Code> StoreIC::CompileHandler(LookupResult*
lookup,
Handle<String> name,
Handle<Object> 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<JSObject> receiver = Handle<JSObject>::cast(object);
Index: src/ic.h
diff --git a/src/ic.h b/src/ic.h
index
3db352acfd6d9449b47ea0416ea45e357b699738..b1a47e2b2171b3d52de6d00e7d0c17aec60e3a63
100644
--- a/src/ic.h
+++ b/src/ic.h
@@ -642,14 +642,6 @@ class StoreIC: public IC {
}
}
- virtual Handle<Code> 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,
Index: src/type-info.cc
diff --git a/src/type-info.cc b/src/type-info.cc
index
79134cabe38ed10ff6824551606277f076a63391..e4eb7db3320e162360d394852d27fced3751708c
100644
--- a/src/type-info.cc
+++ b/src/type-info.cc
@@ -522,11 +522,7 @@ void
TypeFeedbackOracle::CollectReceiverTypes(TypeFeedbackId ast_id,
Handle<Object> 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<Code>::cast(object)->ic_state() == GENERIC);
- } else if (object->IsMap()) {
+ if (object->IsMap()) {
types->AddMapIfMissing(Handle<Map>::cast(object), zone());
} else if (Handle<Code>::cast(object)->ic_state() == POLYMORPHIC ||
Handle<Code>::cast(object)->ic_state() == MONOMORPHIC) {
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.