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

Issue 1024563004: Compile implicit closures as dispatchers instead of duplicating the original method's code. (Closed)

Created:
5 years, 9 months ago by Florian Schneider
Modified:
5 years, 9 months ago
Reviewers:
hausner
CC:
reviews_dartlang.org, vm-dev_dartlang.org
Visibility:
Public.

Description

Compile implicit closures as dispatchers instead of duplicating the original method's code. This saves space in unoptimized code for implicit closures. In optimized code the original method's code will often be inlined into the implicit closure dispatcher so that there won't be a performance impact. The static case just calls the original method. For implicit instance closures, the this-parameter is loaded from the context and passed to the original method. The coverage test is affected since the dispatcher has the original method's token position associated with it. This means that the line with the method declaration is considered to have executable code. Setting the token position to 0 (Scanner::kNoSourcePos) does not work because it coincides with the first line (and first token) in the script. R=hausner@google.com Committed: https://code.google.com/p/dart/source/detail?r=44655

Patch Set 1 #

Total comments: 5

Patch Set 2 : #

Patch Set 3 : rebased #

Unified diffs Side-by-side diffs Delta from patch set Stats (+70 lines, -3 lines) Patch
M runtime/vm/object.cc View 1 2 1 chunk +5 lines, -0 lines 0 comments Download
M runtime/vm/parser.h View 1 2 1 chunk +2 lines, -0 lines 0 comments Download
M runtime/vm/parser.cc View 1 2 2 chunks +61 lines, -1 line 0 comments Download
M tests/standalone/full_coverage_test.dart View 1 2 2 chunks +2 lines, -2 lines 0 comments Download

Messages

Total messages: 5 (1 generated)
Florian Schneider
https://codereview.chromium.org/1024563004/diff/1/runtime/vm/parser.cc File runtime/vm/parser.cc (right): https://codereview.chromium.org/1024563004/diff/1/runtime/vm/parser.cc#newcode1317 runtime/vm/parser.cc:1317: intptr_t token_pos = func.token_pos(); 0 (Scanner::kNoSourcePos) does not work ...
5 years, 9 months ago (2015-03-23 13:45:38 UTC) #2
hausner
LGTM. I hope there are no side effects for the debugger. I would not meddle ...
5 years, 9 months ago (2015-03-23 17:44:48 UTC) #3
Florian Schneider
https://codereview.chromium.org/1024563004/diff/1/runtime/vm/object.cc File runtime/vm/object.cc (right): https://codereview.chromium.org/1024563004/diff/1/runtime/vm/object.cc#newcode6270 runtime/vm/object.cc:6270: closure_function.set_is_debuggable(false); On 2015/03/23 17:44:48, hausner wrote: > Maybe add ...
5 years, 9 months ago (2015-03-24 09:19:38 UTC) #4
Florian Schneider
5 years, 9 months ago (2015-03-24 09:33:43 UTC) #5
Message was sent while issue was closed.
Committed patchset #3 (id:40001) manually as r44655 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698