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

Issue 2767773004: Add Vector type to Kernel (Closed)

Created:
3 years, 9 months ago by Dmitry Stefantsov
Modified:
3 years, 8 months ago
CC:
reviews_dartlang.org, asgerf, karlklose
Target Ref:
refs/heads/master
Visibility:
Public.

Description

Add Vector type to Kernel There are four operations that work on Vectors: Vector creation, looking up an item in a Vector, assigning a value to an item in a Vector, and copying a Vector. The first three operations are allowed to only use integer literals as number operands (length for Vector creation, index for item lookup and assignment). Corresponding AST nodes are created for these operations. Vectors are used to represent contexts in Closure Conversion. The parent context is stored as item 0 in its children contexts. The "golden" tests for this transformation are adjusted accordingly. The support for Vectors is added to ast-to-text, ast-to-binary, and binary-to-ast transformations. R=asgerf@google.com, kmillikin@google.com Committed: https://github.com/dart-lang/sdk/commit/9ab86da19cc8e3e55266066bcebf09f6bbc5f612

Patch Set 1 #

Patch Set 2 : Changes in TODO comments #

Patch Set 3 : Add support for nested contexts via Vectors #

Patch Set 4 : Add CopyVector primitive and use it for context copying #

Patch Set 5 : Add a note to return Run step in Closure Conversion test suite #

Total comments: 8

Patch Set 6 : Make fixes suggested by the reviewers #

Total comments: 26

Patch Set 7 : More fixes suggested by the reviewers #

Patch Set 8 : Update binary.md file to include Vector AST nodes #

Total comments: 4

Patch Set 9 : Reformat comment with Markdown, throw exception in type propagation #

Unified diffs Side-by-side diffs Delta from patch set Stats (+596 lines, -284 lines) Patch
M pkg/kernel/binary.md View 1 2 3 4 5 6 7 2 chunks +27 lines, -0 lines 0 comments Download
M pkg/kernel/lib/ast.dart View 1 2 3 4 5 6 7 8 2 chunks +143 lines, -0 lines 0 comments Download
M pkg/kernel/lib/binary/ast_from_binary.dart View 1 2 3 4 5 2 chunks +17 lines, -0 lines 0 comments Download
M pkg/kernel/lib/binary/ast_to_binary.dart View 1 2 3 4 5 2 chunks +27 lines, -0 lines 0 comments Download
M pkg/kernel/lib/binary/tag.dart View 1 2 3 4 5 6 2 chunks +6 lines, -0 lines 0 comments Download
M pkg/kernel/lib/frontend/accessors.dart View 1 2 3 4 5 6 7 8 1 chunk +2 lines, -0 lines 0 comments Download
M pkg/kernel/lib/text/ast_to_text.dart View 1 2 3 4 5 2 chunks +34 lines, -0 lines 0 comments Download
M pkg/kernel/lib/transformations/closure/context.dart View 1 2 3 4 5 6 7 8 6 chunks +47 lines, -40 lines 0 comments Download
M pkg/kernel/lib/transformations/closure/converter.dart View 1 2 3 4 5 6 7 8 4 chunks +7 lines, -6 lines 0 comments Download
M pkg/kernel/lib/transformations/closure/mock.dart View 1 2 3 4 5 6 7 8 1 chunk +1 line, -0 lines 0 comments Download
M pkg/kernel/lib/transformations/closure/rewriter.dart View 1 2 3 4 5 4 chunks +25 lines, -32 lines 0 comments Download
M pkg/kernel/lib/transformations/treeshaker.dart View 1 2 3 4 5 6 1 chunk +2 lines, -0 lines 0 comments Download
M pkg/kernel/lib/type_algebra.dart View 1 2 3 4 5 6 3 chunks +3 lines, -0 lines 0 comments Download
M pkg/kernel/lib/type_checker.dart View 1 2 3 4 5 6 1 chunk +41 lines, -0 lines 0 comments Download
M pkg/kernel/lib/type_propagation/builder.dart View 1 2 3 4 5 6 7 8 2 chunks +7 lines, -0 lines 0 comments Download
M pkg/kernel/lib/visitor.dart View 1 2 3 5 chunks +15 lines, -0 lines 0 comments Download
M pkg/kernel/test/closures/suite.dart View 1 2 3 4 5 2 chunks +5 lines, -2 lines 0 comments Download
M pkg/kernel/testcases/closures/capture_closure.dart.expect View 1 2 1 chunk +9 lines, -10 lines 0 comments Download
M pkg/kernel/testcases/closures/capture_closure_parameter.dart.expect View 1 2 1 chunk +10 lines, -11 lines 0 comments Download
M pkg/kernel/testcases/closures/capture_this.dart.expect View 1 2 2 chunks +15 lines, -16 lines 0 comments Download
M pkg/kernel/testcases/closures/catch.dart.expect View 1 2 2 chunks +9 lines, -10 lines 0 comments Download
M pkg/kernel/testcases/closures/closure_in_constructor.dart.expect View 1 2 1 chunk +11 lines, -12 lines 0 comments Download
M pkg/kernel/testcases/closures/closure_in_initializer.dart.expect View 1 2 1 chunk +10 lines, -11 lines 0 comments Download
M pkg/kernel/testcases/closures/closure_in_initializer_closure.dart.expect View 1 2 1 chunk +17 lines, -18 lines 0 comments Download
M pkg/kernel/testcases/closures/closures.dart.expect View 1 2 2 chunks +6 lines, -7 lines 0 comments Download
M pkg/kernel/testcases/closures/field.dart.expect View 2 chunks +12 lines, -13 lines 0 comments Download
M pkg/kernel/testcases/closures/for_in_closure.dart.expect View 1 2 1 chunk +6 lines, -7 lines 0 comments Download
M pkg/kernel/testcases/closures/for_loop.dart.expect View 1 2 3 4 5 1 chunk +15 lines, -16 lines 0 comments Download
M pkg/kernel/testcases/closures/for_variable_capture_test.dart.expect View 1 2 3 4 5 1 chunk +8 lines, -9 lines 0 comments Download
M pkg/kernel/testcases/closures/instance_tear_off.dart.expect View 5 chunks +18 lines, -19 lines 0 comments Download
M pkg/kernel/testcases/closures/named_closure.dart.expect View 1 2 2 chunks +6 lines, -7 lines 0 comments Download
M pkg/kernel/testcases/closures/non_void_context.dart.expect View 1 2 1 chunk +14 lines, -15 lines 0 comments Download
M pkg/kernel/testcases/closures/type_variables.dart.expect View 1 2 2 chunks +15 lines, -16 lines 0 comments Download
M pkg/kernel/testcases/closures/uncaptured_for_in_loop.dart.expect View 1 2 1 chunk +6 lines, -7 lines 0 comments Download

