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

Side by Side Diff: runtime/tests/vm/dart/inline_stack_frame_test.dart

Issue 572913002: Revert r40306 because of crash. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 3 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 | « no previous file | runtime/vm/deferred_objects.cc » ('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) 2012, the Dart project authors. Please see the AUTHORS file 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 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=--optimization_counter_threshold=10 5 // VMOptions=--optimization_counter_threshold=10
6 6
7 import "package:expect/expect.dart"; 7 import "package:expect/expect.dart";
8 8
9 // This test tries to verify that we produce the correct stack trace when 9 // This test tries to verify that we produce the correct stack trace when
10 // throwing exceptions even when functions are inlined. 10 // throwing exceptions even when functions are inlined.
11 // The test invokes a bunch of functions and then does a throw. There is a 11 // The test invokes a bunch of functions and then does a throw. There is a
12 // catch at the outer function which uses the stack trace produced to return 12 // catch at the outer function which uses the stack trace produced to return
13 // a string. The test then verifies that the stack trace contains each 13 // a string. The test then verifies that the stack trace contains each
14 // method in the invocation chain. The test is run during warmup to ensure 14 // method in the invocation chain. The test is run during warmup to ensure
15 // unoptimized code produces the correct result and is then run 15 // unoptimized code produces the correct result and is then run
16 // in a loop to ensure optimization kicks in and some inlining is done. 16 // in a loop to ensure optimization kicks in and some inlining is done.
17 // Note: it appears that functions which have a throw are not inlined (func4)
18 // and functions that have try/catch in them are not optimized (func1).
19 // func2 is not inlined as func1 has not been optimized.
17 20
18 class Test { 21 class Test {
19 String func1(var k) { 22 String func1(var k) {
20 try { 23 try {
21 for (var i = 0; i <= 50; i++) { 24 for (var i = 0; i <= 50; i++) {
22 func2(i * k); 25 func2(i * k);
23 } 26 }
24 return ""; 27 return "";
25 } catch (e, stacktrace) { 28 } catch (e, stacktrace) {
26 var result = e + stacktrace.toString(); 29 var result = e + stacktrace.toString();
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 for (var i = 0; i <= 10; i++) { 69 for (var i = 0; i <= 10; i++) {
67 result = x.func1(i); 70 result = x.func1(i);
68 } 71 }
69 Expect.isTrue(result.contains("show me inlined functions")); 72 Expect.isTrue(result.contains("show me inlined functions"));
70 Expect.isTrue(result.contains("Test.func1")); 73 Expect.isTrue(result.contains("Test.func1"));
71 Expect.isTrue(result.contains("Test.func2")); 74 Expect.isTrue(result.contains("Test.func2"));
72 Expect.isTrue(result.contains("Test.func3")); 75 Expect.isTrue(result.contains("Test.func3"));
73 Expect.isTrue(result.contains("Test.func4")); 76 Expect.isTrue(result.contains("Test.func4"));
74 Expect.isTrue(result.contains("Test.func5")); 77 Expect.isTrue(result.contains("Test.func5"));
75 } 78 }
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/deferred_objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698