Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(355)

Issue 10078014: Enable stepping into callback passed to builtins (e.g. Array.forEach). (Closed)

Created:
8 years, 8 months ago by Yang
Modified:
8 years, 8 months ago
CC:
v8-dev
Visibility:
Public.

Description

Enable stepping into callback passed to builtins (e.g. Array.forEach). BUG=109564 TEST= Committed: https://code.google.com/p/v8/source/detail?r=11399

Patch Set 1 #

Patch Set 2 : . #

Patch Set 3 : Added stepping into String.replace #

Patch Set 4 : #

Patch Set 5 : #

Total comments: 9
Unified diffs Side-by-side diffs Delta from patch set Stats (+402 lines, -49 lines) Patch
M src/array.js View 7 chunks +114 lines, -30 lines 7 comments Download
M src/debug.h View 3 chunks +3 lines, -2 lines 0 comments Download
M src/runtime.h View 1 chunk +2 lines, -0 lines 0 comments Download
M src/runtime.cc View 1 2 1 chunk +30 lines, -0 lines 2 comments Download
M src/string.js View 1 2 3 3 chunks +47 lines, -17 lines 0 comments Download
A test/mjsunit/debug-stepin-builtin-callback.js View 1 2 3 4 1 chunk +206 lines, -0 lines 0 comments Download

Messages

Total messages: 3 (0 generated)
Yang
In order to step into callback functions from within builtin functions such as Array.forEach (those ...
8 years, 8 months ago (2012-04-19 14:09:42 UTC) #1
Søren Gjesse
lgtm with some suggestions I like the way that step in is propagates through the ...
8 years, 8 months ago (2012-04-20 08:33:25 UTC) #2
Yang
8 years, 8 months ago (2012-04-20 11:06:54 UTC) #3
http://codereview.chromium.org/10078014/diff/8001/src/array.js
File src/array.js (right):

http://codereview.chromium.org/10078014/diff/8001/src/array.js#newcode1030
src/array.js:1030: if (%DebugStepIntoBuiltinCallback(f)) {
On 2012/04/20 08:33:25, Søren Gjesse wrote:
> An important thing performance wise is that it should be quite simple to write
> %DebugStepIntoBuiltinCallback as a %_DebugStepIntoBuiltinCallback (inline
> assembly) function if this runtime call gives performance problems.

This would be great, but I have no idea how to check whether the debugger is
active from generated code... I'll implement this as a follow-up CL if you can
give me some hints.

http://codereview.chromium.org/10078014/diff/8001/src/array.js#newcode1030
src/array.js:1030: if (%DebugStepIntoBuiltinCallback(f)) {
On 2012/04/20 08:33:25, Søren Gjesse wrote:
> The only thing I don't like here is the code duplication. I don't have an
> immediate idea, but it would be great if we could get rid of it somehow. It
will
> be prone to errors when changing the code missing one of the places.

I don't see anything simple either. The one way I can think of is to trigger
recompile of builtins for debugging as well, and insert code for
%DebugPrepareStepInIfStepping only when compiling for debugging. But that is a
lot more work and we would need to distinguish between builtins that do callback
and therefore need recompiling, and those that do not.

The way it's currently implemented has little impact on performance. I'll mark
duplicate code pieces with comments.

http://codereview.chromium.org/10078014/diff/8001/src/array.js#newcode1035
src/array.js:1035: %PrepareBreakSlotsForCallback(f);
On 2012/04/20 08:33:25, Søren Gjesse wrote:
> I think the name here i somewhat misleading. Maybe
> "%DebugPrepareStepInIfStepping".

Done.

http://codereview.chromium.org/10078014/diff/8001/src/runtime.cc
File src/runtime.cc (right):

http://codereview.chromium.org/10078014/diff/8001/src/runtime.cc#newcode4712
src/runtime.cc:4712: // Set break slots for the callback function that is passed
to a buil-tin
On 2012/04/20 08:33:25, Søren Gjesse wrote:
> "break slots" -> "one shot breakpoints"

Done.

Powered by Google App Engine
This is Rietveld 408576698