Bug 910777 - Add JSCLASS_IMPLEMENTS_BARRIERS to the Binary Data classes with custom trace r=sfink
authorNicholas D. Matsakis <nmatsakis@mozilla.com>
Fri, 30 Aug 2013 07:14:30 -0400
changeset 158519 c8dffd55eeeff68d14e55fe0c86c207984b0bed1
parent 158518 0016284ded203e24f5fcad2cf9277e1c9477435f
child 158520 6c0117fbfe6951225ffa503bee4c1fcba53b00ed
push id2961
push userlsblakk@mozilla.com
push dateMon, 28 Oct 2013 21:59:28 +0000
treeherdermozilla-beta@73ef4f13486f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssfink
bugs910777
milestone26.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 910777 - Add JSCLASS_IMPLEMENTS_BARRIERS to the Binary Data classes with custom trace r=sfink
js/src/builtin/BinaryData.cpp
js/src/builtin/TypeRepresentation.cpp
--- a/js/src/builtin/BinaryData.cpp
+++ b/js/src/builtin/BinaryData.cpp
@@ -930,25 +930,25 @@ ArrayType::create(JSContext *cx, HandleO
         cx,
         ArrayTypeRepresentation::Create(cx, elementTypeRepr, length));
     if (!typeReprObj)
         return NULL;
 
     RootedObject obj(cx, NewBuiltinClassInstance(cx, &ArrayType::class_));
     if (!obj)
         return NULL;
-    obj->setFixedSlot(SLOT_TYPE_REPR, ObjectValue(*typeReprObj));
+    obj->initFixedSlot(SLOT_TYPE_REPR, ObjectValue(*typeReprObj));
 
     RootedValue elementTypeVal(cx, ObjectValue(*elementType));
     if (!JSObject::defineProperty(cx, obj, cx->names().elementType,
                                   elementTypeVal, NULL, NULL,
                                   JSPROP_READONLY | JSPROP_PERMANENT))
         return NULL;
 
-    obj->setFixedSlot(SLOT_ARRAY_ELEM_TYPE, elementTypeVal);
+    obj->initFixedSlot(SLOT_ARRAY_ELEM_TYPE, elementTypeVal);
 
     RootedValue lengthVal(cx, Int32Value(length));
     if (!JSObject::defineProperty(cx, obj, cx->names().length,
                                   lengthVal, NULL, NULL,
                                   JSPROP_READONLY | JSPROP_PERMANENT))
         return NULL;
 
     if (!InitializeCommonTypeDescriptorProperties(cx, obj, typeReprObj))
@@ -1137,26 +1137,26 @@ StructType::layout(JSContext *cx, Handle
     // Construct the `TypeRepresentation*`.
     RootedObject typeReprObj(
         cx,
         StructTypeRepresentation::Create(cx, ids, fieldTypeReprObjs));
     if (!typeReprObj)
         return false;
     StructTypeRepresentation *typeRepr =
         TypeRepresentation::fromOwnerObject(typeReprObj)->asStruct();
-    structType->setFixedSlot(SLOT_TYPE_REPR, ObjectValue(*typeReprObj));
+    structType->initFixedSlot(SLOT_TYPE_REPR, ObjectValue(*typeReprObj));
 
     // Construct for internal use an array with the type object for each field.
     RootedObject fieldTypeVec(
         cx,
         NewDenseCopiedArray(cx, fieldTypeObjs.length(), fieldTypeObjs.begin()));
     if (!fieldTypeVec)
         return false;
 
-    structType->setFixedSlot(SLOT_STRUCT_FIELD_TYPES,
+    structType->initFixedSlot(SLOT_STRUCT_FIELD_TYPES,
                              ObjectValue(*fieldTypeVec));
 
     // Construct the fieldNames vector
     AutoValueVector fieldNameValues(cx);
     for (unsigned int i = 0; i < ids.length(); i++) {
         RootedValue value(cx, IdToValue(ids[i]));
         if (!fieldNameValues.append(value))
             return false;
@@ -1576,17 +1576,17 @@ DefineNumericClass(JSContext *cx,
                         globalProto, 0));
     if (!numFun)
         return false;
 
     RootedObject typeReprObj(cx, ScalarTypeRepresentation::Create(cx, type));
     if (!typeReprObj)
         return false;
 
-    numFun->setFixedSlot(SLOT_TYPE_REPR, ObjectValue(*typeReprObj));
+    numFun->initFixedSlot(SLOT_TYPE_REPR, ObjectValue(*typeReprObj));
 
     if (!InitializeCommonTypeDescriptorProperties(cx, numFun, typeReprObj))
         return false;
 
     if (!JS_DefineFunction(cx, numFun, "toString",
                            NumericTypeToString<type>, 0, 0))
         return false;
 
@@ -1624,16 +1624,17 @@ js_InitBinaryDataClasses(JSContext *cx, 
 ///////////////////////////////////////////////////////////////////////////
 // Binary blocks
 
 Class BinaryBlock::class_ = {
     "BinaryBlock",
     Class::NON_NATIVE |
     JSCLASS_HAS_RESERVED_SLOTS(BLOCK_RESERVED_SLOTS) |
     JSCLASS_HAS_PRIVATE |
+    JSCLASS_IMPLEMENTS_BARRIERS |
     JSCLASS_HAS_CACHED_PROTO(JSProto_ArrayType),
     JS_PropertyStub,
     JS_DeletePropertyStub,
     JS_PropertyStub,
     JS_StrictPropertyStub,
     JS_EnumerateStub,
     JS_ResolveStub,
     JS_ConvertStub,
@@ -1733,18 +1734,18 @@ BinaryBlock::createNull(JSContext *cx, H
 
     RootedValue protoVal(cx);
     if (!JSObject::getProperty(cx, type, type,
                                cx->names().classPrototype, &protoVal))
         return NULL;
 
     RootedObject obj(cx,
         NewObjectWithClassProto(cx, &class_, &protoVal.toObject(), NULL));
-    obj->setFixedSlot(SLOT_DATATYPE, ObjectValue(*type));
-    obj->setFixedSlot(SLOT_BLOCKREFOWNER, owner);
+    obj->initFixedSlot(SLOT_DATATYPE, ObjectValue(*type));
+    obj->initFixedSlot(SLOT_BLOCKREFOWNER, owner);
 
     // Tag the type object for this instance with the type
     // representation, if that has not been done already.
     if (cx->typeInferenceEnabled()) {
         RootedTypeObject typeObj(cx, obj->getType(cx));
         if (typeObj) {
             TypeRepresentation *typeRepr = typeRepresentation(type);
             if (!typeObj->addBinaryDataAddendum(cx, typeRepr))
--- a/js/src/builtin/TypeRepresentation.cpp
+++ b/js/src/builtin/TypeRepresentation.cpp
@@ -22,16 +22,17 @@
 using namespace js;
 using namespace mozilla;
 
 ///////////////////////////////////////////////////////////////////////////
 // Class def'n for the owner object
 
 Class TypeRepresentation::class_ = {
     "TypeRepresentation",
+    JSCLASS_IMPLEMENTS_BARRIERS |
     JSCLASS_HAS_PRIVATE,
     JS_PropertyStub,         /* addProperty */
     JS_DeletePropertyStub,   /* delProperty */
     JS_PropertyStub,         /* getProperty */
     JS_StrictPropertyStub,   /* setProperty */
     JS_EnumerateStub,
     JS_ResolveStub,
     JS_ConvertStub,