Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1250)

Side by Side Diff: tests/language/megamorphic_no_such_method_test.dart

Issue 11299298: Cache lookups at megamorphic call sites in optimized code. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: One change I forgot. Created 8 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « runtime/vm/vm_sources.gypi ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // BSD-style license that can be found in the LICENSE file.
4 // Test program for correct optimizations related to types fo allocated lists.
5
6 // Classes to induce polymorphism of degree 10.
7 class A0 {
8 test() => 0;
9 }
10
11 class A1 {
12 test() => 1;
13 }
14
15 class A2 {
16 test() => 2;
17 }
18
19 class A3 {
20 test() => 3;
21 }
22
23 class A4 {
24 test() => 4;
25 }
26
27 class A5 {
28 test() => 5;
29 }
30
31 class A6 {
32 test() => 6;
33 }
34
35 class A7 {
36 test() => 7;
37 }
38
39 class A8 {
40 test() => 8;
41 }
42
43 class A9 {
44 test() => 9;
45 }
46
47 // Class with no test method.
48 class B { }
49
50 test(obj) {
51 return obj.test();
52 }
53
54 main() {
55 // Trigger optimization of 'test' function.
56 List list = [new A0(), new A1(), new A2(), new A3(), new A4(),
57 new A5(), new A6(), new A7(), new A8(), new A9()];
58 for (int i = 0; i < 1000; i++) {
59 for (var obj in list) {
60 test(obj);
61 }
62 }
63 Expect.throws(() => test(new B()), (e) => e is NoSuchMethodError);
64 }
OLDNEW
« no previous file with comments | « runtime/vm/vm_sources.gypi ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698