Bug 759289 - Use JM for functions called from a JM IC. r=dvander

This commit is contained in:
Jan de Mooij 2012-06-01 14:39:23 +02:00
Родитель 6c3f5b90c6
Коммит 843382b966
3 изменённых файлов: 25 добавлений и 21 удалений

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

@ -2595,24 +2595,6 @@ BEGIN_CASE(JSOP_FUNCALL)
bool newType = cx->typeInferenceEnabled() && UseNewType(cx, script, regs.pc);
#ifdef JS_METHODJIT
if (!newType && cx->methodJitEnabled) {
/* Try to ensure methods are method JIT'd. */
mjit::CompileStatus status = mjit::CanMethodJIT(cx, script, script->code,
construct,
mjit::CompileRequest_Interpreter);
if (status == mjit::Compile_Error)
goto error;
if (status == mjit::Compile_Okay) {
mjit::JaegerStatus status = mjit::JaegerShot(cx, true);
CHECK_PARTIAL_METHODJIT(status);
interpReturnOK = mjit::JaegerStatusToSuccess(status);
CHECK_INTERRUPT_HANDLER();
goto jit_return;
}
}
#endif
#ifdef JS_ION
if (!newType && ion::IsEnabled(cx)) {
ion::MethodStatus status = ion::CanEnter(cx, script, regs.fp(), newType);
@ -2632,6 +2614,24 @@ BEGIN_CASE(JSOP_FUNCALL)
}
#endif
#ifdef JS_METHODJIT
if (!newType && cx->methodJitEnabled) {
/* Try to ensure methods are method JIT'd. */
mjit::CompileStatus status = mjit::CanMethodJIT(cx, script, script->code,
construct,
mjit::CompileRequest_Interpreter);
if (status == mjit::Compile_Error)
goto error;
if (status == mjit::Compile_Okay) {
mjit::JaegerStatus status = mjit::JaegerShot(cx, true);
CHECK_PARTIAL_METHODJIT(status);
interpReturnOK = mjit::JaegerStatusToSuccess(status);
CHECK_INTERRUPT_HANDLER();
goto jit_return;
}
}
#endif
if (!ScriptPrologue(cx, regs.fp(), newType))
goto error;

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

@ -906,12 +906,16 @@ MakeJITScript(JSContext *cx, JSScript *script)
}
static inline bool
IonGetsFirstChance(JSContext *cx, JSScript *script)
IonGetsFirstChance(JSContext *cx, JSScript *script, CompileRequest request)
{
#ifdef JS_ION
if (!ion::IsEnabled(cx))
return false;
// If we're called from JM, use JM to avoid slow JM -> Ion calls.
if (request == CompileRequest_JIT)
return false;
// If there's no way this script is going to be Ion compiled, let JM take over.
if (!script->canIonCompile())
return false;
@ -933,7 +937,7 @@ mjit::CanMethodJIT(JSContext *cx, JSScript *script, jsbytecode *pc,
if (!cx->methodJitEnabled)
return Compile_Abort;
if (IonGetsFirstChance(cx, script))
if (IonGetsFirstChance(cx, script, request))
return Compile_Skipped;
if (script->hasJITInfo()) {

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

@ -272,7 +272,7 @@ UncachedInlineCall(VMFrame &f, InitialFrameFlags initial,
return false;
/* Try to compile if not already compiled. */
CompileStatus status = CanMethodJIT(cx, newscript, newscript->code, construct, CompileRequest_Interpreter);
CompileStatus status = CanMethodJIT(cx, newscript, newscript->code, construct, CompileRequest_JIT);
if (status == Compile_Error) {
/* A runtime exception was thrown, get out. */
return false;