Bug 1132224 - Reword delazification method names and remove stale reference to "debug mode". (r=jimb)

This commit is contained in:
Shu-yu Guo 2015-02-13 16:53:22 -08:00
parent 3a947820fc
commit 401f5f6903
4 changed files with 10 additions and 8 deletions

View File

@ -763,12 +763,12 @@ CreateLazyScriptsForCompartment(JSContext *cx)
}
bool
JSCompartment::ensureDelazifyScriptsForDebugMode(JSContext *cx)
JSCompartment::ensureDelazifyScriptsForDebugger(JSContext *cx)
{
MOZ_ASSERT(cx->compartment() == this);
if ((debugModeBits & DebugNeedDelazification) && !CreateLazyScriptsForCompartment(cx))
if (needsDelazificationForDebugger() && !CreateLazyScriptsForCompartment(cx))
return false;
debugModeBits &= ~DebugNeedDelazification;
debugModeBits &= ~DebugNeedsDelazification;
return true;
}

View File

@ -319,7 +319,7 @@ struct JSCompartment
enum {
DebugMode = 1 << 0,
DebugObservesAllExecution = 1 << 1,
DebugNeedDelazification = 1 << 2
DebugNeedsDelazification = 1 << 2
};
// DebugObservesAllExecution is a submode of DebugMode, and is only valid
@ -470,17 +470,19 @@ struct JSCompartment
debugModeBits &= ~DebugObservesAllExecution;
}
bool needsDelazificationForDebugger() const { return debugModeBits & DebugNeedsDelazification; }
/*
* Schedule the compartment to be delazified. Called from
* LazyScript::Create.
*/
void scheduleDelazificationForDebugMode() { debugModeBits |= DebugNeedDelazification; }
void scheduleDelazificationForDebugger() { debugModeBits |= DebugNeedsDelazification; }
/*
* If we scheduled delazification for turning on debug mode, delazify all
* scripts.
*/
bool ensureDelazifyScriptsForDebugMode(JSContext *cx);
bool ensureDelazifyScriptsForDebugger(JSContext *cx);
void clearBreakpointsIn(js::FreeOp *fop, js::Debugger *dbg, JS::HandleObject handler);

View File

@ -3762,7 +3762,7 @@ LazyScript::CreateRaw(ExclusiveContext *cx, HandleFunction fun,
if (!res)
return nullptr;
cx->compartment()->scheduleDelazificationForDebugMode();
cx->compartment()->scheduleDelazificationForDebugger();
return new (res) LazyScript(fun, table.forget(), packed, begin, end, lineno, column);
}

View File

@ -3341,7 +3341,7 @@ class MOZ_STACK_CLASS Debugger::ScriptQuery
// All scripts in the debuggee compartment must be visible, so
// delazify everything.
AutoCompartment ac(cx, comp);
if (!comp->ensureDelazifyScriptsForDebugMode(cx))
if (!comp->ensureDelazifyScriptsForDebugger(cx))
return false;
}
return compartments.put(comp);