Bug 934173 - SpiderMonkey: Mark debugMode() checks as JS_UNLIKELY. r=jorendorff

This commit is contained in:
Dan Gohman 2013-11-04 07:57:10 -08:00
Родитель f7353f330f
Коммит 6783e7cd36
2 изменённых файлов: 10 добавлений и 10 удалений

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

@ -1368,7 +1368,7 @@ Interpret(JSContext *cx, RunState &state)
} else {
probes::EnterScript(cx, script, script->function(), activation.entryFrame());
}
if (cx->compartment()->debugMode()) {
if (JS_UNLIKELY(cx->compartment()->debugMode())) {
JSTrapStatus status = ScriptDebugPrologue(cx, activation.entryFrame());
switch (status) {
case JSTRAP_CONTINUE:
@ -1652,7 +1652,7 @@ CASE(JSOP_RETRVAL)
TraceLogging::defaultLogger()->log(TraceLogging::SCRIPT_STOP);
#endif
if (cx->compartment()->debugMode())
if (JS_UNLIKELY(cx->compartment()->debugMode()))
interpReturnOK = ScriptDebugEpilogue(cx, REGS.fp(), interpReturnOK);
if (!REGS.fp()->isYielding())
@ -2561,7 +2561,7 @@ CASE(JSOP_FUNCALL)
if (!REGS.fp()->prologue(cx))
goto error;
if (cx->compartment()->debugMode()) {
if (JS_UNLIKELY(cx->compartment()->debugMode())) {
switch (ScriptDebugPrologue(cx, REGS.fp())) {
case JSTRAP_CONTINUE:
break;
@ -3324,7 +3324,7 @@ DEFAULT()
if (cx->isExceptionPending()) {
/* Call debugger throw hooks. */
if (cx->compartment()->debugMode()) {
if (JS_UNLIKELY(cx->compartment()->debugMode())) {
JSTrapStatus status = DebugExceptionUnwind(cx, REGS.fp(), REGS.pc);
switch (status) {
case JSTRAP_ERROR:
@ -3430,7 +3430,7 @@ DEFAULT()
goto inline_return;
exit:
if (cx->compartment()->debugMode())
if (JS_UNLIKELY(cx->compartment()->debugMode()))
interpReturnOK = ScriptDebugEpilogue(cx, REGS.fp(), interpReturnOK);
if (!REGS.fp()->isYielding())
REGS.fp()->epilogue(cx);

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

@ -123,7 +123,7 @@ StackFrame::copyFrameAndValues(JSContext *cx, Value *vp, StackFrame *otherfp,
HeapValue::writeBarrierPost(*dst, dst);
}
if (cx->compartment()->debugMode())
if (JS_UNLIKELY(cx->compartment()->debugMode()))
DebugScopes::onGeneratorFrameChange(otherfp, this, cx);
}
@ -304,7 +304,7 @@ StackFrame::epilogue(JSContext *cx)
if (isEvalFrame()) {
if (isStrictEvalFrame()) {
JS_ASSERT_IF(hasCallObj(), scopeChain()->as<CallObject>().isForEval());
if (cx->compartment()->debugMode())
if (JS_UNLIKELY(cx->compartment()->debugMode()))
DebugScopes::onPopStrictEvalScope(this);
} else if (isDirectEvalFrame()) {
if (isDebuggerFrame())
@ -340,7 +340,7 @@ StackFrame::epilogue(JSContext *cx)
else
AssertDynamicScopeMatchesStaticScope(cx, script, scopeChain());
if (cx->compartment()->debugMode())
if (JS_UNLIKELY(cx->compartment()->debugMode()))
DebugScopes::onPopCall(this, cx);
if (isConstructing() && thisValue().isObject() && returnValue().isPrimitive())
@ -374,7 +374,7 @@ StackFrame::popBlock(JSContext *cx)
{
JS_ASSERT(hasBlockChain());
if (cx->compartment()->debugMode())
if (JS_UNLIKELY(cx->compartment()->debugMode()))
DebugScopes::onPopBlock(cx, this);
if (blockChain_->needsClone()) {
@ -388,7 +388,7 @@ StackFrame::popBlock(JSContext *cx)
void
StackFrame::popWith(JSContext *cx)
{
if (cx->compartment()->debugMode())
if (JS_UNLIKELY(cx->compartment()->debugMode()))
DebugScopes::onPopWith(this);
JS_ASSERT(scopeChain()->is<WithObject>());