Revision: 20740
Author:   [email protected]
Date:     Mon Apr 14 20:52:20 2014 UTC
Log:      Remove unnecessary %UnwrapGlobalProxy calls from object-observe.js

The intent of these calls was to properly key the WeakMap get/set calls
on the underlying global object, not the proxy, since that is the object
actually being observed. But unwrapping at this layer is unnecessary
since GetIdentityHash will already do the unwrapping (via its call to
GetHiddenProperty).

Also remove the runtime function itself, as these were the only callers,
and remove the now-redundant IS_SPEC_OBJECT() checks from object-observe.js's
MapWrapper type.

[email protected]

Review URL: https://codereview.chromium.org/234143002
http://code.google.com/p/v8/source/detail?r=20740

Modified:
 /branches/bleeding_edge/src/object-observe.js
 /branches/bleeding_edge/src/runtime.cc
 /branches/bleeding_edge/src/runtime.h

=======================================
--- /branches/bleeding_edge/src/object-observe.js Thu Mar 13 00:20:06 2014 UTC +++ /branches/bleeding_edge/src/object-observe.js Mon Apr 14 20:52:20 2014 UTC
@@ -80,13 +80,9 @@

   MapWrapper.prototype = {
     get: function(key) {
-      key = %UnwrapGlobalProxy(key);
-      if (!IS_SPEC_OBJECT(key)) return UNDEFINED;
       return %WeakCollectionGet(this.map_, key);
     },
     set: function(key, value) {
-      key = %UnwrapGlobalProxy(key);
-      if (!IS_SPEC_OBJECT(key)) return UNDEFINED;
       %WeakCollectionSet(this.map_, key, value);
     },
     has: function(key) {
=======================================
--- /branches/bleeding_edge/src/runtime.cc      Mon Apr 14 19:38:29 2014 UTC
+++ /branches/bleeding_edge/src/runtime.cc      Mon Apr 14 20:52:20 2014 UTC
@@ -14838,18 +14838,6 @@
       Handle<JSWeakMap>::cast(isolate->factory()->NewJSObjectFromMap(map));
   return WeakCollectionInitialize(isolate, weakmap);
 }
-
-
-RUNTIME_FUNCTION(MaybeObject*, Runtime_UnwrapGlobalProxy) {
-  SealHandleScope shs(isolate);
-  ASSERT(args.length() == 1);
-  Object* object = args[0];
-  if (object->IsJSGlobalProxy()) {
-    object = object->GetPrototype(isolate);
-    if (object->IsNull()) return isolate->heap()->undefined_value();
-  }
-  return object;
-}


 RUNTIME_FUNCTION(MaybeObject*, Runtime_IsAccessAllowedForObserver) {
=======================================
--- /branches/bleeding_edge/src/runtime.h       Mon Apr 14 19:37:51 2014 UTC
+++ /branches/bleeding_edge/src/runtime.h       Mon Apr 14 20:52:20 2014 UTC
@@ -324,7 +324,6 @@
   F(SetIsObserved, 1, 1) \
   F(GetObservationState, 0, 1) \
   F(ObservationWeakMapCreate, 0, 1) \
-  F(UnwrapGlobalProxy, 1, 1) \
   F(IsAccessAllowedForObserver, 3, 1) \
   \
   /* Harmony typed arrays */ \

--
--
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/d/optout.

Reply via email to