Fix build bustage in FF
authorLuke Wagner <lw@mozilla.com>
Thu, 10 Jun 2010 00:05:41 -0700
changeset 52797 54d4793084bd2c09262bcddc468a58cb3e301b8d
parent 52796 df628a955f27c810cfcdc807a22a52204bfdc0f8
child 52798 182561db34fd5e0edc4d959ccc7b5afaa4b2ef2c
push idunknown
push userunknown
push dateunknown
milestone1.9.3a5pre
Fix build bustage in FF
content/base/src/nsFrameMessageManager.cpp
js/src/ctypes/CTypes.cpp
js/src/jsarray.cpp
js/src/jsarray.h
js/src/xpconnect/src/xpcprivate.h
js/src/xpconnect/src/xpcwrappednativeinfo.cpp
js/src/xpconnect/src/xpcwrappednativejsops.cpp
--- a/content/base/src/nsFrameMessageManager.cpp
+++ b/content/base/src/nsFrameMessageManager.cpp
@@ -392,21 +392,21 @@ nsFrameMessageManager::ReceiveMessage(ns
           thisValue = OBJECT_TO_JSVAL(object);
         }
 
         jsval rval = JSVAL_VOID;
         nsAutoGCRoot resultGCRoot4(&rval, &rv);
         NS_ENSURE_SUCCESS(rv, rv);
 
         js::AutoValueRooter argv(mContext);
-        argv.setObject(param);
+        argv.set(js::ObjectTag(*param));
 
         JSObject* thisObject = JSVAL_TO_OBJECT(thisValue);
         JS_CallFunctionValue(mContext, thisObject,
-                             funval, 1, argv.addr(), &rval);
+                             funval, 1, argv.jsval_addr(), &rval);
         if (aJSONRetVal) {
           nsString json;
           if (JS_TryJSON(mContext, &rval) &&
               JS_Stringify(mContext, &rval, nsnull, JSVAL_NULL,
                            JSONCreator, &json)) {
             aJSONRetVal->AppendElement(json);
           }
         }
