From f6b0dbf8c8fd2deba96e1a54eb1572007fb3dfa2 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Thu, 10 Jun 2010 22:20:30 -0700 Subject: [PATCH] [JAEGER] Fix build. --- js/src/jsinterp.cpp | 4 +-- js/src/jsiter.cpp | 2 +- js/src/jsops.cpp | 11 ++++---- js/src/jsscript.h | 2 +- js/src/jstracer.cpp | 4 +-- js/src/methodjit/Compiler.cpp | 2 +- js/src/methodjit/MethodJIT.cpp | 2 +- js/src/methodjit/StubCalls.cpp | 41 ++++++++++++++--------------- js/src/methodjit/nunbox/FastOps.cpp | 3 ++- js/src/trace-test/trace-test.py | 2 +- 10 files changed, 37 insertions(+), 36 deletions(-) diff --git a/js/src/jsinterp.cpp b/js/src/jsinterp.cpp index 1a85946c0c1..d7978cd3df9 100644 --- a/js/src/jsinterp.cpp +++ b/js/src/jsinterp.cpp @@ -691,7 +691,7 @@ Invoke(JSContext *cx, const InvokeArgsGuard &args, uintN flags) } else { JS_ASSERT(script); AutoPreserveEnumerators preserve(cx); - ok = RunScript(cx, script, fun, fp->scopeChain); + ok = RunScript(cx, script, fun, &fp->scopeChain.asObject()); } DTrace::exitJSFun(cx, fp, fun, fp->rval); @@ -887,7 +887,7 @@ Execute(JSContext *cx, JSObject *const chain, JSScript *script, hookData = hook(cx, fp, JS_TRUE, 0, cx->debugHooks->executeHookData); AutoPreserveEnumerators preserve(cx); - JSBool ok = RunScript(cx, script, fp->fun, fp->scopeChain); + JSBool ok = RunScript(cx, script, fp->fun, &fp->scopeChain.asObject()); if (result) *result = fp->rval; diff --git a/js/src/jsiter.cpp b/js/src/jsiter.cpp index eacbc93b00b..17c420a7ae9 100644 --- a/js/src/jsiter.cpp +++ b/js/src/jsiter.cpp @@ -1091,7 +1091,7 @@ SendToGenerator(JSContext *cx, JSGeneratorOp op, JSObject *obj, JSObject *enumerators = cx->enumerators; cx->enumerators = gen->enumerators; - ok = RunScript(cx, fp->script, fp->fun, fp->scopeChain); + ok = RunScript(cx, fp->script, fp->fun, &fp->scopeChain.asObject()); /* Restore the original enumerators stack. */ gen->enumerators = cx->enumerators; diff --git a/js/src/jsops.cpp b/js/src/jsops.cpp index f034b4fdbd0..43e5c56a461 100644 --- a/js/src/jsops.cpp +++ b/js/src/jsops.cpp @@ -1466,7 +1466,7 @@ BEGIN_CASE(JSOP_GLOBALDEC) slot = GET_SLOTNO(regs.pc); slot = script->getGlobalSlot(slot); JSObject *obj; - obj = fp->scopeChain->getGlobal(); + obj = fp->scopeChainObj()->getGlobal(); vp = &obj->getSlotRef(slot); goto do_int_fast_incop; END_CASE(JSOP_INCGLOBAL) @@ -2365,7 +2365,8 @@ BEGIN_CASE(JSOP_APPLY) * :FIXME: try to method jit - take this out once we're more * complete. */ - mjit::CompileStatus status = mjit::CanMethodJIT(cx, newscript, fun, newfp->scopeChain); + JSObject *scope = newfp->scopeChainObj(); + mjit::CompileStatus status = mjit::CanMethodJIT(cx, newscript, fun, scope); if (status == mjit::Compile_Error) goto error; if (status == mjit::Compile_Okay) { @@ -2929,7 +2930,7 @@ BEGIN_CASE(JSOP_CALLGLOBAL) { uint32 slot = GET_SLOTNO(regs.pc); slot = script->getGlobalSlot(slot); - JSObject *obj = fp->scopeChain->getGlobal(); + JSObject *obj = fp->scopeChainObj()->getGlobal(); JS_ASSERT(slot < obj->scope()->freeslot); PUSH_COPY(obj->getSlot(slot)); if (op == JSOP_CALLGLOBAL) @@ -2945,7 +2946,7 @@ BEGIN_CASE(JSOP_FORGLOBAL) PUSH_COPY(rval); uint32 slot = GET_SLOTNO(regs.pc); slot = script->getGlobalSlot(slot); - JSObject *obj = fp->scopeChain->getGlobal(); + JSObject *obj = fp->scopeChainObj()->getGlobal(); JS_ASSERT(slot < obj->scope()->freeslot); JS_LOCK_OBJ(cx, obj); { @@ -2965,7 +2966,7 @@ BEGIN_CASE(JSOP_SETGLOBAL) { uint32 slot = GET_SLOTNO(regs.pc); slot = script->getGlobalSlot(slot); - JSObject *obj = fp->scopeChain->getGlobal(); + JSObject *obj = fp->scopeChainObj()->getGlobal(); JS_ASSERT(slot < obj->scope()->freeslot); { JS_LOCK_OBJ(cx, obj); diff --git a/js/src/jsscript.h b/js/src/jsscript.h index 7aeac3caeb7..d1b908d105b 100644 --- a/js/src/jsscript.h +++ b/js/src/jsscript.h @@ -185,7 +185,7 @@ struct JSScript { } # endif #endif -#ifdef JS_TRACER +#if 0 /* def JS_TRACER */ js::TraceTreeCache *trees; /* trace tree info. */ uint32 tmGen; /* generation number from the TraceMonitor */ #endif diff --git a/js/src/jstracer.cpp b/js/src/jstracer.cpp index 99a555bac62..39cfbccc96e 100644 --- a/js/src/jstracer.cpp +++ b/js/src/jstracer.cpp @@ -6870,7 +6870,7 @@ MonitorLoopEdge(JSContext* cx, uintN& inlineCallCount, RecordReason reason) } /* Do not enter the JIT code with a pending operation callback. */ - if (cx->operationCallbackFlag) { + if (cx->interruptFlags) { #ifdef MOZ_TRACEVIS tvso.r = R_CALLBACK_PENDING; #endif @@ -15472,7 +15472,7 @@ TraceRecorder::record_JSOP_CALLGLOBAL() if (!lazilyImportGlobalSlot(slot)) RETURN_STOP_A("lazy import of global slot failed"); - jsval& v = globalObj->getSlotRef(slot); + Value &v = globalObj->getSlotRef(slot); stack(0, get(&v)); stack(1, INS_NULL()); return ARECORD_CONTINUE; diff --git a/js/src/methodjit/Compiler.cpp b/js/src/methodjit/Compiler.cpp index 9bd3ed78a1a..196f842fb77 100644 --- a/js/src/methodjit/Compiler.cpp +++ b/js/src/methodjit/Compiler.cpp @@ -109,7 +109,7 @@ mjit::Compiler::Compile() jumpMap[i] = Label(); #endif -#ifdef JS_TRACER +#if 0 /* def JS_TRACER */ if (script->tracePoints) { script->trees = (TraceTreeCache*)cx->malloc(script->tracePoints * sizeof(TraceTreeCache)); if (!script->trees) diff --git a/js/src/methodjit/MethodJIT.cpp b/js/src/methodjit/MethodJIT.cpp index 36f314f6e05..ddd220df2e5 100644 --- a/js/src/methodjit/MethodJIT.cpp +++ b/js/src/methodjit/MethodJIT.cpp @@ -642,7 +642,7 @@ mjit::ReleaseScriptCode(JSContext *cx, JSScript *script) cx->free(script->nmap); script->nmap = NULL; } -# ifdef JS_TRACER +# if 0 /* def JS_TRACER */ if (script->trees) { cx->free(script->trees); script->trees = NULL; diff --git a/js/src/methodjit/StubCalls.cpp b/js/src/methodjit/StubCalls.cpp index e679dd2c673..c2054f6f933 100644 --- a/js/src/methodjit/StubCalls.cpp +++ b/js/src/methodjit/StubCalls.cpp @@ -89,16 +89,16 @@ mjit::stubs::BindName(VMFrame &f) PropertyCacheEntry *entry; /* Fast-path should have caught this. See comment in interpreter. */ - JS_ASSERT(f.fp->scopeChain->getParent()); + JS_ASSERT(f.fp->scopeChainObj()->getParent()); JSAtom *atom; JSObject *obj2; JSContext *cx = f.cx; - JSObject *obj = f.fp->scopeChain->getParent(); + JSObject *obj = f.fp->scopeChainObj(); JS_PROPERTY_CACHE(cx).test(cx, f.regs.pc, obj, obj2, entry, atom); if (atom) { jsid id = ATOM_TO_JSID(atom); - obj = js_FindIdentifierBase(cx, f.fp->scopeChain, id); + obj = js_FindIdentifierBase(cx, f.fp->scopeChainObj(), id); if (!obj) THROW(); } @@ -114,7 +114,7 @@ InlineReturn(JSContext *cx) JSStackFrame *fp = cx->fp; JS_ASSERT(!fp->blockChain); - JS_ASSERT(!js_IsActiveWithOrBlock(cx, fp->scopeChain, 0)); + JS_ASSERT(!js_IsActiveWithOrBlock(cx, fp->scopeChainObj(), 0)); if (fp->script->staticLevel < JS_DISPLAY_SIZE) cx->display[fp->script->staticLevel] = fp->displaySave; @@ -489,7 +489,6 @@ mjit::stubs::SetName(VMFrame &f, uint32 index) * slot's value that might contain a method of a * branded scope. */ - TRACE_2(SetPropHit, entry, sprop); obj->lockedSetSlot(slot, rref); /* @@ -554,7 +553,7 @@ NameOp(VMFrame &f, uint32 index) { JSContext *cx = f.cx; JSStackFrame *fp = f.fp; - JSObject *obj = fp->scopeChain; + JSObject *obj = fp->scopeChainObj(); JSScopeProperty *sprop; Value rval; @@ -709,7 +708,7 @@ stubs::GetElem(VMFrame &f) /* Otherwise, fall to getProperty(). */ } } else if (obj->isArguments() -#ifdef JS_TRACER +#if 0 /* def JS_TRACER */ && !GetArgsPrivateNative(obj) #endif ) { @@ -1055,14 +1054,14 @@ InlineCall(VMFrame &f, uint32 flags, void **pret, uint32 argc) /* Initialize the frame. */ newfp->ncode = NULL; newfp->callobj = NULL; - newfp->argsobj = NULL; + newfp->argsval.setNull(); newfp->script = newscript; newfp->fun = fun; newfp->argc = argc; newfp->argv = vp + 2; newfp->rval.setUndefined(); newfp->annotation = NULL; - newfp->scopeChain = funobj->getParent(); + newfp->scopeChain.setNonFunObj(*funobj->getParent()); newfp->flags = flags; newfp->blockChain = NULL; JS_ASSERT(!JSFUN_BOUND_METHOD_TEST(fun->flags)); @@ -1106,7 +1105,7 @@ InlineCall(VMFrame &f, uint32 flags, void **pret, uint32 argc) if (cx->options & JSOPTION_METHODJIT) { if (!newscript->ncode) { - if (mjit::TryCompile(cx, newscript, fun, newfp->scopeChain) == Compile_Error) + if (mjit::TryCompile(cx, newscript, fun, newfp->scopeChainObj()) == Compile_Error) return false; } JS_ASSERT(newscript->ncode); @@ -1145,7 +1144,7 @@ stubs::Call(VMFrame &f, uint32 argc) f.cx->regs->pc = f.fp->script->code; -#ifdef JS_TRACER +#if 0 /* def JS_TRACER */ if (ret && f.cx->jitEnabled && IsTraceableRecursion(f.cx)) { /* Top of script should always have traceId 0. */ f.u.tracer.traceId = 0; @@ -1260,7 +1259,7 @@ stubs::DefFun(VMFrame &f, uint32 index) * FIXME: bug 476950, although debugger users may also demand some kind * of scope link for debugger-assisted eval-in-frame. */ - obj2 = fp->scopeChain; + obj2 = fp->scopeChainObj(); } else { JS_ASSERT(!FUN_FLAT_CLOSURE(fun)); @@ -1269,7 +1268,7 @@ stubs::DefFun(VMFrame &f, uint32 index) * top-level function. */ if (!fp->blockChain) { - obj2 = fp->scopeChain; + obj2 = fp->scopeChainObj(); } else { obj2 = js_GetScopeChain(cx, fp); if (!obj2) @@ -1298,7 +1297,7 @@ stubs::DefFun(VMFrame &f, uint32 index) * fp->scopeChain code below the parent->defineProperty call. */ MUST_FLOW_THROUGH("restore_scope"); - fp->scopeChain = obj; + fp->setScopeChainObj(obj); Value rval; rval.setFunObj(*obj); @@ -1391,7 +1390,7 @@ stubs::DefFun(VMFrame &f, uint32 index) restore_scope: /* Restore fp->scopeChain now that obj is defined in fp->callobj. */ - fp->scopeChain = obj2; + fp->setScopeChainObj(obj2); if (!ok) THROW(); } @@ -1904,7 +1903,7 @@ stubs::DefLocalFun(VMFrame &f, JSFunction *fun) JSObject *obj = FUN_OBJECT(fun); if (FUN_NULL_CLOSURE(fun)) { - obj = CloneFunctionObject(f.cx, fun, f.fp->scopeChain); + obj = CloneFunctionObject(f.cx, fun, f.fp->scopeChainObj()); if (!obj) THROWV(NULL); } else { @@ -1934,7 +1933,7 @@ stubs::RegExp(VMFrame &f, JSObject *regex) * js_GetClassPrototype uses the latter only to locate the global. */ JSObject *proto; - if (!js_GetClassPrototype(f.cx, f.fp->scopeChain, JSProto_RegExp, &proto)) + if (!js_GetClassPrototype(f.cx, f.fp->scopeChainObj(), JSProto_RegExp, &proto)) THROWV(NULL); JS_ASSERT(proto); JSObject *obj = js_CloneRegExpObject(f.cx, regex, proto); @@ -1950,7 +1949,7 @@ stubs::Lambda(VMFrame &f, JSFunction *fun) JSObject *parent; if (FUN_NULL_CLOSURE(fun)) { - parent = f.fp->scopeChain; + parent = f.fp->scopeChainObj(); } else { parent = js_GetScopeChain(f.cx, f.fp); if (!parent) @@ -2035,7 +2034,7 @@ NameIncDec(VMFrame &f, JSAtom *origAtom) JSObject *obj2; JSProperty *prop; PropertyCacheEntry *entry; - JSObject *obj = fp->scopeChain; + JSObject *obj = fp->scopeChainObj(); JS_PROPERTY_CACHE(cx).test(cx, f.regs.pc, obj, obj2, entry, atom); if (!atom) { if (obj == obj2 && entry->vword.isSlot()) { @@ -2612,7 +2611,7 @@ stubs::EnterBlock(VMFrame &f, JSObject *obj) * anything else we should have popped off fp->scopeChain when we left its * static scope. */ - JSObject *obj2 = fp->scopeChain; + JSObject *obj2 = fp->scopeChainObj(); Class *clasp; while ((clasp = obj2->getClass()) == &js_WithClass) obj2 = obj2->getParent(); @@ -2646,7 +2645,7 @@ stubs::LeaveBlock(VMFrame &f) * cloned onto fp->scopeChain, clear its private data, move its locals from * the stack into the clone, and pop it off the chain. */ - JSObject *obj = fp->scopeChain; + JSObject *obj = fp->scopeChainObj(); if (obj->getProto() == fp->blockChain) { JS_ASSERT(obj->getClass() == &js_BlockClass); if (!js_PutBlockObject(cx, JS_TRUE)) diff --git a/js/src/methodjit/nunbox/FastOps.cpp b/js/src/methodjit/nunbox/FastOps.cpp index 203bb5e5542..b69c0dce339 100644 --- a/js/src/methodjit/nunbox/FastOps.cpp +++ b/js/src/methodjit/nunbox/FastOps.cpp @@ -53,7 +53,8 @@ void mjit::Compiler::jsop_bindname(uint32 index) { RegisterID reg = frame.allocReg(); - masm.loadPtr(Address(Assembler::FpReg, offsetof(JSStackFrame, scopeChain)), reg); + Address scopeChain(Assembler::FpReg, offsetof(JSStackFrame, scopeChain)); + masm.loadData32(scopeChain, reg); Address address(reg, offsetof(JSObject, fslots) + JSSLOT_PARENT * sizeof(jsval)); diff --git a/js/src/trace-test/trace-test.py b/js/src/trace-test/trace-test.py index 39a75289875..bfc9c5479a2 100644 --- a/js/src/trace-test/trace-test.py +++ b/js/src/trace-test/trace-test.py @@ -114,7 +114,7 @@ def get_test_cmd(path, lib_dir): if OPTIONS.methodjit_only: jit_flags = [ '-m' ] else: - jit_flags = [ '-m', '-j' ] + jit_flags = [ '-m' ] return [ JS ] + jit_flags + [ '-e', expr, '-f', os.path.join(lib_dir, 'prolog.js'), '-f', path ]