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

Issue 2866463005: Handle ?? 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: 6
Unified diffs Side-by-side diffs Delta from patch set Stats (+31 lines, -0 lines) Patch
M pkg/compiler/lib/src/kernel/ir_element_map.dart View 1 chunk +28 lines, -0 lines 6 comments Download
M tests/compiler/dart2js/kernel/impact_test.dart View 2 chunks +3 lines, -0 lines 0 comments Download

Messages

Total messages: 9 (3 generated)
Johnni Winther
3 years, 7 months ago (2017-05-05 12:49:45 UTC) #2
Siggi Cherem (dart-lang)
lgtm https://codereview.chromium.org/2866463005/diff/1/pkg/compiler/lib/src/kernel/ir_element_map.dart File pkg/compiler/lib/src/kernel/ir_element_map.dart (right): https://codereview.chromium.org/2866463005/diff/1/pkg/compiler/lib/src/kernel/ir_element_map.dart#newcode741 pkg/compiler/lib/src/kernel/ir_element_map.dart:741: left, BinaryOperator.IF_NULL, right); nothing to change here, but ...
3 years, 7 months ago (2017-05-05 18:13:37 UTC) #3
Johnni Winther
https://codereview.chromium.org/2866463005/diff/1/pkg/compiler/lib/src/kernel/ir_element_map.dart File pkg/compiler/lib/src/kernel/ir_element_map.dart (right): https://codereview.chromium.org/2866463005/diff/1/pkg/compiler/lib/src/kernel/ir_element_map.dart#newcode741 pkg/compiler/lib/src/kernel/ir_element_map.dart:741: left, BinaryOperator.IF_NULL, right); On 2017/05/05 18:13:37, Siggi Cherem (dart-lang) ...
3 years, 7 months ago (2017-05-08 09:01:06 UTC) #4
Johnni Winther
Committed patchset #1 (id:1) manually as f11e4bbac64ef3449ea2cdce5b32cb945a0b5550 (presubmit successful).
3 years, 7 months ago (2017-05-08 09:05:58 UTC) #6
sra1
DBC https://codereview.chromium.org/2866463005/diff/1/pkg/compiler/lib/src/kernel/ir_element_map.dart File pkg/compiler/lib/src/kernel/ir_element_map.dart (right): https://codereview.chromium.org/2866463005/diff/1/pkg/compiler/lib/src/kernel/ir_element_map.dart#newcode725 pkg/compiler/lib/src/kernel/ir_element_map.dart:725: ir.ConditionalExpression conditional = node.body; The conversion here (implicit ...
3 years, 7 months ago (2017-05-08 15:58:52 UTC) #8
Johnni Winther
3 years, 7 months ago (2017-05-09 10:20:25 UTC) #9
Message was sent while issue was closed.
https://codereview.chromium.org/2866463005/diff/1/pkg/compiler/lib/src/kernel...
File pkg/compiler/lib/src/kernel/ir_element_map.dart (right):

https://codereview.chromium.org/2866463005/diff/1/pkg/compiler/lib/src/kernel...
pkg/compiler/lib/src/kernel/ir_element_map.dart:725: ir.ConditionalExpression
conditional = node.body;
On 2017/05/08 15:58:52, sra1 wrote:
> The conversion here (implicit as-check in strong mode) is a bit of an
> anti-pattern
> 
> It would be better to name node.body and rely on type inference:
> 
>     ir.Expression body = node.body;
>     if (body is ir.ConditionalExpression) {
>       ir.Expression condition = body.condition;
>       if (condition is ir.MethodInvocation) {
>         ...
> 

OK, I'll rewrite it.

https://codereview.chromium.org/2866463005/diff/1/pkg/compiler/lib/src/kernel...
pkg/compiler/lib/src/kernel/ir_element_map.dart:741: left,
BinaryOperator.IF_NULL, right);
On 2017/05/08 15:58:52, sra1 wrote:
> On 2017/05/08 09:01:06, Johnni Winther wrote:
> > On 2017/05/05 18:13:37, Siggi Cherem (dart-lang) wrote:
> > > nothing to change here, but I just wonder if it is worth desugaring. Since
> the
> > > subexpressions are constants with no side-effects, we can also do `left ==
> > null
> > > ? right : left`.
> > 
> > I'd like the expressions to be structurally equivalence at least until we
> delete
> > the old front end.
> 
> It would be nice to have a TODO that explains this so we can fix it up later.

Will add a TODO

Powered by Google App Engine
This is Rietveld 408576698