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

Side by Side Diff: tests/compiler/dart2js/cps_ir/input/redundant_condition.dart

Issue 2246623002: Delete CPS IR (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 4 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
OLDNEW
(Empty)
1 // This test illustrates an opportunity to remove redundant code by
2 // propagating inforamtion after inlining.
3 //
4 // The code below inlines `foo` twice, but we don't propagate that we already
5 // know from the first `foo` that `a` is an int, so the second check can be
6 // removed entirely.
7
8 import 'package:expect/expect.dart';
9
10 main() {
11 var a = nextNumber();
12 action(foo(a));
13 action(foo(a));
14 }
15
16 foo(x) {
17 if (x is! int) throw "error 1";
18 return x + 5 % 100;
19 }
20
21 @NoInline() @AssumeDynamic()
22 nextNumber() => int.parse('33');
23
24 @NoInline()
25 action(v) => print(v);
OLDNEW
« no previous file with comments | « tests/compiler/dart2js/cps_ir/input/optimize_indexers.dart ('k') | tests/compiler/dart2js/cps_ir/input/runtime_types_1.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698