mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-13 21:35:39 +00:00
Bug 935228 - Toggle debug traps only in debug mode. (r=jandem)
This commit is contained in:
parent
42735a9594
commit
27f167ce31
@ -251,6 +251,9 @@ BaselineCompiler::compile()
|
||||
bytecodeMap[script->nTypeSets] = 0;
|
||||
}
|
||||
|
||||
if (script->compartment()->debugMode())
|
||||
baselineScript->setDebugMode();
|
||||
|
||||
return Method_Compiled;
|
||||
}
|
||||
|
||||
|
@ -746,6 +746,10 @@ BaselineScript::toggleDebugTraps(JSScript *script, jsbytecode *pc)
|
||||
{
|
||||
JS_ASSERT(script->baselineScript() == this);
|
||||
|
||||
// Only scripts compiled for debug mode have toggled calls.
|
||||
if (!debugMode())
|
||||
return;
|
||||
|
||||
SrcNoteLineScanner scanner(script->notes(), script->lineno);
|
||||
|
||||
JSRuntime *rt = script->runtimeFromMainThread();
|
||||
|
@ -132,7 +132,11 @@ struct BaselineScript
|
||||
|
||||
// Flag set when the script contains any writes to its on-stack
|
||||
// (rather than call object stored) arguments.
|
||||
MODIFIES_ARGUMENTS = 1 << 2
|
||||
MODIFIES_ARGUMENTS = 1 << 2,
|
||||
|
||||
// Flag set when compiled for use for debug mode. Handles various
|
||||
// Debugger hooks and compiles toggled calls for traps.
|
||||
DEBUG_MODE = 1 << 3
|
||||
};
|
||||
|
||||
private:
|
||||
@ -201,6 +205,13 @@ struct BaselineScript
|
||||
return flags_ & MODIFIES_ARGUMENTS;
|
||||
}
|
||||
|
||||
void setDebugMode() {
|
||||
flags_ |= DEBUG_MODE;
|
||||
}
|
||||
bool debugMode() const {
|
||||
return flags_ & DEBUG_MODE;
|
||||
}
|
||||
|
||||
uint32_t prologueOffset() const {
|
||||
return prologueOffset_;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user