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

Side by Side Diff: tests/compiler/dart2js/cps_ir/expected/redundant_condition.js

Issue 1625643002: dart2js cps: Make register allocation prioritize phi elimination. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Set default for minifying parameter Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « pkg/compiler/lib/src/tree_ir/optimization/variable_merger.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Expectation for test: 1 // Expectation for test:
2 // // This test illustrates an opportunity to remove redundant code by 2 // // This test illustrates an opportunity to remove redundant code by
3 // // propagating inforamtion after inlining. 3 // // propagating inforamtion after inlining.
4 // // 4 // //
5 // // The code below inlines `foo` twice, but we don't propagate that we already 5 // // The code below inlines `foo` twice, but we don't propagate that we already
6 // // know from the first `foo` that `a` is an int, so the second check can be 6 // // know from the first `foo` that `a` is an int, so the second check can be
7 // // removed entirely. 7 // // removed entirely.
8 // 8 //
9 // import 'package:expect/expect.dart'; 9 // import 'package:expect/expect.dart';
10 // 10 //
11 // main() { 11 // main() {
12 // var a = nextNumber(); 12 // var a = nextNumber();
13 // action(foo(a)); 13 // action(foo(a));
14 // action(foo(a)); 14 // action(foo(a));
15 // } 15 // }
16 // 16 //
17 // foo(x) { 17 // foo(x) {
18 // if (x is! int) throw "error 1"; 18 // if (x is! int) throw "error 1";
19 // return x + 5 % 100; 19 // return x + 5 % 100;
20 // } 20 // }
21 // 21 //
22 // @NoInline() @AssumeDynamic() 22 // @NoInline() @AssumeDynamic()
23 // nextNumber() => int.parse('33'); 23 // nextNumber() => int.parse('33');
24 // 24 //
25 // @NoInline() 25 // @NoInline()
26 // action(v) => print(v); 26 // action(v) => print(v);
27 27
28 function() { 28 function() {
29 var a = V.nextNumber(), v0; 29 var a = V.nextNumber();
30 if (!(typeof a === "number" && Math.floor(a) === a)) 30 if (!(typeof a === "number" && Math.floor(a) === a))
31 throw H.wrapException("error 1"); 31 throw H.wrapException("error 1");
32 v0 = a + 5; 32 a += 5;
33 V.action(v0); 33 V.action(a);
34 V.action(v0); 34 V.action(a);
35 } 35 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/tree_ir/optimization/variable_merger.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698