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

Side by Side Diff: tests/language/bailout7_test.dart

Issue 12082074: Fix another bailout problem where not all blocks were visiting when propagating bailout information… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 10 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 | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
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.
4
5 // Test to make sure the do/while loop exit condition is generated.
6
7 var global;
8
9 class A {
10 var array;
11
12 initArray() {
13 if (global[0] == null) {
14 return [2];
15 } else {
16 var map = new Map();
17 map[0] = 2;
18 return map;
19 }
20 }
21
22 bar() {
23 array = initArray();
24 var element;
25 do {
26 element = array[0]; // bailout here
27 if (element is Map) continue;
28 if (element == null) break;
29 } while (element != 2);
30 return global[0]; // bailout here
31 }
32 }
33
34
35 void main() {
36 global = [2];
37 for (int i = 0; i < 2; i++) {
38 Expect.equals(2, new A().bar());
39 }
40
41 global = new Map();
42 global[0] = 2;
43 for (int i = 0; i < 2; i++) {
44 Expect.equals(2, new A().bar());
45 }
46 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698