}
-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>());
}
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) \
\
}
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.
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 &&
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.
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);
}
}
- 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,
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) {