| 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 import "package:expect/expect.dart"; | 5 import "package:expect/expect.dart"; |
| 6 import 'compiler_helper.dart'; | 6 import 'compiler_helper.dart'; |
| 7 | 7 |
| 8 const int REMOVED = 0; | 8 const int REMOVED = 0; |
| 9 const int ABOVE_ZERO = 1; | 9 const int ABOVE_ZERO = 1; |
| 10 const int BELOW_LENGTH = 2; | 10 const int BELOW_LENGTH = 2; |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 152 } | 152 } |
| 153 return sum; | 153 return sum; |
| 154 } | 154 } |
| 155 """, | 155 """, |
| 156 REMOVED, | 156 REMOVED, |
| 157 | 157 |
| 158 """ | 158 """ |
| 159 main(value) { | 159 main(value) { |
| 160 // Force [value] to be an int by having the speculative optimizer | 160 // Force [value] to be an int by having the speculative optimizer |
| 161 // want an int. | 161 // want an int. |
| 162 int sum = 0; | 162 int sum = ~value; |
| 163 for (int i = 0; i < 42; i++) sum += (value & 4); | 163 for (int i = 0; i < 42; i++) sum += (value & 4); |
| 164 var a = new List(); | 164 var a = new List(); |
| 165 if (value > a.length - 1) return; | 165 if (value > a.length - 1) return; |
| 166 if (value < 0) return; | 166 if (value < 0) return; |
| 167 return a[value]; | 167 return a[value]; |
| 168 } | 168 } |
| 169 """, | 169 """, |
| 170 REMOVED, | 170 REMOVED, |
| 171 | 171 |
| 172 """ | 172 """ |
| 173 main(value) { | 173 main(value) { |
| 174 // Force [value] to be an int by having the speculative optimizer | 174 // Force [value] to be an int by having the speculative optimizer |
| 175 // want an int. | 175 // want an int. |
| 176 int sum = 0; | 176 int sum = ~value; |
| 177 for (int i = 0; i < 42; i++) sum += (value & 4); | 177 for (int i = 0; i < 42; i++) sum += (value & 4); |
| 178 var a = new List(); | 178 var a = new List(); |
| 179 if (value <= a.length - 1) { | 179 if (value <= a.length - 1) { |
| 180 if (value >= 0) { | 180 if (value >= 0) { |
| 181 return a[value]; | 181 return a[value]; |
| 182 } | 182 } |
| 183 } | 183 } |
| 184 } | 184 } |
| 185 """, | 185 """, |
| 186 REMOVED, | 186 REMOVED, |
| 187 """ | 187 """ |
| 188 main(value) { | 188 main(value) { |
| 189 // Force [value] to be an int by having the speculative optimizer | 189 // Force [value] to be an int by having the speculative optimizer |
| 190 // want an int. | 190 // want an int. |
| 191 int sum = 0; | 191 int sum = ~value; |
| 192 for (int i = 0; i < 42; i++) sum += (value & 4); | 192 for (int i = 0; i < 42; i++) sum += (value & 4); |
| 193 var a = new List(); | 193 var a = new List(); |
| 194 if (value >= a.length) return; | 194 if (value >= a.length) return; |
| 195 if (value <= -1) return; | 195 if (value <= -1) return; |
| 196 return a[value]; | 196 return a[value]; |
| 197 } | 197 } |
| 198 """, | 198 """, |
| 199 REMOVED, | 199 REMOVED, |
| 200 ]; | 200 ]; |
| 201 | 201 |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 254 operator |(other) {} | 254 operator |(other) {} |
| 255 operator &(other) {} | 255 operator &(other) {} |
| 256 operator ^(other) {} | 256 operator ^(other) {} |
| 257 operator <(other) {} | 257 operator <(other) {} |
| 258 operator >(other) {} | 258 operator >(other) {} |
| 259 operator <=(other) {} | 259 operator <=(other) {} |
| 260 operator >=(other) {} | 260 operator >=(other) {} |
| 261 operator ==(other) {} | 261 operator ==(other) {} |
| 262 } | 262 } |
| 263 class JSInt extends JSNumber { | 263 class JSInt extends JSNumber { |
| 264 operator~() => this; |
| 264 } | 265 } |
| 265 class JSDouble extends JSNumber { | 266 class JSDouble extends JSNumber { |
| 266 } | 267 } |
| 267 class JSNull { | 268 class JSNull { |
| 268 } | 269 } |
| 269 class JSBool { | 270 class JSBool { |
| 270 } | 271 } |
| 271 class JSFunction { | 272 class JSFunction { |
| 272 } | 273 } |
| 273 class ObjectInterceptor { | 274 class ObjectInterceptor { |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 312 break; | 313 break; |
| 313 } | 314 } |
| 314 } | 315 } |
| 315 | 316 |
| 316 | 317 |
| 317 main() { | 318 main() { |
| 318 for (int i = 0; i < TESTS.length; i += 2) { | 319 for (int i = 0; i < TESTS.length; i += 2) { |
| 319 expect(TESTS[i], TESTS[i + 1]); | 320 expect(TESTS[i], TESTS[i + 1]); |
| 320 } | 321 } |
| 321 } | 322 } |
| OLD | NEW |