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

Issue 7230045: Support debugger inspection of locals in optimized frames (Closed)

Created:
9 years, 5 months ago by Søren Thygesen Gjesse
Modified:
9 years, 5 months ago
Reviewers:
fschneider
CC:
v8-dev
Visibility:
Public.

Description

Support debugger inspection of locals in optimized frames Optimized frames are now handled by the debugger. When discovering optimized frames during stack inspection in the debugger they are "deoptimized" using the normal deoptimization code and the deoptimizer output information is used to provide frame information to the debugger. Before this change the debugger reported each optimized frame as one frame no matter the number of inlined functuions that might have been called inside of it. Also all locals where reported as undefined. Locals can still be reposted as undefined when their value is not "known" by the optimized frame. As the structures used to calculate the output frames when deoptimizing are not GC safe the information for the debugger is copied to another structure (DeoptimizedFrameInfo) which is registered with the global deoptimizer data and processed during GC. R=fschneider@chromium.org BUG=v8:1140 TEST=test/mjsunit/debug-evaluate-locals-optimized* Committed: http://code.google.com/p/v8/source/detail?r=8464

Patch Set 1 #

Patch Set 2 : Fixed missing scope info bug for inlined functions #

Patch Set 3 : Removed test code #

Total comments: 18

Patch Set 4 : Addressed review comments #

Patch Set 5 : Rebase #

Unified diffs Side-by-side diffs Delta from patch set Stats (+754 lines, -50 lines) Patch
M src/arm/deoptimizer-arm.cc View 1 2 3 4 chunks +28 lines, -2 lines 0 comments Download
M src/compiler.cc View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M src/deoptimizer.h View 1 2 3 11 chunks +85 lines, -3 lines 0 comments Download
M src/deoptimizer.cc View 1 2 3 10 chunks +179 lines, -3 lines 0 comments Download
M src/frames.h View 5 chunks +8 lines, -0 lines 0 comments Download
M src/frames.cc View 3 chunks +37 lines, -0 lines 0 comments Download
src/heap.cc View 1 2 3 4 2 chunks +4 lines, -0 lines 0 comments Download
M src/hydrogen.cc View 1 2 chunks +8 lines, -0 lines 0 comments Download
M src/ia32/deoptimizer-ia32.cc View 1 2 3 4 chunks +28 lines, -1 line 0 comments Download
M src/mirror-debugger.js View 4 chunks +32 lines, -3 lines 0 comments Download
M src/objects.cc View 1 chunk +3 lines, -0 lines 0 comments Download
M src/runtime.cc View 1 2 3 4 9 chunks +63 lines, -37 lines 0 comments Download
M src/x64/deoptimizer-x64.cc View 1 2 3 4 chunks +27 lines, -1 line 0 comments Download
A test/mjsunit/debug-evaluate-locals-optimized.js View 1 chunk +119 lines, -0 lines 0 comments Download
A test/mjsunit/debug-evaluate-locals-optimized-double.js View 1 2 3 1 chunk +132 lines, -0 lines 0 comments Download

Messages

Total messages: 4 (0 generated)
Søren Thygesen Gjesse
9 years, 5 months ago (2011-06-28 14:02:25 UTC) #1
Søren Thygesen Gjesse
Uploaded additional fix for setting the scope info for lazily compiled inlined functions. Activated the ...
9 years, 5 months ago (2011-06-29 08:53:30 UTC) #2
fschneider
LGTM with comments. http://codereview.chromium.org/7230045/diff/8002/src/arm/deoptimizer-arm.cc File src/arm/deoptimizer-arm.cc (right): http://codereview.chromium.org/7230045/diff/8002/src/arm/deoptimizer-arm.cc#newcode549 src/arm/deoptimizer-arm.cc:549: input_->SetDoubleRegister(i, -1.0 * i); Why not ...
9 years, 5 months ago (2011-06-29 10:47:35 UTC) #3
Søren Thygesen Gjesse
9 years, 5 months ago (2011-06-29 12:42:10 UTC) #4
http://codereview.chromium.org/7230045/diff/8002/src/arm/deoptimizer-arm.cc
File src/arm/deoptimizer-arm.cc (right):

