Re: Implement jsdICompilationUnit

"John J. Barton" <[email protected]> Wed, 02 Dec 2009 08:31:29 -0800
Newsgroups gmane.comp.mozilla.devel.jsdebugger
Message-ID <[email protected]>
Gijs Kruitbosch wrote:
> On 02/12/2009 03:34 AM, Boris Zbarsky wrote:
>> On 12/1/09 6:29 PM, John J Barton wrote:
>>> The implementation is "lightly salted": a few lines need to be added in
>>> a lot of places. Every place JS can be compiled needs a call to the hook
>>> and the hook-setting code needs to propagate up through the jsd layer
>>> cake to the JS interface. Algorithmically the jsengine builds a simple
>>> list of jsdIScripts threaded through JSDScript with the head in
>>> JSDContext. If the compilation hook is taken, the list can be copied out
>>> via enumerateCompiledScripts(), else it is not useful.
>>
>> Hmm... So does this involve firebug js running when the compile happens?
>> I believe right now there are various places (event handlers, xbl, etc)
>> that assume that js compilation will not trigger random script, and in
>> particular won't spin the event loop.
>>
>> -Boris
> 
> I think at least Venkman works around these kinds of issues by making 
> JSD enter a nested event loop. I have no idea if Firebug does the same.
> 
> http://mxr.mozilla.org/mozilla-central/source/js/jsd/idl/jsdIDebuggerService.idl#373 
> 
> 
> ~ Gijs

Firebug does use the nested event loop, when it hits a breakpoint or 
otherwise wants to stop the current control flow and allow user input to 
direct subsequent flow.  Currently Firebug runs a lot of code while js 
compilation is on-going, but I don't know if it every calls for a nested 
event loop.

jjb