Fix method-JIT debug mode bugs and add more testing capability (bug 598444, r=sstangl).

This commit is contained in:
David Anderson 2010-09-22 14:29:48 -07:00
Родитель 0390be7dbb
Коммит 11ad4b2679
5 изменённых файлов: 16 добавлений и 10 удалений

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

@ -1133,7 +1133,7 @@ js_PutCallObject(JSContext *cx, JSStackFrame *fp)
JS_STATIC_ASSERT(JS_INITIAL_NSLOTS == JSSLOT_PRIVATE + JSObject::CALL_RESERVED_SLOTS + 1);
JSScript *script = fun->u.i.script;
memcpy(callobj.dslots, fp->formalArgs(), nargs * sizeof(Value));
if (!script->jit || script->usesEval) {
if (!script->jit || script->usesEval || script->debugMode) {
memcpy(callobj.dslots + nargs, fp->slots(), nvars * sizeof(Value));
} else if (script->jit) {
for (uint32 i = 0; i < script->jit->nescaping; i++) {

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

@ -1964,7 +1964,6 @@ mjit::Compiler::emitUncachedCall(uint32 argc, bool callingNew)
ADD_CALLSITE(false);
Jump notCompiled = masm.branchTestPtr(Assembler::Zero, r0, r0);
stubcc.linkExitDirect(notCompiled, stubcc.masm.label());
masm.call(r0);
#if (defined(JS_NO_FASTCALL) && defined(JS_CPU_X86)) || defined(_WIN64)
@ -1980,6 +1979,7 @@ mjit::Compiler::emitUncachedCall(uint32 argc, bool callingNew)
frame.takeReg(JSReturnReg_Data);
frame.pushRegs(JSReturnReg_Type, JSReturnReg_Data);
stubcc.linkExitDirect(notCompiled, stubcc.masm.label());
stubcc.rejoin(Changes(0));
}

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

@ -487,16 +487,18 @@ stubs::UncachedNewHelper(VMFrame &f, uint32 argc, UncachedCallResult *ucr)
/* Try to do a fast inline call before the general Invoke path. */
if (IsFunctionObject(*vp, &ucr->fun) && ucr->fun->isInterpreted() &&
!ucr->fun->script()->isEmpty()) {
!ucr->fun->script()->isEmpty())
{
if (!stubs::NewObject(f, argc))
return;
ucr->callee = &vp->toObject();
if (!UncachedInlineCall(f, JSFRAME_CONSTRUCTING, &ucr->codeAddr, argc))
THROW();
return;
} else {
if (!InvokeConstructor(cx, InvokeArgsAlreadyOnTheStack(vp, argc)))
THROW();
}
if (!InvokeConstructor(cx, InvokeArgsAlreadyOnTheStack(vp, argc)))
THROW();
return;
}
void * JS_FASTCALL

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

@ -558,7 +558,7 @@ static int
usage(void)
{
fprintf(gErrFile, "%s\n", JS_GetImplementationVersion());
fprintf(gErrFile, "usage: js [-zKPswWxCij] [-t timeoutSeconds] [-c stackchunksize] [-o option] [-v version] [-f scriptfile] [-e script] [-S maxstacksize] "
fprintf(gErrFile, "usage: js [-zKPswWxCijmd] [-t timeoutSeconds] [-c stackchunksize] [-o option] [-v version] [-f scriptfile] [-e script] [-S maxstacksize] "
#ifdef JS_GC_ZEAL
"[-Z gczeal] "
#endif
@ -836,6 +836,10 @@ ProcessArgs(JSContext *cx, JSObject *obj, char **argv, int argc)
gMaxStackSize = atoi(argv[i]);
break;
case 'd':
js_SetDebugMode(cx, JS_TRUE);
break;
case 'z':
obj = split_setup(cx, JS_FALSE);
if (!obj)

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

@ -257,7 +257,7 @@ def parse_jitflags():
for flags in OPTIONS.jitflags.split(',') ]
for flags in jitflags:
for flag in flags:
if flag not in ('-j', '-m'):
if flag not in ('-j', '-m', '-d'):
print('Invalid jit flag: "%s"'%flag)
sys.exit(1)
return jitflags