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

Issue 2857373002: Handle more constants in Constantifier (Closed)

Created:
3 years, 7 months ago by Johnni Winther
Modified:
3 years, 7 months ago
CC:
reviews_dartlang.org
Target Ref:
refs/heads/master
Visibility:
Public.

Description

Patch Set 1 #

Total comments: 7

Patch Set 2 : Updated cf. comments. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+243 lines, -64 lines) Patch
M pkg/compiler/lib/src/compile_time_constants.dart View 1 chunk +1 line, -1 line 0 comments Download
M pkg/compiler/lib/src/compiler.dart View 1 chunk +1 line, -1 line 0 comments Download
M pkg/compiler/lib/src/constants/constructors.dart View 5 chunks +9 lines, -9 lines 0 comments Download
M pkg/compiler/lib/src/constants/evaluation.dart View 1 chunk +1 line, -1 line 0 comments Download
M pkg/compiler/lib/src/constants/expressions.dart View 30 chunks +30 lines, -30 lines 0 comments Download
M pkg/compiler/lib/src/kernel/element_adapter.dart View 1 4 chunks +166 lines, -2 lines 0 comments Download
M pkg/compiler/lib/src/kernel/element_map.dart View 5 chunks +11 lines, -14 lines 0 comments Download
M pkg/compiler/lib/src/kernel/kernel_strategy.dart View 1 chunk +3 lines, -2 lines 0 comments Download
M pkg/compiler/lib/src/use_unused_api.dart View 1 chunk +1 line, -1 line 0 comments Download
M tests/compiler/dart2js/constant_expression_evaluate_test.dart View 2 chunks +2 lines, -2 lines 0 comments Download
M tests/compiler/dart2js/kernel/impact_test.dart View 3 chunks +18 lines, -1 line 0 comments Download

Messages

Total messages: 6 (2 generated)
Johnni Winther
3 years, 7 months ago (2017-05-04 10:37:59 UTC) #2
Siggi Cherem (dart-lang)
lgtm https://codereview.chromium.org/2857373002/diff/1/pkg/compiler/lib/src/kernel/element_adapter.dart File pkg/compiler/lib/src/kernel/element_adapter.dart (right): https://codereview.chromium.org/2857373002/diff/1/pkg/compiler/lib/src/kernel/element_adapter.dart#newcode18 pkg/compiler/lib/src/kernel/element_adapter.dart:18: import '../resolution/operators.dart'; minor: it would be good to ...
3 years, 7 months ago (2017-05-04 19:13:40 UTC) #3
Johnni Winther
Committed patchset #2 (id:20001) manually as 85f6d6987272f36beef79cbd7d3537a0db65a57e (presubmit successful).
3 years, 7 months ago (2017-05-05 08:17:22 UTC) #5
Johnni Winther
3 years, 7 months ago (2017-05-05 08:17:26 UTC) #6
Message was sent while issue was closed.
https://codereview.chromium.org/2857373002/diff/1/pkg/compiler/lib/src/kernel...
File pkg/compiler/lib/src/kernel/element_adapter.dart (right):

https://codereview.chromium.org/2857373002/diff/1/pkg/compiler/lib/src/kernel...
pkg/compiler/lib/src/kernel/element_adapter.dart:18: import
'../resolution/operators.dart';
On 2017/05/04 19:13:40, Siggi Cherem (dart-lang) wrote:
> minor: it would be good to move the operators file elsewhere if we intend to
> continue using it in the future

Will do in a follow-up.

https://codereview.chromium.org/2857373002/diff/1/pkg/compiler/lib/src/kernel...
pkg/compiler/lib/src/kernel/element_adapter.dart:551: DartType type /* =
elementAdapter.getFunctionType(function)*/;
On 2017/05/04 19:13:40, Siggi Cherem (dart-lang) wrote:
> uncomment?

Done.

https://codereview.chromium.org/2857373002/diff/1/pkg/compiler/lib/src/kernel...
pkg/compiler/lib/src/kernel/element_adapter.dart:640: ConstantExpression
receiver = visit(node.receiver);
On 2017/05/04 19:13:39, Siggi Cherem (dart-lang) wrote:
> do we need to check that receiver is String?

We can't tell. Only when you evaluate can you determine the type. For instance

const value = (const bool.fromEnvironment('foo') ? 'foo' : 0).length;

Powered by Google App Engine
This is Rietveld 408576698