| OLD | NEW |
| (Empty) | |
| 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 |
| 3 // BSD-style license that can be found in the LICENSE file. |
| 4 // VMOptions=--stacktrace-every=3 --optimization-counter-threshold=10 --enable-i
nlining-annotations |
| 5 |
| 6 // Test generating stacktraces with inlining and deferred code. |
| 7 // Regression test for issue dartbug.com/22331 |
| 8 |
| 9 class A { |
| 10 final N; |
| 11 final inc; |
| 12 var next; |
| 13 A(this.N, this.inc) { |
| 14 next = this; |
| 15 } |
| 16 } |
| 17 |
| 18 foo(o, value) { |
| 19 for (var i = 0; i < o.N; i += o.inc) { |
| 20 if (value < i) { |
| 21 throw ""; |
| 22 } |
| 23 o = o.next; |
| 24 } |
| 25 return value; |
| 26 } |
| 27 |
| 28 const NeverInline = 'NeverInline'; |
| 29 |
| 30 @NeverInline baz(x, y, z) => z; |
| 31 |
| 32 bar(o) { |
| 33 var value = 0x100000000 + o.inc; |
| 34 baz(0, 0, foo(o, value)); |
| 35 } |
| 36 |
| 37 main() { |
| 38 var o = new A(10, 1); |
| 39 for (var i = 0; i < 100; i++) bar(o); |
| 40 bar(new A(100000, 1)); |
| 41 } |
| 42 |
| OLD | NEW |