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

Issue 1980193002: Fix capturing variables in optimized compilations (Closed)

Created:
4 years, 7 months ago by hausner
Modified:
4 years, 7 months ago
Reviewers:
regis
CC:
reviews_dartlang.org, vm-dev_dartlang.org
Base URL:
git@github.com:dart-lang/sdk.git@master
Target Ref:
refs/heads/master
Visibility:
Public.

Description

Fix capturing variables in optimized compilations When a local function gets compiled the second time, constant expressions may not be parsed again, since the constant value is found in the cache. If the expression refers to an outer variable, it does not get captured correctly. Fix: instead of parsing a local function repeatedly to capture outer variables, use the local function’s context scope to mark outer variables as captured. This fixes the bug, and makes the compiler more efficient as well. No wall-time improvement found when running dart2js, though. BUG=26453 R=regis@google.com Committed: https://github.com/dart-lang/sdk/commit/3968005cc8cc2509ac8e47fe2e5aa989569e43df

Patch Set 1 #

Total comments: 2

Patch Set 2 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+74 lines, -13 lines) Patch
M runtime/vm/ast.h View 1 1 chunk +4 lines, -3 lines 0 comments Download
M runtime/vm/flow_graph_builder.cc View 1 chunk +1 line, -0 lines 0 comments Download
M runtime/vm/parser.cc View 1 4 chunks +36 lines, -10 lines 0 comments Download
A tests/language/regress_26453_test.dart View 1 chunk +33 lines, -0 lines 0 comments Download

Messages

Total messages: 6 (3 generated)
hausner
4 years, 7 months ago (2016-05-16 22:19:56 UTC) #3
regis
LGTM https://codereview.chromium.org/1980193002/diff/1/runtime/vm/ast.h File runtime/vm/ast.h (right): https://codereview.chromium.org/1980193002/diff/1/runtime/vm/ast.h#newcode543 runtime/vm/ast.h:543: LocalScope* scope) // Null for implicit closures. ...
4 years, 7 months ago (2016-05-16 22:42:15 UTC) #4
hausner
4 years, 7 months ago (2016-05-16 22:53:06 UTC) #6
Message was sent while issue was closed.
Committed patchset #2 (id:20001) manually as
3968005cc8cc2509ac8e47fe2e5aa989569e43df (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698