Bug 1088002 part 3. Stop requiring JSPROP_PROPOP_ACCESSORS just to use stub accessors. r=waldo
authorBoris Zbarsky <bzbarsky@mit.edu>
Wed, 29 Oct 2014 15:06:32 -0400
changeset 237321 bec6973477c6f4f74591473b2c7de8fbf7f74327
parent 237320 66860992cd5ea5e12dc41ec39101de2cca4b7737
child 237322 374ab4e39b3866ad8c63c58ab43f1f81c476481e
push id4311
push userraliiev@mozilla.com
push dateMon, 12 Jan 2015 19:37:41 +0000
treeherdermozilla-beta@150c9fed433b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerswaldo
bugs1088002
milestone36.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 1088002 part 3. Stop requiring JSPROP_PROPOP_ACCESSORS just to use stub accessors. r=waldo
dom/base/nsDOMClassInfo.cpp
dom/base/nsGlobalWindow.cpp
dom/bindings/BindingUtils.cpp
dom/xbl/nsXBLBinding.cpp
dom/xbl/nsXBLProtoImpl.cpp
ipc/testshell/XPCShellEnvironment.cpp
js/src/builtin/TestingFunctions.cpp
js/src/ctypes/CTypes.cpp
js/src/jsapi-tests/testAddPropertyPropcache.cpp
js/src/jsapi-tests/testSetProperty.cpp
js/src/jsapi.cpp
js/src/jsfriendapi.cpp
js/src/jsmath.cpp
js/src/json.cpp
js/src/jsreflect.cpp
js/src/perf/jsperf.cpp
js/src/proxy/Proxy.cpp
js/xpconnect/src/ExportHelpers.cpp
js/xpconnect/wrappers/XrayWrapper.cpp
--- a/dom/base/nsDOMClassInfo.cpp
+++ b/dom/base/nsDOMClassInfo.cpp
@@ -1030,17 +1030,17 @@ nsDOMClassInfo::ResolveConstructor(JSCon
   if (!val.isPrimitive()) {
     // If val is not an (non-null) object there either is no
     // constructor for this class, or someone messed with
     // window.classname, just fall through and let the JS engine
     // return the Object constructor.
 
     JS::Rooted<jsid> id(cx, sConstructor_id);
     if (!::JS_DefinePropertyById(cx, obj, id, val,
-                                 JSPROP_ENUMERATE | JSPROP_PROPOP_ACCESSORS,
+                                 JSPROP_ENUMERATE,
                                  JS_STUBGETTER, JS_STUBSETTER)) {
       return NS_ERROR_UNEXPECTED;
     }
 
     *objp = obj;
   }
 
   return NS_OK;
@@ -1451,18 +1451,17 @@ DefineInterfaceConstants(JSContext *cx, 
 
   JS::Rooted<JS::Value> v(cx);
   for (i = parent_constant_count; i < constant_count; i++) {
     nsXPIDLCString name;
     rv = if_info->GetConstant(i, &v, getter_Copies(name));
     NS_ENSURE_TRUE(NS_SUCCEEDED(rv), rv);
 
     if (!::JS_DefineProperty(cx, obj, name, v,
-                             JSPROP_ENUMERATE | JSPROP_READONLY |
-                             JSPROP_PERMANENT | JSPROP_PROPOP_ACCESSORS,
+                             JSPROP_ENUMERATE | JSPROP_READONLY | JSPROP_PERMANENT,
                              JS_STUBGETTER, JS_STUBSETTER)) {
       return NS_ERROR_UNEXPECTED;
     }
   }
 
   return NS_OK;
 }
 
@@ -2050,18 +2049,17 @@ ResolvePrototype(nsIXPConnect *aXPConnec
 
   v = OBJECT_TO_JSVAL(dot_prototype);
 
   JSAutoCompartment ac(cx, class_obj);
 
   // Per ECMA, the prototype property is {DontEnum, DontDelete, ReadOnly}
   if (!JS_WrapValue(cx, &v) ||
       !JS_DefineProperty(cx, class_obj, "prototype", v,
-                         JSPROP_PERMANENT | JSPROP_READONLY |
-                         JSPROP_PROPOP_ACCESSORS,
+                         JSPROP_PERMANENT | JSPROP_READONLY,
                          JS_STUBGETTER, JS_STUBSETTER)) {
     return NS_ERROR_UNEXPECTED;
   }
 
   return NS_OK;
 }
 
 static bool
@@ -2510,18 +2508,17 @@ LookupComponentsShim(JSContext *cx, JS::
   JS::Rooted<JSObject*> components(cx, JS_NewObject(cx, nullptr, JS::NullPtr(), global));
   NS_ENSURE_TRUE(components, NS_ERROR_OUT_OF_MEMORY);
 
   // Create a fake interfaces object.
   JS::Rooted<JSObject*> interfaces(cx, JS_NewObject(cx, nullptr, JS::NullPtr(), global));
   NS_ENSURE_TRUE(interfaces, NS_ERROR_OUT_OF_MEMORY);
   bool ok =
     JS_DefineProperty(cx, components, "interfaces", interfaces,
-                      JSPROP_ENUMERATE | JSPROP_PERMANENT | JSPROP_READONLY |
-                      JSPROP_PROPOP_ACCESSORS,
+                      JSPROP_ENUMERATE | JSPROP_PERMANENT | JSPROP_READONLY,
                       JS_STUBGETTER, JS_STUBSETTER);
   NS_ENSURE_TRUE(ok, NS_ERROR_OUT_OF_MEMORY);
 
   // Define a bunch of shims from the Ci.nsIDOMFoo to window.Foo for DOM
   // interfaces with constants.
   for (uint32_t i = 0; i < ArrayLength(kInterfaceShimMap); ++i) {
 
     // Grab the names from the table.
@@ -2534,18 +2531,17 @@ LookupComponentsShim(JSContext *cx, JS::
     NS_ENSURE_TRUE(ok, NS_ERROR_OUT_OF_MEMORY);
     if (!v.isObject()) {
       NS_WARNING("Unable to find interface object on global");
       continue;
     }
 
     // Define the shim on the interfaces object.
     ok = JS_DefineProperty(cx, interfaces, geckoName, v,
-                           JSPROP_ENUMERATE | JSPROP_PERMANENT |
-                           JSPROP_READONLY | JSPROP_PROPOP_ACCESSORS,
+                           JSPROP_ENUMERATE | JSPROP_PERMANENT | JSPROP_READONLY,
                            JS_STUBGETTER, JS_STUBSETTER);
     NS_ENSURE_TRUE(ok, NS_ERROR_OUT_OF_MEMORY);
   }
 
   FillPropertyDescriptor(desc, global, JS::ObjectValue(*components), false);
 
   return NS_OK;
 }
--- a/dom/base/nsGlobalWindow.cpp
+++ b/dom/base/nsGlobalWindow.cpp
@@ -2586,17 +2586,17 @@ nsGlobalWindow::SetNewDocument(nsIDocume
     // Set scriptability based on the state of the docshell.
     bool allow = GetDocShell()->GetCanExecuteScripts();
     xpc::Scriptability::Get(GetWrapperPreserveColor()).SetDocShellAllowsScript(allow);
 
     if (!aState) {
       JS::Rooted<JSObject*> rootedWrapper(cx, GetWrapperPreserveColor());
       if (!JS_DefineProperty(cx, newInnerGlobal, "window", rootedWrapper,
                              JSPROP_ENUMERATE | JSPROP_READONLY |
-                             JSPROP_PERMANENT | JSPROP_PROPOP_ACCESSORS,
+                             JSPROP_PERMANENT,
                              JS_STUBGETTER, JS_STUBSETTER)) {
         NS_ERROR("can't create the 'window' property");
         return NS_ERROR_FAILURE;
       }
     }
   }
 
   JSAutoCompartment ac(cx, GetWrapperPreserveColor());
@@ -4522,18 +4522,17 @@ nsGlobalWindow::SetOpener(JSContext* aCx
   if (!aOpener.isNull() && !nsContentUtils::IsCallerChrome()) {
     JS::Rooted<JSObject*> thisObj(aCx, GetWrapperPreserveColor());
     if (!thisObj) {
       aError.Throw(NS_ERROR_UNEXPECTED);
       return;
     }
 
     if (!JS_WrapObject(aCx, &thisObj) ||
-        !JS_DefineProperty(aCx, thisObj, "opener", aOpener,
-                           JSPROP_ENUMERATE | JSPROP_PROPOP_ACCESSORS,
+        !JS_DefineProperty(aCx, thisObj, "opener", aOpener, JSPROP_ENUMERATE,
                            JS_STUBGETTER, JS_STUBSETTER)) {
       aError.Throw(NS_ERROR_FAILURE);
     }
 
     return;
   }
 
   if (!aOpener.isObjectOrNull()) {
@@ -14000,18 +13999,17 @@ NS_IMETHODIMP
 nsGlobalWindow::SetConsole(JSContext* aCx, JS::Handle<JS::Value> aValue)
 {
   JS::Rooted<JSObject*> thisObj(aCx, GetWrapper());
   if (!thisObj) {
     return NS_ERROR_UNEXPECTED;
   }
 
   if (!JS_WrapObject(aCx, &thisObj) ||
-      !JS_DefineProperty(aCx, thisObj, "console", aValue,
-                         JSPROP_ENUMERATE | JSPROP_PROPOP_ACCESSORS,
+      !JS_DefineProperty(aCx, thisObj, "console", aValue, JSPROP_ENUMERATE,
                          JS_STUBGETTER, JS_STUBSETTER)) {
     return NS_ERROR_FAILURE;
   }
 
   return NS_OK;
 }
 
 Console*
--- a/dom/bindings/BindingUtils.cpp
+++ b/dom/bindings/BindingUtils.cpp
@@ -524,17 +524,17 @@ CreateInterfaceObject(JSContext* cx, JS:
     while (namedConstructors->mName) {
       JS::Rooted<JSObject*> namedConstructor(cx,
         CreateConstructor(cx, global, namedConstructors->mName,
                           &namedConstructors->mHolder,
                           namedConstructors->mNargs));
       if (!namedConstructor ||
           !JS_DefineProperty(cx, namedConstructor, "prototype",
                              proto,
-                             JSPROP_PERMANENT | JSPROP_READONLY | JSPROP_PROPOP_ACCESSORS,
+                             JSPROP_PERMANENT | JSPROP_READONLY,
                              JS_STUBGETTER, JS_STUBSETTER) ||
           (defineOnGlobal &&
            !DefineConstructor(cx, global, namedConstructors->mName,
                               namedConstructor))) {
         return nullptr;
       }
       js::SetReservedSlot(constructor, namedConstructorSlot++,
                           JS::ObjectValue(*namedConstructor));
--- a/dom/xbl/nsXBLBinding.cpp
+++ b/dom/xbl/nsXBLBinding.cpp
@@ -882,17 +882,17 @@ GetOrCreateClassObjectMap(JSContext *cx,
   if (desc.object() && desc.value().isObject() &&
       JS::IsWeakMapObject(&desc.value().toObject())) {
     return &desc.value().toObject();
   }
 
   // It's not there. Create and define it.
   JS::Rooted<JSObject*> map(cx, JS::NewWeakMapObject(cx));
   if (!map || !JS_DefineProperty(cx, scope, mapName, map,
-                                 JSPROP_PERMANENT | JSPROP_READONLY | JSPROP_PROPOP_ACCESSORS,
+                                 JSPROP_PERMANENT | JSPROP_READONLY,
                                  JS_STUBGETTER, JS_STUBSETTER))
   {
     return nullptr;
   }
   return map;
 }
 
 static JSObject*
@@ -1031,17 +1031,17 @@ nsXBLBinding::DoInitJSClass(JSContext *c
     NS_ADDREF(docInfo);
     JS_SetReservedSlot(proto, 0, PRIVATE_TO_JSVAL(aProtoBinding));
 
     // Next, enter the compartment of the property holder, wrap the proto, and
     // stick it on.
     JSAutoCompartment ac3(cx, holder);
     if (!JS_WrapObject(cx, &proto) ||
         !JS_DefineProperty(cx, holder, aClassName.get(), proto,
-                           JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_PROPOP_ACCESSORS,
+                           JSPROP_READONLY | JSPROP_PERMANENT,
                            JS_STUBGETTER, JS_STUBSETTER))
     {
       return NS_ERROR_OUT_OF_MEMORY;
     }
   }
 
   // Whew. We have the proto. Wrap it back into the compartment of |obj|,
   // splice it in, and return it.
--- a/dom/xbl/nsXBLProtoImpl.cpp
+++ b/dom/xbl/nsXBLProtoImpl.cpp
@@ -113,17 +113,17 @@ nsXBLProtoImpl::InstallImplementation(ns
 
     // This is just a property holder, so it doesn't need any special JSClass.
     propertyHolder = JS_NewObjectWithGivenProto(cx, nullptr, JS::NullPtr(), scopeObject);
     NS_ENSURE_TRUE(propertyHolder, NS_ERROR_OUT_OF_MEMORY);
 
     // Define it as a property on the scopeObject, using the same name used on
     // the content side.
     bool ok = JS_DefineProperty(cx, scopeObject, className, propertyHolder,
-                                JSPROP_PERMANENT | JSPROP_READONLY | JSPROP_PROPOP_ACCESSORS,
+                                JSPROP_PERMANENT | JSPROP_READONLY,
                                 JS_STUBGETTER, JS_STUBSETTER);
     NS_ENSURE_TRUE(ok, NS_ERROR_UNEXPECTED);
   } else {
     propertyHolder = targetClassObject;
   }
 
   // Walk our member list and install each one in turn on the XBL scope object.
   if (propertyHolderIsNew) {
--- a/ipc/testshell/XPCShellEnvironment.cpp
+++ b/ipc/testshell/XPCShellEnvironment.cpp
@@ -554,17 +554,17 @@ XPCShellEnvironment::Init()
     }
     JSAutoCompartment ac(cx, globalObj);
 
     backstagePass->SetGlobalObject(globalObj);
 
     JS::Rooted<Value> privateVal(cx, PrivateValue(this));
     if (!JS_DefineProperty(cx, globalObj, "__XPCShellEnvironment",
                            privateVal,
-                           JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_PROPOP_ACCESSORS,
+                           JSPROP_READONLY | JSPROP_PERMANENT,
                            JS_STUBGETTER, JS_STUBSETTER) ||
         !JS_DefineFunctions(cx, globalObj, gGlobalFunctions) ||
         !JS_DefineProfilingFunctions(cx, globalObj))
     {
         NS_ERROR("JS_DefineFunctions failed!");
         return false;
     }
 
--- a/js/src/builtin/TestingFunctions.cpp
+++ b/js/src/builtin/TestingFunctions.cpp
@@ -1179,38 +1179,36 @@ ShellObjectMetadataCallback(JSContext *c
 
     RootedObject stack(cx, NewDenseEmptyArray(cx));
     if (!stack)
         return false;
 
     static int createdIndex = 0;
     createdIndex++;
 
-    if (!JS_DefineProperty(cx, obj, "index", createdIndex,
-                           JSPROP_PROPOP_ACCESSORS,
+    if (!JS_DefineProperty(cx, obj, "index", createdIndex, 0,
                            JS_STUBGETTER, JS_STUBSETTER))
     {
         return false;
     }
 
-    if (!JS_DefineProperty(cx, obj, "stack", stack, JSPROP_PROPOP_ACCESSORS,
+    if (!JS_DefineProperty(cx, obj, "stack", stack, 0,
                            JS_STUBGETTER, JS_STUBSETTER))
     {
         return false;
     }
 
     int stackIndex = 0;
     RootedId id(cx);
     RootedValue callee(cx);
     for (NonBuiltinScriptFrameIter iter(cx); !iter.done(); ++iter) {
         if (iter.isFunctionFrame() && iter.compartment() == cx->compartment()) {
             id = INT_TO_JSID(stackIndex);
             RootedObject callee(cx, iter.callee());
-            if (!JS_DefinePropertyById(cx, stack, id, callee,
-                                       JSPROP_PROPOP_ACCESSORS,
+            if (!JS_DefinePropertyById(cx, stack, id, callee, 0,
                                        JS_STUBGETTER, JS_STUBSETTER))
             {
                 return false;
             }
             stackIndex++;
         }
     }
 
--- a/js/src/ctypes/CTypes.cpp
+++ b/js/src/ctypes/CTypes.cpp
@@ -1374,17 +1374,17 @@ JS_PUBLIC_API(bool)
 JS_InitCTypesClass(JSContext* cx, HandleObject global)
 {
   // attach ctypes property to global object
   RootedObject ctypes(cx, JS_NewObject(cx, &sCTypesGlobalClass, NullPtr(), NullPtr()));
   if (!ctypes)
     return false;
 
   if (!JS_DefineProperty(cx, global, "ctypes", ctypes,
-                         JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_PROPOP_ACCESSORS,
+                         JSPROP_READONLY | JSPROP_PERMANENT,
                          JS_STUBGETTER, JS_STUBSETTER)){
     return false;
   }
 
   if (!InitTypeClasses(cx, ctypes))
     return false;
 
   // attach API functions and properties
--- a/js/src/jsapi-tests/testAddPropertyPropcache.cpp
+++ b/js/src/jsapi-tests/testAddPropertyPropcache.cpp
@@ -42,25 +42,25 @@ BEGIN_TEST(testAddPropertyHook)
     JS_InitClass(cx, global, obj, &AddPropertyClass, nullptr, 0, nullptr, nullptr, nullptr,
                  nullptr);
 
     obj = JS_NewArrayObject(cx, 0);
     CHECK(obj);
     JS::RootedValue arr(cx, OBJECT_TO_JSVAL(obj));
 
     CHECK(JS_DefineProperty(cx, global, "arr", arr,
-                            JSPROP_ENUMERATE | JSPROP_PROPOP_ACCESSORS,
+                            JSPROP_ENUMERATE,
                             JS_STUBGETTER, JS_STUBSETTER));
 
     JS::RootedObject arrObj(cx, &arr.toObject());
     for (int i = 0; i < ExpectedCount; ++i) {
         obj = JS_NewObject(cx, &AddPropertyClass, JS::NullPtr(), JS::NullPtr());
         CHECK(obj);
         CHECK(JS_DefineElement(cx, arrObj, i, obj,
-                               JSPROP_ENUMERATE | JSPROP_PROPOP_ACCESSORS,
+                               JSPROP_ENUMERATE,
                                JS_STUBGETTER, JS_STUBSETTER));
     }
 
     // Now add a prop to each of the objects, but make sure to do
     // so at the same bytecode location so we can hit the propcache.
     EXEC("'use strict';                                     \n"
          "for (var i = 0; i < arr.length; ++i)              \n"
          "  arr[i].prop = 42;                               \n"
--- a/js/src/jsapi-tests/testSetProperty.cpp
+++ b/js/src/jsapi-tests/testSetProperty.cpp
@@ -7,18 +7,17 @@
 
 #include "jsapi-tests/tests.h"
 
 BEGIN_TEST(testSetProperty_NativeGetterStubSetter)
 {
     JS::RootedObject obj(cx, JS_NewObject(cx, nullptr, JS::NullPtr(), JS::NullPtr()));
     CHECK(obj);
 
-    CHECK(JS_DefineProperty(cx, global, "globalProp", obj,
-                            JSPROP_ENUMERATE | JSPROP_PROPOP_ACCESSORS,
+    CHECK(JS_DefineProperty(cx, global, "globalProp", obj, JSPROP_ENUMERATE,
                             JS_STUBGETTER, JS_STUBSETTER));
 
     CHECK(JS_DefineProperty(cx, obj, "prop", JS::UndefinedHandleValue,
                             JSPROP_SHARED | JSPROP_PROPOP_ACCESSORS,
                             JS_PROPERTYOP_GETTER(NativeGet), JS_STUBSETTER));
 
     EXEC("'use strict';                                     \n"
          "var error, passed = false;                        \n"
--- a/js/src/jsapi.cpp
+++ b/js/src/jsapi.cpp
@@ -2826,17 +2826,34 @@ DefinePropertyById(JSContext *cx, Handle
     // its way through the API layer so that we can enforce this internally.
     if (attrs & (JSPROP_GETTER | JSPROP_SETTER))
         attrs &= ~JSPROP_READONLY;
 
     // When we use DefineProperty, we need full scriptable Function objects rather
     // than JSNatives. However, we might be pulling this property descriptor off
     // of something with JSNative property descriptors. If we are, wrap them in
     // JS Function objects.
-    if (!(attrs & JSPROP_PROPOP_ACCESSORS)) {
+    //
+    // But skip doing this if our accessors are the well-known stub
+    // accessors, since those are known to be JSPropertyOps.  Assert
+    // some sanity about it, though.
+    MOZ_ASSERT_IF(getter == JS_PropertyStub,
+                  setter == JS_StrictPropertyStub || (attrs & JSPROP_PROPOP_ACCESSORS));
+    MOZ_ASSERT_IF(setter == JS_StrictPropertyStub,
+                  getter == JS_PropertyStub || (attrs & JSPROP_PROPOP_ACCESSORS));
+
+
+    // If !(attrs & JSPROP_PROPOP_ACCESSORS), then either getter/setter are both
+    // possibly-null JSNatives (or possibly-null JSFunction* if JSPROP_GETTER or
+    // JSPROP_SETTER is appropriately set), or both are the well-known property
+    // stubs.  The subsequent block must handle only the first of these cases,
+    // so carefully exclude the latter case.
+    if (!(attrs & JSPROP_PROPOP_ACCESSORS) &&
+        getter != JS_PropertyStub && setter != JS_StrictPropertyStub)
+    {
         JSFunction::Flags zeroFlags = JSAPIToJSFunctionFlags(0);
 
         RootedAtom atom(cx, JSID_IS_ATOM(id) ? JSID_TO_ATOM(id) : nullptr);
         if (getter && !(attrs & JSPROP_GETTER)) {
             RootedObject global(cx, (JSObject*) &obj->global());
             JSFunction *getobj = NewFunction(cx, NullPtr(), (Native) getter, 0,
                                              zeroFlags, global, atom);
             if (!getobj)
--- a/js/src/jsfriendapi.cpp
+++ b/js/src/jsfriendapi.cpp
@@ -284,17 +284,17 @@ JS_TraceShapeCycleCollectorChildren(JSTr
 
 static bool
 DefineHelpProperty(JSContext *cx, HandleObject obj, const char *prop, const char *value)
 {
     RootedAtom atom(cx, Atomize(cx, value, strlen(value)));
     if (!atom)
         return false;
     return JS_DefineProperty(cx, obj, prop, atom,
-                             JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_PROPOP_ACCESSORS,
+                             JSPROP_READONLY | JSPROP_PERMANENT,
                              JS_STUBGETTER, JS_STUBSETTER);
 }
 
 JS_FRIEND_API(bool)
 JS_DefineFunctionsWithHelp(JSContext *cx, HandleObject obj, const JSFunctionSpecWithHelp *fs)
 {
     MOZ_ASSERT(!cx->runtime()->isAtomsCompartment(cx->compartment()));
 
--- a/js/src/jsmath.cpp
+++ b/js/src/jsmath.cpp
@@ -1562,17 +1562,17 @@ js_InitMathClass(JSContext *cx, HandleOb
 {
     RootedObject proto(cx, obj->as<GlobalObject>().getOrCreateObjectPrototype(cx));
     if (!proto)
         return nullptr;
     RootedObject Math(cx, NewObjectWithGivenProto(cx, &MathClass, proto, obj, SingletonObject));
     if (!Math)
         return nullptr;
 
-    if (!JS_DefineProperty(cx, obj, js_Math_str, Math, JSPROP_PROPOP_ACCESSORS,
+    if (!JS_DefineProperty(cx, obj, js_Math_str, Math, 0,
                            JS_STUBGETTER, JS_STUBSETTER))
     {
         return nullptr;
     }
 
     if (!JS_DefineFunctions(cx, Math, math_static_methods))
         return nullptr;
     if (!JS_DefineConstDoubles(cx, Math, math_constants))
--- a/js/src/json.cpp
+++ b/js/src/json.cpp
@@ -908,18 +908,17 @@ js_InitJSONClass(JSContext *cx, HandleOb
     if (!GlobalObject::getOrCreateBooleanPrototype(cx, global))
         return nullptr;
 
     RootedObject proto(cx, obj->as<GlobalObject>().getOrCreateObjectPrototype(cx));
     RootedObject JSON(cx, NewObjectWithClassProto(cx, &JSONClass, proto, global, SingletonObject));
     if (!JSON)
         return nullptr;
 
-    if (!JS_DefineProperty(cx, global, js_JSON_str, JSON,
-                           JSPROP_PROPOP_ACCESSORS,
+    if (!JS_DefineProperty(cx, global, js_JSON_str, JSON, 0,
                            JS_STUBGETTER, JS_STUBSETTER))
         return nullptr;
 
     if (!JS_DefineFunctions(cx, JSON, json_static_methods))
         return nullptr;
 
     global->setConstructor(JSProto_JSON, ObjectValue(*JSON));
 
--- a/js/src/jsreflect.cpp
+++ b/js/src/jsreflect.cpp
@@ -3536,17 +3536,17 @@ JS_InitReflect(JSContext *cx, HandleObje
     RootedObject proto(cx, obj->as<GlobalObject>().getOrCreateObjectPrototype(cx));
     if (!proto)
         return nullptr;
     RootedObject Reflect(cx, NewObjectWithGivenProto(cx, &JSObject::class_, proto,
                                                      obj, SingletonObject));
     if (!Reflect)
         return nullptr;
 
-    if (!JS_DefineProperty(cx, obj, "Reflect", Reflect, JSPROP_PROPOP_ACCESSORS,
+    if (!JS_DefineProperty(cx, obj, "Reflect", Reflect, 0,
                            JS_STUBGETTER, JS_STUBSETTER)) {
         return nullptr;
     }
 
     if (!JS_DefineFunctions(cx, Reflect, static_methods))
         return nullptr;
 
     return Reflect;
--- a/js/src/perf/jsperf.cpp
+++ b/js/src/perf/jsperf.cpp
@@ -226,18 +226,17 @@ GetPM(JSContext* cx, JS::HandleValue val
     return nullptr;
 }
 
 namespace JS {
 
 JSObject*
 RegisterPerfMeasurement(JSContext *cx, HandleObject globalArg)
 {
-    static const uint8_t PM_CATTRS =
-        JSPROP_ENUMERATE|JSPROP_READONLY|JSPROP_PERMANENT|JSPROP_PROPOP_ACCESSORS;
+    static const uint8_t PM_CATTRS = JSPROP_ENUMERATE|JSPROP_READONLY|JSPROP_PERMANENT;
 
     RootedObject global(cx, globalArg);
     RootedObject prototype(cx);
     prototype = JS_InitClass(cx, global, js::NullPtr() /* parent */,
                              &pm_class, pm_construct, 1,
                              pm_props, pm_fns, 0, 0);
     if (!prototype)
         return 0;
--- a/js/src/proxy/Proxy.cpp
+++ b/js/src/proxy/Proxy.cpp
@@ -888,16 +888,16 @@ js_InitProxyClass(JSContext *cx, HandleO
     Rooted<GlobalObject*> global(cx, &obj->as<GlobalObject>());
     RootedFunction ctor(cx);
     ctor = global->createConstructor(cx, proxy, cx->names().Proxy, 2);
     if (!ctor)
         return nullptr;
 
     if (!JS_DefineFunctions(cx, ctor, static_methods))
         return nullptr;
-    if (!JS_DefineProperty(cx, obj, "Proxy", ctor, JSPROP_PROPOP_ACCESSORS,
+    if (!JS_DefineProperty(cx, obj, "Proxy", ctor, 0,
                            JS_STUBGETTER, JS_STUBSETTER)) {
         return nullptr;
     }
 
     global->setConstructor(JSProto_Proxy, ObjectValue(*ctor));
     return ctor;
 }
--- a/js/xpconnect/src/ExportHelpers.cpp
+++ b/js/xpconnect/src/ExportHelpers.cpp
@@ -420,17 +420,17 @@ ExportFunction(JSContext *cx, HandleValu
             return false;
         }
 
         // We have the forwarder function in the target compartment. If
         // defineAs was set, we also need to define it as a property on
         // the target.
         if (!JSID_IS_VOID(options.defineAs)) {
             if (!JS_DefinePropertyById(cx, targetScope, id, rval,
-                                       JSPROP_ENUMERATE | JSPROP_PROPOP_ACCESSORS,
+                                       JSPROP_ENUMERATE,
                                        JS_STUBGETTER, JS_STUBSETTER)) {
                 return false;
             }
         }
     }
 
     // Finally we have to re-wrap the exported function back to the caller compartment.
     if (!JS_WrapValue(cx, rval))
@@ -465,17 +465,17 @@ CreateObjectIn(JSContext *cx, HandleValu
     {
         JSAutoCompartment ac(cx, scope);
         obj = JS_NewObject(cx, nullptr, JS::NullPtr(), scope);
         if (!obj)
             return false;
 
         if (define) {
             if (!JS_DefinePropertyById(cx, scope, options.defineAs, obj,
-                                       JSPROP_ENUMERATE | JSPROP_PROPOP_ACCESSORS,
+                                       JSPROP_ENUMERATE,
                                        JS_STUBGETTER, JS_STUBSETTER))
                 return false;
         }
     }
 
     rval.setObject(*obj);
     if (!WrapperFactory::WaiveXrayAndWrap(cx, rval))
         return false;
--- a/js/xpconnect/wrappers/XrayWrapper.cpp
+++ b/js/xpconnect/wrappers/XrayWrapper.cpp
@@ -614,17 +614,17 @@ JSXrayTraits::defineProperty(JSContext *
         if (existingDesc.object() && existingDesc.object() != wrapper) {
             JS_ReportError(cx, "Not allowed to shadow non-own Xray-resolved property on [Object] or [Array] XrayWrapper");
             return false;
         }
 
         JSAutoCompartment ac(cx, target);
         if (!JS_WrapPropertyDescriptor(cx, desc) ||
             !JS_DefinePropertyById(cx, target, id, desc.value(),
-                                   desc.attributes() | JSPROP_PROPOP_ACCESSORS,
+                                   desc.attributes(),
                                    JS_STUBGETTER, JS_STUBSETTER))
         {
             return false;
         }
         *defined = true;
         return true;
     }