Reviewers: Toon Verwaest,
Description:
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.
Please review this at https://codereview.chromium.org/234143002/
SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge
Affected files (+0, -17 lines):
M src/object-observe.js
M src/runtime.h
M src/runtime.cc
Index: src/object-observe.js
diff --git a/src/object-observe.js b/src/object-observe.js
index
e822f0bd497588715e70c3300737b9e72a8e9134..c4ddd181d2841c479c3de34bd6d683554e2352bd
100644
--- a/src/object-observe.js
+++ b/src/object-observe.js
@@ -80,13 +80,9 @@ function GetWeakMapWrapper() {
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) {
Index: src/runtime.cc
diff --git a/src/runtime.cc b/src/runtime.cc
index
f2e2650ce7d9e7c7c5a6d1c266a8ffead5f8e24a..d20d3f12af594905b96119ba115965c906b8847f
100644
--- a/src/runtime.cc
+++ b/src/runtime.cc
@@ -14951,18 +14951,6 @@ RUNTIME_FUNCTION(MaybeObject*,
Runtime_ObservationWeakMapCreate) {
}
-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) {
HandleScope scope(isolate);
ASSERT(args.length() == 3);
Index: src/runtime.h
diff --git a/src/runtime.h b/src/runtime.h
index
3a5c4546a7f35ac099924558bf8f97eb011487b2..6319acf1b4bd8b8c3ddb814965556b20e06f9625
100644
--- a/src/runtime.h
+++ b/src/runtime.h
@@ -324,7 +324,6 @@ namespace internal {
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.