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

Side by Side Diff: tests/compiler/dart2js/js_backend_cps_ir_gvn_test.dart

Issue 1476293003: dart2js cps: Emit 'return' after throwing call to assist VM analysis. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Update test case expected output Created 5 years 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/js_backend/codegen/codegen.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 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 // Test that the GVN optimization pass works as expected. 5 // Test that the GVN optimization pass works as expected.
6 6
7 library basic_tests; 7 library basic_tests;
8 8
9 import 'js_backend_cps_ir.dart'; 9 import 'js_backend_cps_ir.dart';
10 10
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 var y1 = new Branch(x1, x2); 47 var y1 = new Branch(x1, x2);
48 var y2 = new Branch(x3, x4); 48 var y2 = new Branch(x3, x4);
49 var z = new Root(y1, y2); 49 var z = new Root(y1, y2);
50 print(foo(z, [1,2,3,4,5,6,7,8,9,10])); 50 print(foo(z, [1,2,3,4,5,6,7,8,9,10]));
51 } 51 }
52 """,r""" 52 """,r"""
53 function(x, list) { 53 function(x, list) {
54 var v0 = x.left, a = v0.left, b = v0.right, sum = 0, k = 0, c = (v0 = x.right) .left, d = v0.right, i = a.value + c.value, v1 = list[v0 = i * (b.value + d.valu e)]; 54 var v0 = x.left, a = v0.left, b = v0.right, sum = 0, k = 0, c = (v0 = x.right) .left, d = v0.right, i = a.value + c.value, v1 = list[v0 = i * (b.value + d.valu e)];
55 for (; k < 10; sum = sum + (v1 + i), k = k + 1) 55 for (; k < 10; sum = sum + (v1 + i), k = k + 1)
56 if (v0 < 0 || v0 >= 10) 56 if (v0 < 0 || v0 >= 10)
57 H.ioore(list, v0); 57 return H.ioore(list, v0);
58 return sum; 58 return sum;
59 }"""), 59 }"""),
60 ]; 60 ];
61 61
62 void main() { 62 void main() {
63 runTests(tests); 63 runTests(tests);
64 } 64 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/js_backend/codegen/codegen.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698