Bug 1137050 - Don't SetThreadContext if the context didn't change. r=luke, a=me

This commit is contained in:
David Major 2015-02-26 20:37:00 -05:00
parent fc8fe2bd7c
commit 67c2070e73

View File

@ -1165,7 +1165,7 @@ RedirectIonBackedgesToInterruptCheck(JSRuntime *rt)
}
}
static void
static bool
RedirectJitCodeToInterruptCheck(JSRuntime *rt, CONTEXT *context)
{
RedirectIonBackedgesToInterruptCheck(rt);
@ -1183,8 +1183,11 @@ RedirectJitCodeToInterruptCheck(JSRuntime *rt, CONTEXT *context)
if (module.containsFunctionPC(pc)) {
activation->setResumePC(pc);
*ppc = module.interruptExit();
return true;
}
}
return false;
}
#if !defined(XP_WIN)
@ -1322,8 +1325,8 @@ js::InterruptRunningJitCode(JSRuntime *rt)
CONTEXT context;
context.ContextFlags = CONTEXT_CONTROL;
if (GetThreadContext(thread, &context)) {
RedirectJitCodeToInterruptCheck(rt, &context);
SetThreadContext(thread, &context);
if (RedirectJitCodeToInterruptCheck(rt, &context))
SetThreadContext(thread, &context);
}
ResumeThread(thread);
}