Add most handles and stack rooters needed for exact scanning on shell benchmarks, bug 714647. r=billm

This commit is contained in:
Brian Hackett
2012-04-12 09:23:51 -07:00
parent 78b7a37d77
commit 640d82f7e5
81 changed files with 1306 additions and 1025 deletions

View File

@@ -503,7 +503,8 @@ date_convert(JSContext *cx, JSObject *obj, JSType hint, Value *vp)
JS_ASSERT(hint == JSTYPE_NUMBER || hint == JSTYPE_STRING || hint == JSTYPE_VOID);
JS_ASSERT(obj->isDate());
return DefaultValue(cx, obj, (hint == JSTYPE_VOID) ? JSTYPE_STRING : hint, vp);
return DefaultValue(cx, RootedVarObject(cx, obj),
(hint == JSTYPE_VOID) ? JSTYPE_STRING : hint, vp);
}
/*
@@ -2665,14 +2666,15 @@ js_InitDateClass(JSContext *cx, JSObject *obj)
/* Set the static LocalTZA. */
LocalTZA = -(PRMJ_LocalGMTDifference() * msPerSecond);
GlobalObject *global = &obj->asGlobal();
RootedVar<GlobalObject*> global(cx, &obj->asGlobal());
JSObject *dateProto = global->createBlankPrototype(cx, &DateClass);
RootedVarObject dateProto(cx, global->createBlankPrototype(cx, &DateClass));
if (!dateProto)
return NULL;
SetDateToNaN(cx, dateProto);
JSFunction *ctor = global->createConstructor(cx, js_Date, CLASS_ATOM(cx, Date), MAXARGS);
RootedVarFunction ctor(cx);
ctor = global->createConstructor(cx, js_Date, CLASS_ATOM(cx, Date), MAXARGS);
if (!ctor)
return NULL;