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

Issue 348053002: dart2dart: Support for all constants in new backend. (Closed)

Created:
6 years, 6 months ago by asgerf
Modified:
6 years, 6 months ago
CC:
reviews_dartlang.org
Visibility:
Public.

Description

dart2dart: Support for all constants in new backend. Adds support for: - Type literals - By-value reference to top-level or static function - Const constructor invocation inside const literal list or map Nested const expressions are linearized to LetPrims, and we rely on the dart_tree to inline all primitives (since non-const variable references may not occur in a const expression). There are still a bunch of constants that we support but don't actually treat as constants. Reference to top-level constants are still treated as a getter invocations, for instance. We bail out on local constant declarations since they must either be inlined at multiple places or we must generate a constant declaration for them. BUG= R=kmillikin@google.com, sigurdm@google.com Committed: https://code.google.com/p/dart/source/detail?r=37585

Patch Set 1 #

Patch Set 2 : Formatting stuff #

Total comments: 5

Patch Set 3 : Fixed doc comment #

Patch Set 4 : Added reason to giveup calls #

Patch Set 5 : Fixed test case; it did not work in minified mode #

Patch Set 6 : SVN rebase + merge #

Unified diffs Side-by-side diffs Delta from patch set Stats (+212 lines, -219 lines) Patch
M sdk/lib/_internal/compiler/implementation/dart_backend/dart_codegen.dart View 4 chunks +26 lines, -32 lines 0 comments Download
M sdk/lib/_internal/compiler/implementation/dart_backend/dart_tree.dart View 1 2 9 chunks +28 lines, -46 lines 0 comments Download
M sdk/lib/_internal/compiler/implementation/dart_backend/tree_tracer.dart View 3 chunks +2 lines, -13 lines 0 comments Download
M sdk/lib/_internal/compiler/implementation/ir/ir_builder.dart View 1 2 3 4 5 17 chunks +75 lines, -91 lines 0 comments Download
M sdk/lib/_internal/compiler/implementation/ir/ir_nodes.dart View 6 chunks +28 lines, -7 lines 0 comments Download
A + tests/language/const_global_test.dart View 1 chunk +8 lines, -10 lines 0 comments Download
M tests/language/const_list_test.dart View 3 chunks +6 lines, -2 lines 0 comments Download
A + tests/language/const_local_test.dart View 1 chunk +8 lines, -10 lines 0 comments Download
A tests/language/const_map4_test.dart View 1 chunk +23 lines, -0 lines 0 comments Download
A + tests/language/reify_typevar_test.dart View 1 2 3 4 1 chunk +8 lines, -8 lines 0 comments Download

Messages

Total messages: 5 (0 generated)
asgerf
https://codereview.chromium.org/348053002/diff/20001/sdk/lib/_internal/compiler/implementation/ir/ir_builder.dart File sdk/lib/_internal/compiler/implementation/ir/ir_builder.dart (right): https://codereview.chromium.org/348053002/diff/20001/sdk/lib/_internal/compiler/implementation/ir/ir_builder.dart#newcode1242 sdk/lib/_internal/compiler/implementation/ir/ir_builder.dart:1242: } I find myself adding and removing the node ...
6 years, 6 months ago (2014-06-20 15:02:10 UTC) #1
sigurdm
LGTM https://codereview.chromium.org/348053002/diff/20001/sdk/lib/_internal/compiler/implementation/dart_backend/dart_tree.dart File sdk/lib/_internal/compiler/implementation/dart_backend/dart_tree.dart (right): https://codereview.chromium.org/348053002/diff/20001/sdk/lib/_internal/compiler/implementation/dart_backend/dart_tree.dart#newcode139 sdk/lib/_internal/compiler/implementation/dart_backend/dart_tree.dart:139: * Non-const call to a factory or generative ...
6 years, 6 months ago (2014-06-23 07:22:20 UTC) #2
asgerf
https://codereview.chromium.org/348053002/diff/20001/sdk/lib/_internal/compiler/implementation/dart_backend/dart_tree.dart File sdk/lib/_internal/compiler/implementation/dart_backend/dart_tree.dart (right): https://codereview.chromium.org/348053002/diff/20001/sdk/lib/_internal/compiler/implementation/dart_backend/dart_tree.dart#newcode139 sdk/lib/_internal/compiler/implementation/dart_backend/dart_tree.dart:139: * Non-const call to a factory or generative constructor. ...
6 years, 6 months ago (2014-06-23 07:28:27 UTC) #3
Kevin Millikin (Google)
lgtm https://codereview.chromium.org/348053002/diff/20001/sdk/lib/_internal/compiler/implementation/ir/ir_builder.dart File sdk/lib/_internal/compiler/implementation/ir/ir_builder.dart (right): https://codereview.chromium.org/348053002/diff/20001/sdk/lib/_internal/compiler/implementation/ir/ir_builder.dart#newcode1242 sdk/lib/_internal/compiler/implementation/ir/ir_builder.dart:1242: } On 2014/06/23 07:22:20, sigurdm wrote: > On ...
6 years, 6 months ago (2014-06-23 08:03:06 UTC) #4
asgerf
6 years, 6 months ago (2014-06-23 08:46:37 UTC) #5
Message was sent while issue was closed.
Committed patchset #6 manually as r37585 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698