--- a/js/src/ctypes/CTypes.cpp
+++ b/js/src/ctypes/CTypes.cpp
@@ -4262,17 +4262,17 @@ StructType::BuildFieldsArray(JSContext* 
   JS_ASSERT(CType::IsSizeDefined(cx, obj));
 
   const FieldInfoHash* fields = GetFieldInfo(cx, obj);
   size_t len = fields->count();
 
   // Prepare a new array for the 'fields' property of the StructType.
   jsval* fieldsVec;
   JSObject* fieldsProp =
-    js_NewArrayObjectWithCapacity(cx, len, Valueify(&fieldsVec));
+    js_NewArrayObjectWithCapacity(cx, len, &fieldsVec);
   if (!fieldsProp)
     return NULL;
   js::AutoObjectRooter root(cx, fieldsProp);
   JS_ASSERT(len == 0 || fieldsVec);
 
   for (FieldInfoHash::Range r = fields->all(); !r.empty(); r.popFront()) {
     const FieldInfoHash::Entry& entry = r.front();
     // Add the field descriptor to the array.
@@ -4954,17 +4954,17 @@ FunctionType::ArgTypesGetter(JSContext* 
     return JS_TRUE;
 
   FunctionInfo* fninfo = GetFunctionInfo(cx, obj);
   size_t len = fninfo->mArgTypes.length();
 
   // Prepare a new array.
   jsval* vec;
   JSObject* argTypes =
-    js_NewArrayObjectWithCapacity(cx, len, Valueify(&vec));
+    js_NewArrayObjectWithCapacity(cx, len, &vec);
   if (!argTypes)
     return JS_FALSE;
   js::AutoObjectRooter argsroot(cx, argTypes);
   JS_ASSERT(len == 0 || vec);
 
   for (size_t i = 0; i < len; ++i)
     vec[i] = OBJECT_TO_JSVAL(fninfo->mArgTypes[i]);
 
--- a/js/src/jsarray.cpp
+++ b/js/src/jsarray.cpp
@@ -3278,33 +3278,33 @@ js_CoerceArrayToCanvasImageData(JSObject
             return JS_FALSE;
         }
     }
 
     return JS_TRUE;
 }
 
 JS_FRIEND_API(JSObject *)
-js_NewArrayObjectWithCapacity(JSContext *cx, jsuint capacity, Value **vector)
+js_NewArrayObjectWithCapacity(JSContext *cx, jsuint capacity, jsval **vector)
 {
     JSObject *obj = js_NewArrayObject(cx, capacity, NULL);
     if (!obj)
         return NULL;
 
     AutoObjectRooter tvr(cx, obj);
     if (!obj->ensureDenseArrayElements(cx, capacity, JS_FALSE))
         obj = NULL;
 
     /* Set/clear newborn root, in case we lost it.  */
     cx->weakRoots.finalizableNewborns[FINALIZE_OBJECT] = obj;
     if (!obj)
         return NULL;
 
     obj->setDenseArrayCount(capacity);
-    *vector = obj->getDenseArrayElements();
+    *vector = Jsvalify(obj->getDenseArrayElements());
     return obj;
 }
 
 JS_FRIEND_API(JSBool)
 js_IsDensePrimitiveArray(JSObject *obj)
 {
     if (!obj || !obj->isDenseArray())
         return JS_FALSE;
@@ -3364,17 +3364,17 @@ js_CloneDensePrimitiveArray(JSContext *c
              */
             *clone = NULL;
             return JS_TRUE;
         }
 
         vector.append(val);
     }
 
-    Value *buffer;
+    jsval *buffer;
     *clone = js_NewArrayObjectWithCapacity(cx, jsvalCount, &buffer);
     if (!*clone)
         return JS_FALSE;
 
     AutoObjectRooter cloneRoot(cx, *clone);
 
     memcpy(buffer, vector.begin(), jsvalCount * sizeof (jsval));
     (*clone)->setDenseArrayLength(length);
--- a/js/src/jsarray.h
+++ b/js/src/jsarray.h
@@ -212,17 +212,17 @@ js_Array(JSContext* cx, JSObject* obj, u
  * first element of this internal buffer is returned in the |vector| out
  * parameter.  The caller promises to fill in the first |capacity| values
  * starting from that pointer immediately after this function returns and
  * without triggering GC (so this method is allowed to leave those
  * uninitialized) and to set them to non-JSVAL_HOLE values, so that the
  * resulting array has length and count both equal to |capacity|.
  */
 JS_FRIEND_API(JSObject *)
-js_NewArrayObjectWithCapacity(JSContext *cx, jsuint capacity, js::Value **vector);
+js_NewArrayObjectWithCapacity(JSContext *cx, jsuint capacity, jsval **vector);
 
 /*
  * Makes a fast clone of a dense array as long as the array only contains
  * primitive values.
  *
  * If the return value is JS_FALSE then clone will not be set.
  *
  * If the return value is JS_TRUE then clone will either be set to the address
--- a/js/src/xpconnect/src/xpcprivate.h
+++ b/js/src/xpconnect/src/xpcprivate.h
@@ -2252,17 +2252,17 @@ extern JSBool ConstructSlimWrapper(XPCCa
                                    XPCWrappedNativeScope* xpcScope,
                                    jsval *rval);
 extern JSBool MorphSlimWrapper(JSContext *cx, JSObject *obj);
 
 static inline XPCWrappedNativeProto*
 GetSlimWrapperProto(JSObject *obj)
 {
   const js::Value &v = obj->getSlot(JSSLOT_START(obj->getClass()));
-  return static_cast<XPCWrappedNativeProto*>(v.asPrivateVoidPtr());
+  return static_cast<XPCWrappedNativeProto*>(v.asPrivate());
 }
 
 
 /***********************************************/
 // XPCWrappedNativeTearOff represents the info needed to make calls to one
 // interface on the underlying native object of a XPCWrappedNative.
 
 class XPCWrappedNativeTearOff
--- a/js/src/xpconnect/src/xpcwrappednativeinfo.cpp
+++ b/js/src/xpconnect/src/xpcwrappednativeinfo.cpp
@@ -93,17 +93,18 @@ XPCNativeMember::GetCallInfo(XPCCallCont
                              XPCNativeInterface** pInterface,
                              XPCNativeMember**    pMember)
 {
     jsval ifaceVal;
     jsval memberVal;
 
     if(!JS_GetReservedSlot(ccx, funobj, 0, &ifaceVal) ||
        !JS_GetReservedSlot(ccx, funobj, 1, &memberVal) ||
-       !JSVAL_MAY_BE_PRIVATE(ifaceVal) || !JSVAL_MAY_BE_PRIVATE(memberVal))
+       !JSVAL_IS_UNDERLYING_TYPE_OF_PRIVATE(ifaceVal) ||
+       !JSVAL_IS_UNDERLYING_TYPE_OF_PRIVATE(memberVal))
     {
         return JS_FALSE;
     }
 
     *pInterface = (XPCNativeInterface*) JSVAL_TO_PRIVATE(ifaceVal);
     *pMember = (XPCNativeMember*) JSVAL_TO_PRIVATE(memberVal);
 
     return JS_TRUE;
--- a/js/src/xpconnect/src/xpcwrappednativejsops.cpp
+++ b/js/src/xpconnect/src/xpcwrappednativejsops.cpp
@@ -1501,34 +1501,34 @@ XPC_WN_JSOp_ThisObject(JSContext *cx, JS
         XPCThrower::Throw(NS_ERROR_FAILURE, cx);
         return nsnull;
     }
 
     AutoPopJSContext popper(threadData->GetJSContextStack());
     popper.PushIfNotTop(cx);
 
     JSObject* outerscope = scope;
-    OBJ_TO_OUTER_OBJECT(cx, outerscope);
+    Outerize(cx, &outerscope);
     if(!outerscope)
         return nsnull;
 
     if(obj == outerscope)
     {
         // Fast-path for the common case: a window being wrapped in its own
         // scope. Check to see if the object actually needs a XOW, and then
         // give it one in its own scope.
 
         if(!XPCCrossOriginWrapper::ClassNeedsXOW(obj->getClass()->name))
             return obj;
 
-        js::AutoValueRooter tvr(cx, OBJECT_TO_JSVAL(obj));
-        if(!XPCCrossOriginWrapper::WrapObject(cx, scope, tvr.addr()))
+        js::AutoValueRooter tvr(cx, js::ObjectTag(*obj));
+        if(!XPCCrossOriginWrapper::WrapObject(cx, scope, tvr.jsval_addr()))
             return nsnull;
 
-        return JSVAL_TO_OBJECT(tvr.value());
+        return &tvr.value().asObject();
     }
 
     nsIScriptSecurityManager* secMan = XPCWrapper::GetSecurityManager();
     if(!secMan)
     {
         XPCThrower::Throw(NS_ERROR_FAILURE, cx);
         return nsnull;
     }