OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2016, 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 // Test deoptimization on a smi check. |
| 5 // VMOptions=--optimization-counter-threshold=10 --no-background-compilation |
| 6 |
| 7 import 'package:expect/expect.dart'; |
| 8 |
| 9 hc(a) { |
| 10 var r = a.hashCode; |
| 11 return r; |
| 12 } |
| 13 |
| 14 main() { |
| 15 for (var i = 0; i < 20; i++) { |
| 16 Expect.equals((1).hashCode, hc(1)); |
| 17 } |
| 18 // Passing double causes deoptimization. |
| 19 Expect.equals((1.0).hashCode, hc(1.0)); |
| 20 } |
OLD | NEW |