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

Issue 206553002: Prevent hoisting of certain check nodes, including [HTypeKnown]. (Closed)

Created:
6 years, 9 months ago by herhut
Modified:
6 years, 9 months ago
Reviewers:
floitsch, sra1
CC:
reviews_dartlang.org
Visibility:
Public.

Description

Prevent hoisting of certain check nodes, including [HTypeKnown]. BUG= superseded by https://codereview.chromium.org/199873004/

Patch Set 1 #

Total comments: 4

Patch Set 2 : addressed comments #

Patch Set 3 : take selector of type conversion into account in GVN #

Unified diffs Side-by-side diffs Delta from patch set Stats (+112 lines, -18 lines) Patch
M sdk/lib/_internal/compiler/implementation/ssa/nodes.dart View 1 2 4 chunks +19 lines, -2 lines 0 comments Download
M sdk/lib/_internal/compiler/implementation/ssa/optimize.dart View 1 5 chunks +17 lines, -15 lines 0 comments Download
M sdk/lib/_internal/compiler/implementation/ssa/types_propagation.dart View 1 chunk +2 lines, -1 line 0 comments Download
A tests/compiler/dart2js_extra/17645_test.dart View 1 chunk +74 lines, -0 lines 0 comments Download

Messages

Total messages: 11 (0 generated)
herhut
6 years, 9 months ago (2014-03-20 15:49:53 UTC) #1
sra1
Are there any differences from allowing other HCheck instructions to move in SsaCodeMotion?
6 years, 9 months ago (2014-03-20 15:51:49 UTC) #2
floitsch
LGTM. Make sure to address Stephen's concerns/comments. https://codereview.chromium.org/206553002/diff/1/sdk/lib/_internal/compiler/implementation/ssa/nodes.dart File sdk/lib/_internal/compiler/implementation/ssa/nodes.dart (right): https://codereview.chromium.org/206553002/diff/1/sdk/lib/_internal/compiler/implementation/ssa/nodes.dart#newcode2484 sdk/lib/_internal/compiler/implementation/ssa/nodes.dart:2484: HInstruction witness) ...
6 years, 9 months ago (2014-03-20 16:07:25 UTC) #3
herhut
On 2014/03/20 15:51:49, sra1 wrote: > Are there any differences from allowing other HCheck instructions ...
6 years, 9 months ago (2014-03-20 16:16:51 UTC) #4
herhut
https://codereview.chromium.org/206553002/diff/1/sdk/lib/_internal/compiler/implementation/ssa/nodes.dart File sdk/lib/_internal/compiler/implementation/ssa/nodes.dart (right): https://codereview.chromium.org/206553002/diff/1/sdk/lib/_internal/compiler/implementation/ssa/nodes.dart#newcode2484 sdk/lib/_internal/compiler/implementation/ssa/nodes.dart:2484: HInstruction witness) On 2014/03/20 16:07:25, floitsch wrote: > nit: ...
6 years, 9 months ago (2014-03-20 16:25:10 UTC) #5
sra1
On 2014/03/20 16:16:51, herhut wrote: > On 2014/03/20 15:51:49, sra1 wrote: > > Are there ...
6 years, 9 months ago (2014-03-20 16:31:00 UTC) #6
sra1
Your change does some nice things: _JsonStringifier_hexDigit: [function(x) { var t1; if (J.$lt$n(x, 10) === ...
6 years, 9 months ago (2014-03-20 18:27:37 UTC) #7
floitsch
There are some problems. The following program should exit with an error that A does ...
6 years, 9 months ago (2014-03-20 18:38:49 UTC) #8
floitsch
On 2014/03/20 18:38:49, floitsch wrote: > There are some problems. The following program should exit ...
6 years, 9 months ago (2014-03-20 18:40:20 UTC) #9
herhut
On 2014/03/20 18:40:20, floitsch wrote: > On 2014/03/20 18:38:49, floitsch wrote: > > There are ...
6 years, 9 months ago (2014-03-20 19:43:03 UTC) #10
floitsch
6 years, 9 months ago (2014-03-20 20:05:58 UTC) #11
On 2014/03/20 19:43:03, herhut wrote:
> On 2014/03/20 18:40:20, floitsch wrote:
> > On 2014/03/20 18:38:49, floitsch wrote:
> > > There are some problems. The following program should exit with an error
> that
> > A
> > > does not support "~". But instead it complains that xor does not exist on
B.
> > should have been "does not exist on A".
> > 
> > > 
> > > ====
> > > class A {}
> > > 
> > > main() {
> > >   var list = [ 1, 2, new A() ];
> > >   var i = list[confuse(0)];  // confuse as usual.
> > >   var b = list[confuse(2)];
> > >   var d = list[confuse(2)];
> > >   if (confuse(1) > 48) {
> > >     print(b ^ d);
> > >   } else {
> > >     print(b | ~d);
> > >   }
> > > }
> > > ====
> > > 
> > > Output:
> > > ===
> > >     t1 = X.confuse(1);
> > >     if (typeof b !== "number")
> > >       return b.$xor();
> > >     if (t1 > 48) {
> > >       if (typeof d !== "number")
> > >         return H.iae(d);
> > >       P.print((b ^ d) >>> 0);
> > >     } else
> > >       P.print((b | J.$not$i(d)) >>> 0);
> > > ===
> 
> A property of [HTypeConversion] is ignored for the purpose of GVN: The field
> [receiverTypeCheckSelector], which holds the selector that lead to the
> refinement, is not taken into account. While I first considered that this
might
> be a clever trick to make GVN remove redundant type conversions, I found that
it
> is already done somewhere else, so this probably is a bug.

My current understanding is that we don't take throwing expressions into account
when doing code-motion.
I just created a test-case that throws the wrong exception when run on master
(without this CL).

Powered by Google App Engine
This is Rietveld 408576698