http://codereview.chromium.org/7230045/diff/8002/src/arm/deoptimizer-arm.cc#n...
src/arm/deoptimizer-arm.cc:549: input_->SetDoubleRegister(i, -1.0 * i);
On 2011/06/29 10:47:35, fschneider wrote:
> Why not just set it to 0.0 or some other constant default instead?

It was for debugging to see if these values turned up somewhere. Changed to 0.0.

http://codereview.chromium.org/7230045/diff/8002/src/deoptimizer.cc
File src/deoptimizer.cc (right):

http://codereview.chromium.org/7230045/diff/8002/src/deoptimizer.cc#newcode169
src/deoptimizer.cc:169: 
On 2011/06/29 10:47:35, fschneider wrote:
> Maybe put the GC-unsafe part inside an AssertNoAllocation-scope?

The already happens due to the Deoptimizer constructor turns off allocation and
Deoptimizer::DeleteFrameDescriptions() turns it back on (deoptimizer.cc:358).

http://codereview.chromium.org/7230045/diff/8002/src/deoptimizer.cc#newcode173
src/deoptimizer.cc:173: 
On 2011/06/29 10:47:35, fschneider wrote:
> Don't you have to de-allocate the deoptimizer? Or can it be stack-allocated
> instead of new-allocated?

Good catch! Of cause.

http://codereview.chromium.org/7230045/diff/8002/src/deoptimizer.cc#newcode551
src/deoptimizer.cc:551: // Check of the heap number to materialize actually
belongd to the frame
On 2011/06/29 10:47:35, fschneider wrote:
> Check that the heap number to materialize actually belongs...

Done.

http://codereview.chromium.org/7230045/diff/8002/src/deoptimizer.cc#newcode564
src/deoptimizer.cc:564: PrintF("Materializing a new heap number %p [%e] in index
%d\n",
On 2011/06/29 10:47:35, fschneider wrote:
> Remove duplicate PrintF, maybe add the expression index to the PrintF above?

Done.

http://codereview.chromium.org/7230045/diff/8002/src/deoptimizer.h
File src/deoptimizer.h (right):

http://codereview.chromium.org/7230045/diff/8002/src/deoptimizer.h#newcode195
src/deoptimizer.h:195: void MaterializeHeapNumbersForDebuggerInspectableFrame(
On 2011/06/29 10:47:35, fschneider wrote:
> Maybe add 
> 
> #ifdef ENABLE_DEBUGGER_SUPPORT
> 
> here too.

Done.

http://codereview.chromium.org/7230045/diff/8002/src/ia32/deoptimizer-ia32.cc
File src/ia32/deoptimizer-ia32.cc (right):

http://codereview.chromium.org/7230045/diff/8002/src/ia32/deoptimizer-ia32.cc...
src/ia32/deoptimizer-ia32.cc:615: input_->SetRegister(i, i * 4);
On 2011/06/29 10:47:35, fschneider wrote:
> Maybe use some constant as default value?

Done.

http://codereview.chromium.org/7230045/diff/8002/test/mjsunit/debug-evaluate-...
File test/mjsunit/debug-evaluate-locals-optimized-double.js (right):

http://codereview.chromium.org/7230045/diff/8002/test/mjsunit/debug-evaluate-...
test/mjsunit/debug-evaluate-locals-optimized-double.js:48: assertEquals(i * 2 +
1 + (i * 2 + 1) / 100, frame.localValue(0).value());
On 2011/06/29 10:47:35, fschneider wrote:
> Long line.

Done.

http://codereview.chromium.org/7230045/diff/8002/test/mjsunit/debug-evaluate-...
test/mjsunit/debug-evaluate-locals-optimized-double.js:49: assertEquals(i * 2 +
2 + (i * 2 + 2) / 100, frame.localValue(1).value());
On 2011/06/29 10:47:35, fschneider wrote:
> Long line.

Done.

Powered by Google App Engine
This is Rietveld 408576698