mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-26 19:55:39 +00:00
Bug 1266434 - Make Debugger::findScripts delazify scipts in a separate phase now this can GC r=jimb a=abuillings
This commit is contained in:
parent
e1c63550ed
commit
4f9ed10d72
8
js/src/jit-test/tests/debug/bug1266434.js
Normal file
8
js/src/jit-test/tests/debug/bug1266434.js
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
var g = newGlobal();
|
||||||
|
var dbg = new Debugger(g);
|
||||||
|
var g = newGlobal();
|
||||||
|
g.evaluate("function f(x) { return x + 1; }");
|
||||||
|
var gw = dbg.addDebuggee(g);
|
||||||
|
gczeal(2, 1);
|
||||||
|
var s = dbg.findScripts();
|
||||||
|
gczeal(0);
|
@ -3973,7 +3973,7 @@ class MOZ_STACK_CLASS Debugger::ScriptQuery
|
|||||||
* this query, and append the matching scripts to |vector|.
|
* this query, and append the matching scripts to |vector|.
|
||||||
*/
|
*/
|
||||||
bool findScripts() {
|
bool findScripts() {
|
||||||
if (!prepareQuery())
|
if (!prepareQuery() || !delazifyScripts())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
JSCompartment* singletonComp = nullptr;
|
JSCompartment* singletonComp = nullptr;
|
||||||
@ -4099,13 +4099,6 @@ class MOZ_STACK_CLASS Debugger::ScriptQuery
|
|||||||
bool oom;
|
bool oom;
|
||||||
|
|
||||||
bool addCompartment(JSCompartment* comp) {
|
bool addCompartment(JSCompartment* comp) {
|
||||||
{
|
|
||||||
// All scripts in the debuggee compartment must be visible, so
|
|
||||||
// delazify everything.
|
|
||||||
AutoCompartment ac(cx, comp);
|
|
||||||
if (!comp->ensureDelazifyScriptsForDebugger(cx))
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return compartments.put(comp);
|
return compartments.put(comp);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4150,6 +4143,18 @@ class MOZ_STACK_CLASS Debugger::ScriptQuery
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool delazifyScripts() {
|
||||||
|
// All scripts in debuggee compartments must be visible, so delazify
|
||||||
|
// everything.
|
||||||
|
for (auto r = compartments.all(); !r.empty(); r.popFront()) {
|
||||||
|
JSCompartment* comp = r.front();
|
||||||
|
AutoCompartment ac(cx, comp);
|
||||||
|
if (!comp->ensureDelazifyScriptsForDebugger(cx))
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
static void considerScript(JSRuntime* rt, void* data, JSScript* script) {
|
static void considerScript(JSRuntime* rt, void* data, JSScript* script) {
|
||||||
ScriptQuery* self = static_cast<ScriptQuery*>(data);
|
ScriptQuery* self = static_cast<ScriptQuery*>(data);
|
||||||
self->consider(script);
|
self->consider(script);
|
||||||
|
Loading…
Reference in New Issue
Block a user