Messages

Total messages: 18 (7 generated)
Dmitry Stefantsov
3 years, 9 months ago (2017-03-22 14:21:49 UTC) #4
asgerf
Very nice. At the places where only IntLiterals are allowed, why not just store an ...
3 years, 9 months ago (2017-03-22 14:33:22 UTC) #7
karlklose
https://codereview.chromium.org/2767773004/diff/80001/pkg/kernel/test/closures/suite.dart File pkg/kernel/test/closures/suite.dart (right): https://codereview.chromium.org/2767773004/diff/80001/pkg/kernel/test/closures/suite.dart#newcode67 pkg/kernel/test/closures/suite.dart:67: // TODO(dmitryas): uncomment this when Vectors are added to ...
3 years, 9 months ago (2017-03-22 14:34:19 UTC) #9
Dmitry Stefantsov
PTAL https://codereview.chromium.org/2767773004/diff/80001/pkg/kernel/lib/ast.dart File pkg/kernel/lib/ast.dart (right): https://codereview.chromium.org/2767773004/diff/80001/pkg/kernel/lib/ast.dart#newcode2755 pkg/kernel/lib/ast.dart:2755: final IntLiteral length; On 2017/03/22 14:33:22, asgerf wrote: ...
3 years, 9 months ago (2017-03-23 11:22:43 UTC) #10
asgerf
Another round of comments https://codereview.chromium.org/2767773004/diff/100001/pkg/kernel/lib/ast.dart File pkg/kernel/lib/ast.dart (right): https://codereview.chromium.org/2767773004/diff/100001/pkg/kernel/lib/ast.dart#newcode2753 pkg/kernel/lib/ast.dart:2753: /// Expression of the form ...
3 years, 9 months ago (2017-03-23 11:53:51 UTC) #11
Kevin Millikin (Google)
LGTM. https://codereview.chromium.org/2767773004/diff/100001/pkg/kernel/lib/ast.dart File pkg/kernel/lib/ast.dart (right): https://codereview.chromium.org/2767773004/diff/100001/pkg/kernel/lib/ast.dart#newcode2753 pkg/kernel/lib/ast.dart:2753: /// Expression of the form `MakeVector(N)` where `N` ...
3 years, 9 months ago (2017-03-23 12:01:04 UTC) #12
Kevin Millikin (Google)
But please also update binary.md.
3 years, 9 months ago (2017-03-23 12:01:50 UTC) #13
Dmitry Stefantsov
PTAL Asger, can you please check if I made the right changes in "type_checker.dart", "type_algebra.dart", ...
3 years, 8 months ago (2017-03-27 10:57:09 UTC) #14
asgerf
LGTM https://codereview.chromium.org/2767773004/diff/140001/pkg/kernel/lib/ast.dart File pkg/kernel/lib/ast.dart (right): https://codereview.chromium.org/2767773004/diff/140001/pkg/kernel/lib/ast.dart#newcode3792 pkg/kernel/lib/ast.dart:3792: /// contexts. Great! Please use markdown syntax, though. ...
3 years, 8 months ago (2017-03-27 11:15:39 UTC) #15
Dmitry Stefantsov
https://codereview.chromium.org/2767773004/diff/140001/pkg/kernel/lib/ast.dart File pkg/kernel/lib/ast.dart (right): https://codereview.chromium.org/2767773004/diff/140001/pkg/kernel/lib/ast.dart#newcode3792 pkg/kernel/lib/ast.dart:3792: /// contexts. On 2017/03/27 11:15:39, asgerf wrote: > Great! ...
3 years, 8 months ago (2017-03-27 12:17:24 UTC) #16
Dmitry Stefantsov
3 years, 8 months ago (2017-03-27 13:52:49 UTC) #18
Message was sent while issue was closed.
Committed patchset #9 (id:160001) manually as
9ab86da19cc8e3e55266066bcebf09f6bbc5f612 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698