This commit is contained in:
Robert Sayre 2010-03-31 08:21:07 -07:00
Родитель 1a657e9883
Коммит 026c662142
10 изменённых файлов: 25 добавлений и 56 удалений

Просмотреть файл

@ -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),

Просмотреть файл

@ -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<ffi_type> 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<jsval, 16> 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.

Просмотреть файл

@ -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)

Просмотреть файл

@ -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.

Просмотреть файл

@ -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:

Просмотреть файл

@ -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,

Просмотреть файл

@ -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"),

Просмотреть файл

@ -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) ||

Просмотреть файл

@ -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<nsIScriptObjectPrincipal> sop(do_QueryInterface(prinOrSop));

Просмотреть файл

@ -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;