Index: src/runtime.cc |
diff --git a/src/runtime.cc b/src/runtime.cc |
index c162dcbf4c847c18ccf3851949986f533de71282..f1f0fd7d444feae7ad3f7acb36670b8e760d7c25 100644 |
--- a/src/runtime.cc |
+++ b/src/runtime.cc |
@@ -13271,6 +13271,12 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_HaveSameMap) { |
RUNTIME_FUNCTION(MaybeObject*, Runtime_IsObserved) { |
ASSERT(args.length() == 1); |
CONVERT_ARG_CHECKED(JSReceiver, obj, 0); |
+ if (obj->IsJSGlobalProxy()) { |
+ Object* proto = obj->GetPrototype(); |
+ if (obj->IsNull()) return isolate->heap()->false_value(); |
+ ASSERT(proto->IsJSGlobalObject()); |
+ obj = JSReceiver::cast(proto); |
+ } |
return isolate->heap()->ToBoolean(obj->map()->is_observed()); |
} |
@@ -13279,6 +13285,12 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_SetIsObserved) { |
ASSERT(args.length() == 2); |
CONVERT_ARG_CHECKED(JSReceiver, obj, 0); |
CONVERT_BOOLEAN_ARG_CHECKED(is_observed, 1); |
+ if (obj->IsJSGlobalProxy()) { |
+ Object* proto = obj->GetPrototype(); |
+ if (obj->IsNull()) return isolate->heap()->undefined_value(); |
+ ASSERT(proto->IsJSGlobalObject()); |
+ obj = JSReceiver::cast(proto); |
+ } |
if (obj->map()->is_observed() != is_observed) { |
MaybeObject* maybe = obj->map()->Copy(); |
Map* map; |
@@ -13314,6 +13326,10 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_ObjectHashTableGet) { |
ASSERT(args.length() == 2); |
CONVERT_ARG_CHECKED(ObjectHashTable, table, 0); |
Object* key = args[1]; |
+ if (key->IsJSGlobalProxy()) { |
+ key = key->GetPrototype(); |
+ if (key->IsNull()) return isolate->heap()->undefined_value(); |
+ } |
Object* lookup = table->Lookup(key); |
return lookup->IsTheHole() ? isolate->heap()->undefined_value() : lookup; |
} |
@@ -13324,21 +13340,15 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_ObjectHashTableSet) { |
ASSERT(args.length() == 3); |
CONVERT_ARG_HANDLE_CHECKED(ObjectHashTable, table, 0); |
Handle<Object> key = args.at<Object>(1); |
+ if (key->IsJSGlobalProxy()) { |
+ key = handle(key->GetPrototype(), isolate); |
+ if (key->IsNull()) return *table; |
+ } |
Handle<Object> value = args.at<Object>(2); |
return *PutIntoObjectHashTable(table, key, value); |
} |
-RUNTIME_FUNCTION(MaybeObject*, Runtime_ObjectHashTableHas) { |
- NoHandleAllocation ha; |
- ASSERT(args.length() == 2); |
- CONVERT_ARG_CHECKED(ObjectHashTable, table, 0); |
- Object* key = args[1]; |
- Object* lookup = table->Lookup(key); |
- return isolate->heap()->ToBoolean(!lookup->IsTheHole()); |
-} |
- |
- |
// ---------------------------------------------------------------------------- |
// Implementation of Runtime |