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

Unified Diff: tests/language/vm/deopt_smi_check_vm_test.dart

Issue 2039913006: DBC: Eager deoptimization and CheckSmi instruction. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Address comments Created 4 years, 6 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/simulator_dbc.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/language/vm/deopt_smi_check_vm_test.dart
diff --git a/tests/language/vm/deopt_smi_check_vm_test.dart b/tests/language/vm/deopt_smi_check_vm_test.dart
new file mode 100644
index 0000000000000000000000000000000000000000..3c6143029ba9309f61afbb555dca049ecf9a91a0
--- /dev/null
+++ b/tests/language/vm/deopt_smi_check_vm_test.dart
@@ -0,0 +1,20 @@
+// Copyright (c) 2016, 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 on a smi check.
+// VMOptions=--optimization-counter-threshold=10 --no-background-compilation
+
+import 'package:expect/expect.dart';
+
+hc(a) {
+ var r = a.hashCode;
+ return r;
+}
+
+main() {
+ for (var i = 0; i < 20; i++) {
+ Expect.equals((1).hashCode, hc(1));
+ }
+ // Passing double causes deoptimization.
+ Expect.equals((1.0).hashCode, hc(1.0));
+}
« no previous file with comments | « runtime/vm/simulator_dbc.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698