Bug 933807 - Allow easily disabling TriggerOperationCallbackFor(Ion|AsmJS)Code (r=bhackett)

--HG--
extra : rebase_source : bcf49d894252af53a24aa08a0db25c99dedd26d9
This commit is contained in:
Luke Wagner 2013-11-18 12:56:32 -06:00
parent 55066274a3
commit 16541ad204

View File

@ -591,6 +591,14 @@ JSRuntime::addSizeOfIncludingThis(mozilla::MallocSizeOf mallocSizeOf, JS::Runtim
rtSizes->scriptData += mallocSizeOf(r.front()); rtSizes->scriptData += mallocSizeOf(r.front());
} }
static bool
SignalBasedTriggersDisabled()
{
// Don't bother trying to cache the getenv lookup; this should be called
// infrequently.
return !!getenv("JS_DISABLE_SLOW_SCRIPT_SIGNALS");
}
void void
JSRuntime::triggerOperationCallback(OperationCallbackTrigger trigger) JSRuntime::triggerOperationCallback(OperationCallbackTrigger trigger)
{ {
@ -611,8 +619,10 @@ JSRuntime::triggerOperationCallback(OperationCallbackTrigger trigger)
* asm.js and, optionally, normal Ion code use memory protection and signal * asm.js and, optionally, normal Ion code use memory protection and signal
* handlers to halt running code. * handlers to halt running code.
*/ */
TriggerOperationCallbackForAsmJSCode(this); if (!SignalBasedTriggersDisabled()) {
jit::TriggerOperationCallbackForIonCode(this, trigger); TriggerOperationCallbackForAsmJSCode(this);
jit::TriggerOperationCallbackForIonCode(this, trigger);
}
#endif #endif
} }