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

Unified Diff: tests/language/deopt_inlined_function_test.dart

Issue 10963027: Use the inner deoptimization frame when setting incoming arguments. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Review update Created 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/flow_graph_compiler.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/language/deopt_inlined_function_test.dart
diff --git a/tests/language/deopt_inlined_function_test.dart b/tests/language/deopt_inlined_function_test.dart
new file mode 100644
index 0000000000000000000000000000000000000000..d4a5e84b8e8d4274af816ae921ef4b2b653af24d
--- /dev/null
+++ b/tests/language/deopt_inlined_function_test.dart
@@ -0,0 +1,34 @@
+// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+// Test deoptimization caused by running code that did not collect type
+// feedback before.
+
+class A {
+ deopt_here() => 1;
+}
+
+class B {
+ deopt_here() => 2;
+}
+
+var obj = new A();
+
+bar(x) {
+ x = 42;
+ obj.deopt_here();
+ return x;
+}
+
+foo(x) {
+ x = bar(x);
+ return x;
+}
+
+main() {
+ Expect.equals(42, foo(1));
+ for (var i = 0; i < 2000; i++) foo(7);
+ Expect.equals(42, foo(2));
+ obj = new B();
+ Expect.equals(42, foo(3));
+}
« no previous file with comments | « runtime/vm/flow_graph_compiler.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698