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

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

Issue 19034002: Add VMOptions to optimize tests that need to be (Part I). (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 5 months 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 | « tests/language/deopt_smi_op_test.dart ('k') | tests/language/div_with_power_of_two_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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 // VMOptions=--optimization-counter-threshold=10
4 5
5 import "package:expect/expect.dart"; 6 import "package:expect/expect.dart";
6 7
7 // This is a test for deoptimization infrastructure and to reproduce the 8 // This is a test for deoptimization infrastructure and to reproduce the
8 // failure from bug 5442338. 9 // failure from bug 5442338.
9 10
10 main() { 11 main() {
11 warmup(); 12 warmup();
12 runTest(); 13 runTest();
13 } 14 }
14 15
15 // Create a situation where method 'call' is optimized for using class A 16 // Create a situation where method 'call' is optimized for using class A
16 // when calling foo. 17 // when calling foo.
17 warmup() { 18 warmup() {
18 List a = [ new A(), new A(), new A(), new A()]; 19 List a = [ new A(), new A(), new A(), new A()];
19 var res = 0; 20 var res = 0;
20 for (int i = 0; i < 2000; i++) { 21 for (int i = 0; i < 20; i++) {
21 res = call(a, 0); 22 res = call(a, 0);
22 } 23 }
23 Expect.equals(10, res); 24 Expect.equals(10, res);
24 } 25 }
25 26
26 27
27 // Create a situation where several optimized frames of 'call' are on stack 28 // Create a situation where several optimized frames of 'call' are on stack
28 // when deoptimization occurs because B.foo is called. After the first 29 // when deoptimization occurs because B.foo is called. After the first
29 // deoptimization, several optimized frames of 'call' are still on stack and 30 // deoptimization, several optimized frames of 'call' are still on stack and
30 // some of them will be deoptimized. 31 // some of them will be deoptimized.
(...skipping 18 matching lines...) Expand all
49 50
50 51
51 class A { 52 class A {
52 foo() { return 1; } 53 foo() { return 1; }
53 } 54 }
54 55
55 56
56 class B { 57 class B {
57 foo() { return 2; } 58 foo() { return 2; }
58 } 59 }
OLDNEW
« no previous file with comments | « tests/language/deopt_smi_op_test.dart ('k') | tests/language/div_with_power_of_two_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698