Debugger instances are never notified via their onNewScript handlers of code compiled using JS::CompileOffThread. This makes it impossible for debuggers to insert breakpoints in such code before it runs. Bug 912321 adds a shell function that makes it possible to test this behavior; bug 912719 includes a test case that shows the bug.

https://bugzilla.mozilla.org/show_bug.cgi?id=912321
https://bugzilla.mozilla.org/show_bug.cgi?id=912719

It's not acceptable to land changes that break Debugger, any more than any other major piece of SpiderMonkey functionality. Just getting through the test suite is not enough, if you know the suite doesn't cover such functionality. As 912321 shows, there is no JS test suite coverage of off-main-thread compilation. And the comment here indicates that the authors (and reviewers!) did know about the problem, but didn't follow up:

void
BytecodeEmitter::tellDebuggerAboutCompiledScript(ExclusiveContext *cx)
{
// Note: when parsing off thread the resulting scripts need to be handed to
    // the debugger after rejoining to the main thread.
    if (!cx->isJSContext())
        return;

Maybe it's just a dropped detail, but it still upsets me. We worked really hard to make Debugger a trustworthy foundation for our tools, and to give it enough test coverage to keep it that way. We've also worked hard on the browser-level tools built on top of that. There's no reason FinishOffThreadScript couldn't have fired the notifications; the patch should have been held up until that was addressed.

Off-main-thread compilation is currently only used for XUL elements, but we have chrome debuggers and add-on debuggers, so this problem is potentially visible. Debugger is not only for content.

If you know that your work will break Debugger, treat that as a blocker. Ask me for help, if you need to, or delegate.

With 912321, we have what we need to cover Debugger + off-main-thread compilation in the tests.
_______________________________________________
dev-tech-js-engine-internals mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-js-engine-internals

Reply via email to