I think we need to revise this. I agree that stopping inside builtin
code might be confusing, but when just forcing execution to stop you
might expect something like that - I can also get confused when forcing
a break in my C++ code too.

I actually pulled out this check in this previous changelist
http://codereview.chromium.org/115262, for two reasons:

* Running "system" JavaScript with the debug break flag active leads to
slow running code while waiting for the break in non "system" JavaScript
(one exception to this it is to try to avoid breaks in the clear mirror
cache JavaScript code called when leaving the debugger).

* If this happens while processing RegExp running in native code an
infinite loop is created as the stack guard handler for RegExp does not
move execution forward

The removal of the stack guard check in the RegExp code avoids the
infinite loop, but as far as I can see it also removes preemption while
running RegExp code which is not desirable. RegExp can run for ever and
not having preemption there breaks the whole preemption idea.

The slow execution with the debug break flag active might not be a big
deal, but it might hit us at some point. An alternative might be to try
to avoid a break inside "system" JavaScript for some time (e.g. one
second) and then breaking in the system code anyway and maybe annotating
the break event with information that is is in system code so that the
front end can display some additional information on why we have stopped
in non user code.

Regarding RegExp I think that a forced break during a long running
RegExp is useful (and of cause preemption is required) so the stack
guard handling should be re-inserted into the RegExp code. Maybe an
extra check in Execution::DebugBreakHelper can check for RegExp running
and breaking immediately even if the code is considered system code.

http://codereview.chromium.org/160001

--~--~---------~--~----~------------~-------~--~----~
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
-~----------~----~----~----~------~----~------~--~---

Reply via email to