| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 var myString; | 5 var myString; |
| 6 | 6 |
| 7 String ifBailout(test) { | 7 String ifBailout(test) { |
| 8 if (test) { | 8 if (test) { |
| 9 // Share the same variable for the type inference. | 9 // Share the same variable for the type inference. |
| 10 var o = myString; | 10 var o = myString; |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 var o = myString; | 38 var o = myString; |
| 39 if (false) o[1] = 2; | 39 if (false) o[1] = 2; |
| 40 res = res.concat(o[i]); | 40 res = res.concat(o[i]); |
| 41 } | 41 } |
| 42 return res; | 42 return res; |
| 43 } | 43 } |
| 44 | 44 |
| 45 void forInBailout() { | 45 void forInBailout() { |
| 46 var n = myString.length; | 46 var n = myString.length; |
| 47 var res = ''; | 47 var res = ''; |
| 48 for (int i in myString.charCodes()) { | 48 for (int i in myString.charCodes) { |
| 49 var o = myString; | 49 var o = myString; |
| 50 if (false) o[1] = 2; | 50 if (false) o[1] = 2; |
| 51 res = res.concat(new String.fromCharCodes([i])); | 51 res = res.concat(new String.fromCharCodes([i])); |
| 52 } | 52 } |
| 53 return res; | 53 return res; |
| 54 } | 54 } |
| 55 | 55 |
| 56 void innerForBailout() { | 56 void innerForBailout() { |
| 57 var n = myString.length; | 57 var n = myString.length; |
| 58 var res = ''; | 58 var res = ''; |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 210 Expect.equals('1234', doWhileBailout()); | 210 Expect.equals('1234', doWhileBailout()); |
| 211 | 211 |
| 212 Expect.equals(102334155, fibonacci(40)); | 212 Expect.equals(102334155, fibonacci(40)); |
| 213 | 213 |
| 214 phiBailout(); | 214 phiBailout(); |
| 215 ifPhiBailout1(1); | 215 ifPhiBailout1(1); |
| 216 ifPhiBailout1(2); | 216 ifPhiBailout1(2); |
| 217 ifPhiBailout2(1); | 217 ifPhiBailout2(1); |
| 218 ifPhiBailout2(2); | 218 ifPhiBailout2(2); |
| 219 } | 219 } |
| OLD | NEW |