OLD | NEW |
1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2017, 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 // VMOptions=--enable-inlining-annotations --optimization-counter-threshold=1000
--no-background-compilation | 5 // VMOptions=--enable-inlining-annotations --optimization-counter-threshold=1000
--no-background-compilation |
6 | 6 |
7 // Regression test for correct LICM and type propagation. | 7 // Regression test for correct LICM and type propagation. |
8 | 8 |
9 const AlwaysInline = "AlwaysInline"; | 9 const AlwaysInline = "AlwaysInline"; |
10 const NeverInline = "NeverInline"; | 10 const NeverInline = "NeverInline"; |
11 | 11 |
12 class Attribute { | 12 class Attribute { |
13 final id = 123; | 13 final id = 123; |
14 } | 14 } |
15 | 15 |
16 class Name { | 16 abstract class Name { |
17 Name(this.name); | 17 Name(this.name); |
18 final String name; | 18 final String name; |
19 get attr; | 19 get attr; |
20 | 20 |
21 @AlwaysInline | 21 @AlwaysInline |
22 int compareTo(other) { | 22 int compareTo(other) { |
23 int nameCompare = name.compareTo(other.name); | 23 int nameCompare = name.compareTo(other.name); |
24 if (nameCompare != 0) return nameCompare; | 24 if (nameCompare != 0) return nameCompare; |
25 if (attr == null) return 0; | 25 if (attr == null) return 0; |
26 return attr.id - other.attr.id; | 26 return attr.id - other.attr.id; |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 ]; | 71 ]; |
72 | 72 |
73 find(list, new AName()); | 73 find(list, new AName()); |
74 find(list, new BName("e")); | 74 find(list, new BName("e")); |
75 find(list, new BName("b")); | 75 find(list, new BName("b")); |
76 for (var i = 0; i < 1000; ++i) { | 76 for (var i = 0; i < 1000; ++i) { |
77 find(list, new BName("b")); | 77 find(list, new BName("b")); |
78 find(list, new BName("e")); | 78 find(list, new BName("e")); |
79 } | 79 } |
80 } | 80 } |
OLD | NEW |