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

Issue 8585001: Adapt source position recording and fix ScopeIterator. (Closed)

Created:
9 years, 1 month ago by Steven
Modified:
9 years, 1 month ago
Reviewers:
Lasse Reichstein, Rico
CC:
v8-dev
Visibility:
Public.

Description

Adapt source position recording and fix ScopeIterator. The ScopeIterator uses recorded scope position - as detailed in scopes.h - and source code positions it gets from the program counter to recreate the scope chain. However, the rewriter did not yet record source positions for the assignment it includes. This CL adds source code positions for the assignment added by the rewriter. The ScopeIterator now uses the ScopeType from the ScopeInfo to determine if the code being debugged is eval, function or global code instead of looking up the result symbol. TEST=mjsunit/debug-stepout-scope.js BUG=v8:1824, v8:1826

Patch Set 1 : Only adapt source positions for eval/global code. #

Patch Set 2 : Statement positions for return sequences. #

Total comments: 6
Unified diffs Side-by-side diffs Delta from patch set Stats (+272 lines, -22 lines) Patch
M src/arm/full-codegen-arm.cc View 1 chunk +16 lines, -2 lines 2 comments Download
M src/ast.h View 1 chunk +1 line, -0 lines 0 comments Download
M src/full-codegen.cc View 1 1 chunk +2 lines, -0 lines 0 comments Download
M src/ia32/full-codegen-ia32.cc View 1 1 chunk +17 lines, -1 line 2 comments Download
M src/rewriter.cc View 1 chunk +14 lines, -2 lines 0 comments Download
M src/runtime.cc View 1 3 chunks +15 lines, -14 lines 0 comments Download
M src/scopes.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M src/x64/full-codegen-x64.cc View 1 chunk +15 lines, -1 line 0 comments Download
A test/mjsunit/debug-stepout-scope.js View 1 1 chunk +190 lines, -0 lines 2 comments Download

Messages

Total messages: 4 (0 generated)
Steven
PTAL.
9 years, 1 month ago (2011-11-17 10:05:38 UTC) #1
Steven
I reverted the ScopeIterator to use statement positions and added statement positions for every return ...
9 years, 1 month ago (2011-11-18 12:57:21 UTC) #2
Lasse Reichstein
LGTM. http://codereview.chromium.org/8585001/diff/4001/src/arm/full-codegen-arm.cc File src/arm/full-codegen-arm.cc (right): http://codereview.chromium.org/8585001/diff/4001/src/arm/full-codegen-arm.cc#newcode363 src/arm/full-codegen-arm.cc:363: CodeGenerator::RecordPositions(masm_, function()->end_position() - 1); What if the function ...
9 years, 1 month ago (2011-11-21 10:16:40 UTC) #3
Steven
9 years, 1 month ago (2011-11-24 13:23:31 UTC) #4
I will close this issue but merge the changes into
http://codereview.chromium.org/8590027/ .
Will upload an updated patchset soon.

http://codereview.chromium.org/8585001/diff/4001/src/arm/full-codegen-arm.cc
File src/arm/full-codegen-arm.cc (right):

http://codereview.chromium.org/8585001/diff/4001/src/arm/full-codegen-arm.cc#...
src/arm/full-codegen-arm.cc:363: CodeGenerator::RecordPositions(masm_,
function()->end_position() - 1);
Søren and I came up with a different scheme when debug breaking in the return
sequence. In this case we don't use the source position anymore to learn about
the scopes. We simply return only the function scope but not any of the inner
catch/with/block scopes.

So for the ScopeIterator this hunk is not important anymore. I left it as it was
before and added test cases.
On 2011/11/21 10:16:40, Lasse Reichstein wrote:
> What if the function source doesn't have a closing brace, e.g.,
Function("return
> 42;") ?
> Will this still work?

http://codereview.chromium.org/8585001/diff/4001/src/ia32/full-codegen-ia32.cc
File src/ia32/full-codegen-ia32.cc (right):

http://codereview.chromium.org/8585001/diff/4001/src/ia32/full-codegen-ia32.c...
src/ia32/full-codegen-ia32.cc:367: SetSourcePosition(function()->end_position()
- 1);
This is not important anymore. I added special handling of the return sequence
case to the ScopeIterator.
On 2011/11/21 10:16:40, Lasse Reichstein wrote:
> Can't the final character coincide with another scope close, e.g.,
>   "with (x) y = z; "
> ?

http://codereview.chromium.org/8585001/diff/4001/test/mjsunit/debug-stepout-s...
File test/mjsunit/debug-stepout-scope.js (right):

http://codereview.chromium.org/8585001/diff/4001/test/mjsunit/debug-stepout-s...
test/mjsunit/debug-stepout-scope.js:141: eval("with ({x:1}) x = 1");
On 2011/11/21 10:16:40, Lasse Reichstein wrote:
> Try adding tests with an extra character at the end, e.g., a space. Or a
> semicolon followed by a space.

Done.

Powered by Google App Engine
This is Rietveld 408576698