Bug 824217 - Remove the mode argument from the PIERCE macro to eliminate all but one use of JSRESOLVE_ASSIGNING from jswrapper.cpp. r=bholley
authorJeff Walden <jwalden@mit.edu>
Thu, 03 Jan 2013 16:46:50 -0600
changeset 126794 b2df7d0c61d1a6c8dde14ed4e8c4f6dde5328cb4
parent 126793 1308210aefb40f23cf88feb9bde1346ffbd62b5a
child 126795 0c549b6038ef7d857ec7555c320810b0c3ee3f16
push id2151
push userlsblakk@mozilla.com
push dateTue, 19 Feb 2013 18:06:57 +0000
treeherdermozilla-beta@4952e88741ec [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbholley
bugs824217
milestone20.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 824217 - Remove the mode argument from the PIERCE macro to eliminate all but one use of JSRESOLVE_ASSIGNING from jswrapper.cpp. r=bholley
js/src/jswrapper.cpp
--- a/js/src/jswrapper.cpp
+++ b/js/src/jswrapper.cpp
@@ -396,135 +396,135 @@ CrossCompartmentWrapper::CrossCompartmen
   : Wrapper(CROSS_COMPARTMENT | flags, hasPrototype)
 {
 }
 
 CrossCompartmentWrapper::~CrossCompartmentWrapper()
 {
 }
 
-#define PIERCE(cx, wrapper, mode, pre, op, post)                \
+#define PIERCE(cx, wrapper, pre, op, post)                      \
     JS_BEGIN_MACRO                                              \
         bool ok;                                                \
         {                                                       \
             AutoCompartment call(cx, wrappedObject(wrapper));   \
             ok = (pre) && (op);                                 \
         }                                                       \
         return ok && (post);                                    \
     JS_END_MACRO
 
 #define NOTHING (true)
 
 bool
 CrossCompartmentWrapper::getPropertyDescriptor(JSContext *cx, JSObject *wrapper, jsid id,
                                                PropertyDescriptor *desc, unsigned flags)
 {
-    PIERCE(cx, wrapper, (flags & JSRESOLVE_ASSIGNING) ? SET : GET,
+    PIERCE(cx, wrapper,
            cx->compartment->wrapId(cx, &id),
            Wrapper::getPropertyDescriptor(cx, wrapper, id, desc, flags),
            cx->compartment->wrap(cx, desc));
 }
 
 bool
 CrossCompartmentWrapper::getOwnPropertyDescriptor(JSContext *cx, JSObject *wrapper, jsid id,
                                                   PropertyDescriptor *desc, unsigned flags)
 {
-    PIERCE(cx, wrapper, (flags & JSRESOLVE_ASSIGNING) ? SET : GET,
+    PIERCE(cx, wrapper,
            cx->compartment->wrapId(cx, &id),
            Wrapper::getOwnPropertyDescriptor(cx, wrapper, id, desc, flags),
            cx->compartment->wrap(cx, desc));
 }
 
 bool
 CrossCompartmentWrapper::defineProperty(JSContext *cx, JSObject *wrapper, jsid id, PropertyDescriptor *desc)
 {
     AutoPropertyDescriptorRooter desc2(cx, desc);
-    PIERCE(cx, wrapper, SET,
+    PIERCE(cx, wrapper,
            cx->compartment->wrapId(cx, &id) && cx->compartment->wrap(cx, &desc2),
            Wrapper::defineProperty(cx, wrapper, id, &desc2),
            NOTHING);
 }
 
 bool
 CrossCompartmentWrapper::getOwnPropertyNames(JSContext *cx, JSObject *wrapper, AutoIdVector &props)
 {
-    PIERCE(cx, wrapper, GET,
+    PIERCE(cx, wrapper,
            NOTHING,
            Wrapper::getOwnPropertyNames(cx, wrapper, props),
            cx->compartment->wrap(cx, props));
 }
 
 bool
 CrossCompartmentWrapper::delete_(JSContext *cx, JSObject *wrapper, jsid id, bool *bp)
 {
-    PIERCE(cx, wrapper, SET,
+    PIERCE(cx, wrapper,
            cx->compartment->wrapId(cx, &id),
            Wrapper::delete_(cx, wrapper, id, bp),
            NOTHING);
 }
 
 bool
 CrossCompartmentWrapper::enumerate(JSContext *cx, JSObject *wrapper, AutoIdVector &props)
 {
-    PIERCE(cx, wrapper, GET,
+    PIERCE(cx, wrapper,
            NOTHING,
            Wrapper::enumerate(cx, wrapper, props),
            cx->compartment->wrap(cx, props));
 }
 
 bool
 CrossCompartmentWrapper::has(JSContext *cx, JSObject *wrapper, jsid id, bool *bp)
 {
-    PIERCE(cx, wrapper, GET,
+    PIERCE(cx, wrapper,
            cx->compartment->wrapId(cx, &id),
            Wrapper::has(cx, wrapper, id, bp),
            NOTHING);
 }
 
 bool
 CrossCompartmentWrapper::hasOwn(JSContext *cx, JSObject *wrapper, jsid id, bool *bp)
 {
-    PIERCE(cx, wrapper, GET,
+    PIERCE(cx, wrapper,
            cx->compartment->wrapId(cx, &id),
            Wrapper::hasOwn(cx, wrapper, id, bp),
            NOTHING);
 }
 
 bool
 CrossCompartmentWrapper::get(JSContext *cx, JSObject *wrapperArg, JSObject *receiverArg,
                              jsid idArg, Value *vp)
 {
     RootedObject wrapper(cx, wrapperArg);
     RootedObject receiver(cx, receiverArg);
     RootedId id(cx, idArg);
-    PIERCE(cx, wrapper, GET,
+    PIERCE(cx, wrapper,
            cx->compartment->wrap(cx, receiver.address()) && cx->compartment->wrapId(cx, id.address()),
            Wrapper::get(cx, wrapper, receiver, id, vp),
            cx->compartment->wrap(cx, vp));
 }
 
 bool
 CrossCompartmentWrapper::set(JSContext *cx, JSObject *wrapper_, JSObject *receiver_, jsid id_,
                              bool strict, Value *vp)
 {
     RootedObject wrapper(cx, wrapper_), receiver(cx, receiver_);
     RootedId id(cx, id_);
     RootedValue value(cx, *vp);
-    PIERCE(cx, wrapper, SET,
+    PIERCE(cx, wrapper,
            cx->compartment->wrap(cx, receiver.address()) &&
            cx->compartment->wrapId(cx, id.address()) &&
            cx->compartment->wrap(cx, value.address()),
            Wrapper::set(cx, wrapper, receiver, id, strict, value.address()),
            NOTHING);
 }
 
 bool
 CrossCompartmentWrapper::keys(JSContext *cx, JSObject *wrapper, AutoIdVector &props)
 {
-    PIERCE(cx, wrapper, GET,
+    PIERCE(cx, wrapper,
            NOTHING,
            Wrapper::keys(cx, wrapper, props),
            cx->compartment->wrap(cx, props));
 }
 
 /*
  * We can reify non-escaping iterator objects instead of having to wrap them. This
  * allows fast iteration over objects across a compartment boundary.
@@ -601,17 +601,17 @@ Reify(JSContext *cx, JSCompartment *orig
 
     *vp = value;
     return true;
 }
 
 bool
 CrossCompartmentWrapper::iterate(JSContext *cx, JSObject *wrapper, unsigned flags, Value *vp)
 {
-    PIERCE(cx, wrapper, GET,
+    PIERCE(cx, wrapper,
            NOTHING,
            Wrapper::iterate(cx, wrapper, flags, vp),
            CanReify(vp) ? Reify(cx, cx->compartment, vp) : cx->compartment->wrap(cx, vp));
 }
 
 bool
 CrossCompartmentWrapper::call(JSContext *cx, JSObject *wrapper_, unsigned argc, Value *vp)
 {