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

@@ -53,9 +53,11 @@ using namespace js;
using namespace js::frontend;
bool
DefineGlobals(JSContext *cx, GlobalScope &globalScope, JSScript *script)
DefineGlobals(JSContext *cx, GlobalScope &globalScope, JSScript* script)
{
JSObject *globalObj = globalScope.globalObj;
Root<JSScript*> root(cx, &script);
HandleObject globalObj = globalScope.globalObj;
/* Define and update global properties. */
for (size_t i = 0; i < globalScope.defs.length(); i++) {
@@ -165,7 +167,6 @@ frontend::CompileScript(JSContext *cx, JSObject *scopeChain, StackFrame *callerF
{
TokenKind tt;
ParseNode *pn;
JSScript *script;
bool inDirectivePrologue;
JS_ASSERT(!(tcflags & ~(TCF_COMPILE_N_GO | TCF_NO_SCRIPT_RVAL | TCF_COMPILE_FOR_EVAL
@@ -199,8 +200,7 @@ frontend::CompileScript(JSContext *cx, JSObject *scopeChain, StackFrame *callerF
JS_ASSERT_IF(globalObj, globalObj->isNative());
JS_ASSERT_IF(globalObj, JSCLASS_HAS_GLOBAL_FLAG_AND_SLOTS(globalObj->getClass()));
/* Null script early in case of error, to reduce our code footprint. */
script = NULL;
RootedVar<JSScript*> script(cx);
GlobalScope globalScope(cx, globalObj, &bce);
bce.flags |= tcflags;