From 026c662142a34dfcaf4f64d2d57d52ba474e41e9 Mon Sep 17 00:00:00 2001 From: Robert Sayre Date: Wed, 31 Mar 2010 08:21:07 -0700 Subject: [PATCH] Fix merge bustage. --- content/base/src/nsContentUtils.cpp | 6 ++-- js/ctypes/CTypes.cpp | 26 +++++++-------- js/ctypes/Library.cpp | 2 +- js/src/jsstr.cpp | 3 +- js/src/jstracer.cpp | 32 +------------------ .../xpconnect/src/XPCSafeJSObjectWrapper.cpp | 4 +-- js/src/xpconnect/src/XPCSystemOnlyWrapper.cpp | 2 +- js/src/xpconnect/src/XPCWrapper.cpp | 2 +- js/src/xpconnect/src/xpccomponents.cpp | 2 +- js/src/xpconnect/src/xpcquickstubs.cpp | 2 +- 10 files changed, 25 insertions(+), 56 deletions(-) diff --git a/content/base/src/nsContentUtils.cpp b/content/base/src/nsContentUtils.cpp index 9c2bbd9e5e19..282afa86dbbf 100644 --- a/content/base/src/nsContentUtils.cpp +++ b/content/base/src/nsContentUtils.cpp @@ -5407,7 +5407,7 @@ public: jsval source; jsval clone; jsval temp; - JSAutoIdArray ids; + js::AutoIdArray ids; jsuint index; private: @@ -5425,7 +5425,7 @@ private: } CloneStackFrame* prevFrame; - JSAutoTempValueRooter tvrVals; + js::AutoArrayRooter tvrVals; }; class CloneStack @@ -5691,7 +5691,7 @@ nsContentUtils::CreateStructuredClone(JSContext* cx, } jsval output = OBJECT_TO_JSVAL(obj); - JSAutoTempValueRooter tvr(cx, output); + js::AutoValueRooter tvr(cx, output); CloneStack stack(cx); if (!stack.Push(val, OBJECT_TO_JSVAL(obj), diff --git a/js/ctypes/CTypes.cpp b/js/ctypes/CTypes.cpp index 2f61649548d0..91cc9d767bb0 100644 --- a/js/ctypes/CTypes.cpp +++ b/js/ctypes/CTypes.cpp @@ -663,7 +663,7 @@ InitTypeConstructor(JSContext* cx, dataProto = JS_NewObject(cx, &sCDataProtoClass, CDataProto, parent); if (!dataProto) return false; - JSAutoTempValueRooter protoroot(cx, dataProto); + js::AutoValueRooter protoroot(cx, dataProto); // Define functions and properties on the 'dataProto' object that are common // to all CData objects created from this type constructor. (These will @@ -797,25 +797,25 @@ InitTypeClasses(JSContext* cx, JSObject* parent) sPointerInstanceProps, protos[SLOT_POINTERPROTO], protos[SLOT_POINTERDATAPROTO])) return false; - JSAutoTempValueRooter proot(cx, protos[SLOT_POINTERDATAPROTO]); + js::AutoValueRooter proot(cx, protos[SLOT_POINTERDATAPROTO]); if (!InitTypeConstructor(cx, parent, CTypeProto, CDataProto, sArrayFunction, sArrayProps, sArrayInstanceFunctions, sArrayInstanceProps, protos[SLOT_ARRAYPROTO], protos[SLOT_ARRAYDATAPROTO])) return false; - JSAutoTempValueRooter aroot(cx, protos[SLOT_ARRAYDATAPROTO]); + js::AutoValueRooter aroot(cx, protos[SLOT_ARRAYDATAPROTO]); if (!InitTypeConstructor(cx, parent, CTypeProto, CDataProto, sStructFunction, sStructProps, sStructInstanceFunctions, NULL, protos[SLOT_STRUCTPROTO], protos[SLOT_STRUCTDATAPROTO])) return false; - JSAutoTempValueRooter sroot(cx, protos[SLOT_STRUCTDATAPROTO]); + js::AutoValueRooter sroot(cx, protos[SLOT_STRUCTDATAPROTO]); if (!InitTypeConstructor(cx, parent, CTypeProto, CDataProto, sFunctionFunction, sFunctionProps, NULL, NULL, protos[SLOT_FUNCTIONPROTO], protos[SLOT_FUNCTIONDATAPROTO])) return false; - JSAutoTempValueRooter froot(cx, protos[SLOT_FUNCTIONDATAPROTO]); + js::AutoValueRooter froot(cx, protos[SLOT_FUNCTIONDATAPROTO]); protos[SLOT_CDATAPROTO] = CDataProto; @@ -3787,7 +3787,7 @@ StructType::Create(JSContext* cx, uintN argc, jsval* vp) js_NewArrayObjectWithCapacity(cx, len, &fieldsVec); if (!fieldsProp) return JS_FALSE; - JSAutoTempValueRooter root(cx, fieldsProp); + js::AutoValueRooter root(cx, fieldsProp); JS_ASSERT(len == 0 || fieldsVec); nsAutoPtr ffiType(new ffi_type); @@ -4366,7 +4366,7 @@ FunctionType::Create(JSContext* cx, uintN argc, jsval* vp) // Pull out the argument types from the array, if any. JS_ASSERT(!argTypes.Length() || arrayObj); - JSAutoTempValueRooter items(cx, argTypes.Length(), argTypes.Elements()); + js::AutoArrayRooter items(cx, argTypes.Length(), argTypes.Elements()); for (jsuint i = 0; i < argTypes.Length(); ++i) { if (!JS_GetElement(cx, arrayObj, i, &argTypes[i])) return JS_FALSE; @@ -4407,7 +4407,7 @@ FunctionType::CreateInternal(JSContext* cx, &ffi_type_pointer, NULL); if (!typeObj) return NULL; - JSAutoTempValueRooter root(cx, typeObj); + js::AutoValueRooter root(cx, typeObj); // Stash the FunctionInfo in a reserved slot. if (!JS_SetReservedSlot(cx, typeObj, SLOT_FNINFO, @@ -4467,7 +4467,7 @@ FunctionType::ConstructData(JSContext* cx, JSObject* closureObj = CClosure::Create(cx, obj, fnObj, thisObj, data); if (!closureObj) return JS_FALSE; - JSAutoTempValueRooter root(cx, closureObj); + js::AutoValueRooter root(cx, closureObj); // Set the closure object as the referent of the new CData object. if (!JS_SetReservedSlot(cx, result, SLOT_REFERENT, @@ -4612,7 +4612,7 @@ FunctionType::ArgTypesGetter(JSContext* cx, JSObject* obj, jsval idval, jsval* v js_NewArrayObjectWithCapacity(cx, len, &vec); if (!argTypes) return JS_FALSE; - JSAutoTempValueRooter argsroot(cx, argTypes); + js::AutoValueRooter argsroot(cx, argTypes); JS_ASSERT(len == 0 || vec); for (PRUint32 i = 0; i < len; ++i) @@ -4667,7 +4667,7 @@ CClosure::Create(JSContext* cx, JSObject* result = JS_NewObject(cx, &sCClosureClass, NULL, NULL); if (!result) return NULL; - JSAutoTempValueRooter root(cx, result); + js::AutoValueRooter root(cx, result); // Get the FunctionInfo from the FunctionType. FunctionInfo* fninfo = FunctionType::GetFunctionInfo(cx, typeObj); @@ -4813,7 +4813,7 @@ CClosure::ClosureStub(ffi_cif* cif, void* result, void** args, void* userData) JS_ASSERT(cif == &fninfo->mCIF); // Get a death grip on 'closureObj'. - JSAutoTempValueRooter root(cx, cinfo->closureObj); + js::AutoValueRooter root(cx, cinfo->closureObj); // Set up an array for converted arguments. nsAutoTArray argv; @@ -4825,7 +4825,7 @@ CClosure::ClosureStub(ffi_cif* cif, void* result, void** args, void* userData) for (PRUint32 i = 0; i < cif->nargs; ++i) argv[i] = JSVAL_VOID; - JSAutoTempValueRooter roots(cx, argv.Length(), argv.Elements()); + js::AutoArrayRooter roots(cx, argv.Length(), argv.Elements()); for (PRUint32 i = 0; i < cif->nargs; ++i) { // Convert each argument, and have any CData objects created depend on // the existing buffers. diff --git a/js/ctypes/Library.cpp b/js/ctypes/Library.cpp index 34731c901f04..4bc3977b79bc 100644 --- a/js/ctypes/Library.cpp +++ b/js/ctypes/Library.cpp @@ -264,7 +264,7 @@ Library::Declare(JSContext* cx, uintN argc, jsval* vp) argv[1], argv[2], &argv[3], argc - 3); if (!typeObj) return JS_FALSE; - JSAutoTempValueRooter root(cx, typeObj); + js::AutoValueRooter root(cx, typeObj); JSObject* fn = CData::Create(cx, typeObj, obj, &func, true); if (!fn) diff --git a/js/src/jsstr.cpp b/js/src/jsstr.cpp index 9b68ba52479b..bb6284ea7f5f 100644 --- a/js/src/jsstr.cpp +++ b/js/src/jsstr.cpp @@ -1170,8 +1170,7 @@ StringMatch(const jschar *text, jsuint textlen, if (textlen < patlen) return -1; -#if defined(__i386__) || defined(_M_IX86) -#if defined(__i386__) || defined(__i386) +#if defined(__i386__) || defined(_M_IX86) || defined(__i386) /* * Given enough registers, the unrolled loop below is faster than the * following loop. 32-bit x86 does not have enough registers. diff --git a/js/src/jstracer.cpp b/js/src/jstracer.cpp index 060d1cf83816..27b4e87089bf 100644 --- a/js/src/jstracer.cpp +++ b/js/src/jstracer.cpp @@ -12056,37 +12056,7 @@ TraceRecorder::setElem(int lval_spindex, int idx_spindex, int v_spindex) avmplus::AvmCore::use_cmov()), avmplus::AvmCore::use_cmov()); } else { - switch (tarray->type) { - case js::TypedArray::TYPE_INT8: - case js::TypedArray::TYPE_UINT8: - addr_ins = lir->ins2(LIR_piadd, data_ins, pidx_ins); - lir->insStore(LIR_stb, lir->ins1(LIR_f2i, v_ins), addr_ins, 0); - break; - case js::TypedArray::TYPE_INT16: - case js::TypedArray::TYPE_UINT16: - addr_ins = lir->ins2(LIR_piadd, data_ins, lir->ins2i(LIR_pilsh, pidx_ins, 1)); - lir->insStore(LIR_sts, lir->ins1(LIR_f2i, v_ins), addr_ins, 0); - break; - case js::TypedArray::TYPE_INT32: - case js::TypedArray::TYPE_UINT32: - addr_ins = lir->ins2(LIR_piadd, data_ins, lir->ins2i(LIR_pilsh, pidx_ins, 2)); - lir->insStore(LIR_sti, lir->ins1(LIR_f2i, v_ins), addr_ins, 0); - break; - case js::TypedArray::TYPE_FLOAT32: - addr_ins = lir->ins2(LIR_piadd, data_ins, lir->ins2i(LIR_pilsh, pidx_ins, 2)); - lir->insStore(LIR_st32f, v_ins, addr_ins, 0); - break; - case js::TypedArray::TYPE_FLOAT64: - addr_ins = lir->ins2(LIR_piadd, data_ins, lir->ins2i(LIR_pilsh, pidx_ins, 3)); - lir->insStore(LIR_stfi, v_ins, addr_ins, 0); - break; - case js::TypedArray::TYPE_UINT8_CLAMPED: - addr_ins = lir->ins2(LIR_piadd, data_ins, pidx_ins); - lir->insStore(LIR_stb, lir->insCall(&js_TypedArray_uint8_clamp_double_ci, &v_ins), addr_ins, 0); - break; - default: - JS_NOT_REACHED("Unknown typed array type in tracer"); - } + v_ins = lir->insCall(&js_TypedArray_uint8_clamp_double_ci, &v_ins); } break; case js::TypedArray::TYPE_FLOAT32: diff --git a/js/src/xpconnect/src/XPCSafeJSObjectWrapper.cpp b/js/src/xpconnect/src/XPCSafeJSObjectWrapper.cpp index 7e3293041de5..3926f146e290 100644 --- a/js/src/xpconnect/src/XPCSafeJSObjectWrapper.cpp +++ b/js/src/xpconnect/src/XPCSafeJSObjectWrapper.cpp @@ -285,7 +285,7 @@ WrapObject(JSContext *cx, JSObject *scope, jsval v, jsval *vp) // with XPCSafeJSObjectWrapper, and never let the eval function // object be directly wrapped. - if (STOBJ_GET_CLASS(objToWrap) == &js_ScriptClass || + if (objToWrap->getClass() == &js_ScriptClass || (JS_ObjectIsFunction(cx, objToWrap) && JS_GetFunctionFastNative(cx, JS_ValueToFunction(cx, v)) == XPCWrapper::sEvalNative)) { @@ -406,7 +406,7 @@ WrapJSValue(JSContext *cx, JSObject *obj, jsval val, jsval *rval) // parent we pass in here, the construct hook will ensure we get // the right parent for the wrapper. JSObject *safeObj = JSVAL_TO_OBJECT(*rval); - if (STOBJ_GET_CLASS(safeObj) == &SJOWClass.base && + if (safeObj->getClass() == &SJOWClass.base && JS_GetGlobalForObject(cx, obj) != JS_GetGlobalForObject(cx, safeObj)) { // Check to see if the new object we just wrapped is accessible // from the unsafe object we got the new object through. If not, diff --git a/js/src/xpconnect/src/XPCSystemOnlyWrapper.cpp b/js/src/xpconnect/src/XPCSystemOnlyWrapper.cpp index 868dc302ab23..b77c13dbbfa5 100644 --- a/js/src/xpconnect/src/XPCSystemOnlyWrapper.cpp +++ b/js/src/xpconnect/src/XPCSystemOnlyWrapper.cpp @@ -154,7 +154,7 @@ MakeSOW(JSContext *cx, JSObject *obj) { #ifdef DEBUG { - JSClass *clasp = STOBJ_GET_CLASS(obj); + JSClass *clasp = obj->getClass(); NS_ASSERTION(clasp != &SystemOnlyWrapper::SOWClass.base && clasp != &XPCCrossOriginWrapper::XOWClass.base && strcmp(clasp->name, "XPCNativeWrapper"), diff --git a/js/src/xpconnect/src/XPCWrapper.cpp b/js/src/xpconnect/src/XPCWrapper.cpp index 209f9d233d4b..909cd6efe2b9 100644 --- a/js/src/xpconnect/src/XPCWrapper.cpp +++ b/js/src/xpconnect/src/XPCWrapper.cpp @@ -386,7 +386,7 @@ CreateSimpleIterator(JSContext *cx, JSObject *scope, JSBool keysonly, return nsnull; } - JSAutoTempValueRooter tvr(cx, iterObj); + js::AutoValueRooter tvr(cx, iterObj); if (!propertyContainer) { if (!JS_SetReservedSlot(cx, iterObj, 0, PRIVATE_TO_JSVAL(nsnull)) || !JS_SetReservedSlot(cx, iterObj, 1, JSVAL_ZERO) || diff --git a/js/src/xpconnect/src/xpccomponents.cpp b/js/src/xpconnect/src/xpccomponents.cpp index 17d6b184e1ff..35513279d4bf 100644 --- a/js/src/xpconnect/src/xpccomponents.cpp +++ b/js/src/xpconnect/src/xpccomponents.cpp @@ -3221,7 +3221,7 @@ xpc_CreateSandboxObject(JSContext * cx, jsval * vp, nsISupports *prinOrSop) nsnull, nsnull); if (!sandbox) return NS_ERROR_XPC_UNEXPECTED; - JSAutoTempValueRooter tvr(cx, sandbox); + js::AutoValueRooter tvr(cx, sandbox); nsCOMPtr sop(do_QueryInterface(prinOrSop)); diff --git a/js/src/xpconnect/src/xpcquickstubs.cpp b/js/src/xpconnect/src/xpcquickstubs.cpp index 90be0c3e64ae..92ea4a741ef0 100644 --- a/js/src/xpconnect/src/xpcquickstubs.cpp +++ b/js/src/xpconnect/src/xpcquickstubs.cpp @@ -296,7 +296,7 @@ LookupGetterOrSetter(JSContext *cx, JSBool wantGetter, uintN argc, jsval *vp) !IS_PROTO_CLASS(desc.obj->getClass()) || (desc.attrs & (JSPROP_GETTER | JSPROP_SETTER)) || !(desc.getter || desc.setter) || - desc.setter == STOBJ_GET_CLASS(desc.obj)->setProperty) + desc.setter == desc.obj->getClass()->setProperty) { JS_SET_RVAL(cx, vp, JSVAL_VOID); return JS_TRUE;