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

Unified Diff: tests/language/deopt_hoisted_smi_check.dart

Issue 10916155: Optimistically hoist SmiCheck through phi when the only value of unknown type coming into the phi i… (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: added test 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_optimizer.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_hoisted_smi_check.dart
diff --git a/tests/language/deopt_hoisted_smi_check.dart b/tests/language/deopt_hoisted_smi_check.dart
new file mode 100644
index 0000000000000000000000000000000000000000..36ed8f34fc1602daa6c4c9d6c91d5622c1403e72
--- /dev/null
+++ b/tests/language/deopt_hoisted_smi_check.dart
@@ -0,0 +1,20 @@
+// Copyright (c) 2011, 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.
+
+sum(a, b) {
+ int sum = 0;
+ for (int j = 1; j < 10; j++) {
+ for (int i = a; i < b; i++) {
+ sum++;
+ }
+ }
+ return sum;
+}
+
+main() {
+ for (var i = 0; i < 2000; i++) Expect.equals(9, sum(1, 2));
+ Expect.equals(9, sum(1.0, 2.0)); // Passing double causes deoptimization.
+}
« no previous file with comments | « runtime/vm/flow_graph_optimizer.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698