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

Issue 9716004: Properly recognize closures when setting breakpoints (Closed)

Created:
8 years, 9 months ago by hausner
Modified:
8 years, 9 months ago
Reviewers:
regis
CC:
reviews_dartlang.org
Visibility:
Public.

Description

Properly recognize closures when setting breakpoints Local functions and function literals are unknown to the VM until the enclosing function is compiled. This change introduces a list of known closures per class, and a function to look up the innermost closure at a given token index. The debugger now checks whether there are newly discovered closures when a function containing a pending breakpoint is compiled. If necessary, the breakpoint is set to the inner function. Committed: https://code.google.com/p/dart/source/detail?r=5599

Patch Set 1 #

Patch Set 2 : #

Total comments: 8

Patch Set 3 : #

Patch Set 4 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+197 lines, -40 lines) Patch
M runtime/vm/debugger.h View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M runtime/vm/debugger.cc View 1 2 3 2 chunks +33 lines, -12 lines 0 comments Download
M runtime/vm/debugger_api_impl_test.cc View 1 2 2 chunks +68 lines, -0 lines 0 comments Download
M runtime/vm/object.h View 1 2 1 chunk +3 lines, -0 lines 0 comments Download
M runtime/vm/object.cc View 1 2 4 chunks +64 lines, -20 lines 0 comments Download
M runtime/vm/parser.cc View 1 2 3 chunks +27 lines, -8 lines 0 comments Download
M runtime/vm/raw_object.h View 1 2 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 3 (0 generated)
hausner
8 years, 9 months ago (2012-03-16 21:15:53 UTC) #1
regis
LGTM with comments. http://codereview.chromium.org/9716004/diff/5001/runtime/vm/debugger.cc File runtime/vm/debugger.cc (right): http://codereview.chromium.org/9716004/diff/5001/runtime/vm/debugger.cc#newcode944 runtime/vm/debugger.cc:944: if (func.IsImplicitClosureFunction()) { I do not ...
8 years, 9 months ago (2012-03-16 22:04:01 UTC) #2
hausner
8 years, 9 months ago (2012-03-16 22:20:58 UTC) #3
Thank you.

http://codereview.chromium.org/9716004/diff/5001/runtime/vm/debugger.cc
File runtime/vm/debugger.cc (right):

http://codereview.chromium.org/9716004/diff/5001/runtime/vm/debugger.cc#newco...
runtime/vm/debugger.cc:944: if (func.IsImplicitClosureFunction()) {
On 2012/03/16 22:04:01, regis wrote:
> I do not understand why you changed this test. The comment below applies to
all
> closures, not just implicit ones.
Updated the comment.

http://codereview.chromium.org/9716004/diff/5001/runtime/vm/debugger.cc#newco...
runtime/vm/debugger.cc:948: lookup_function = func.parent_function();
On 2012/03/16 22:04:01, regis wrote:
> ASSERT(!lookup_function.IsNull());?

Done.

http://codereview.chromium.org/9716004/diff/5001/runtime/vm/debugger.cc#newco...
runtime/vm/debugger.cc:953: // Check if the breakpoint is inside a closure or
local function
On 2012/03/16 22:04:01, regis wrote:
> Indentation

Done.

http://codereview.chromium.org/9716004/diff/5001/runtime/vm/parser.cc
File runtime/vm/parser.cc (left):

http://codereview.chromium.org/9716004/diff/5001/runtime/vm/parser.cc#oldcode...
runtime/vm/parser.cc:3977: ASSERT(current_class().is_finalized());
On 2012/03/16 22:04:01, regis wrote:
> I would not remove this assert, but just change the comment:
> 
> Local functions are registered in the enclosing class, but ignored during
class
> finalization. The enclosing class has already been finalized.	
>  3977   ASSERT(current_class().is_finalized());

Done.

Powered by Google App Engine
This is Rietveld 408576698