[Webkit-unassigned] [Bug 99801] Web Inspector: [JSC] implement WorkerScriptDebugServer

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Oct 19 03:43:20 PDT 2012


https://bugs.webkit.org/show_bug.cgi?id=99801





--- Comment #5 from Peter Wang <peter.wang at torchmobile.com.cn>  2012-10-19 03:44:15 PST ---
(In reply to comment #2)
> (From update of attachment 169578 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=169578&action=review
> 
> Inspector part of the change looks good to me except a few minor things. I am pretty sure we should be able to treat page and worker debuggers similarly in Source/JavaScriptCore/debugger but I'm not an expert in JSC so you need someone working on JSC to review that part.
> 
> > Source/JavaScriptCore/parser/Parser.h:998
> > +    if (debugger && !debugger->isWorkerDebugger() && !ParsedNode::scopeIsFunction)
> 
> I still don't understand why we should treat parse events differently in case of workers. We need someone familiar with JSC code to look at this part.
> 
Because when Inspector is attached, the JS code is demanded to be recompiled, and JSC send the code to Inspector ("debugger!=null" means Inspector is attached) by these statements of "Parser.h". If we inspecting a normal web page, JS code just recompiled once, and then the "compiled"(not exactly) code is executed, the related statements of "Parser.h" is never be invoked, so  Inspector has only one copy of code. 
But for worker js with timer, there is a problem.

> > Source/WebCore/bindings/js/ScriptDebugServer.cpp:370
> > +        dispatchDidParseSource(*listeners, sourceProvider, isWorkerDebugger() ? false : isContentScript(exec));
> 
> Please make isContentScript a virtual method on ScriptDebugServer and provide appropriate implementations for Page/WorkerScriptDebug instead of introducing isWorkerDebugger.
> 
ok 
> > Source/WebCore/bindings/js/WorkerScriptDebugServer.cpp:58
> > +    // If JavaScript stack is not empty postpone recompilation.
> 
> It seems that we can safely assume the JS stack is empty if recompileAllJSFunctions is invoked by Timer but this is a different issue.
> 
Yes, it's another issue of JSC. So far, we can just use these code as "PageScriptDebugeServer". Actually, the statement 
"if (JSDOMWindow::commonJSGlobalData()->dynamicGlobalObject)" has problem when there are two pages in one process, and being Inspected in same time.

> > Source/WebCore/bindings/js/WorkerScriptDebugServer.cpp:73
> > +    recompileAllJSFunctions(0);
> 
> recompileAllJSFunctionsSoon
sorry, thx.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


More information about the webkit-unassigned mailing list