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

Unified Diff: test/mjsunit/compiler/deopt-numberoroddball-binop.js

Issue 2452193003: [crankshaft] Support all oddballs for truncating TaggedToI changes. (Closed)
Patch Set: Created 4 years, 2 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 | « src/ic/ic-state.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/compiler/deopt-numberoroddball-binop.js
diff --git a/test/mjsunit/compiler/deopt-numberoroddball-binop.js b/test/mjsunit/compiler/deopt-numberoroddball-binop.js
new file mode 100644
index 0000000000000000000000000000000000000000..51faef095204b95fd3173b16ba4a838c19eb502e
--- /dev/null
+++ b/test/mjsunit/compiler/deopt-numberoroddball-binop.js
@@ -0,0 +1,155 @@
+// Copyright 2016 the V8 project authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Flags: --allow-natives-syntax
+
+(function() {
+ function foo(x, y) { return x << y; }
+
+ foo(1.1, 0.1);
+ %BaselineFunctionOnNextCall(foo);
+ foo(0.1, 1.1);
+ %OptimizeFunctionOnNextCall(foo);
+ foo(undefined, 1.1);
+ assertOptimized(foo);
+ foo(1.1, undefined);
+ assertOptimized(foo);
+ foo(null, 1.1);
+ assertOptimized(foo);
+ foo(1.1, null);
+ assertOptimized(foo);
+ foo(true, 1.1);
+ assertOptimized(foo);
+ foo(1.1, true);
+ assertOptimized(foo);
+ foo(false, 1.1);
+ assertOptimized(foo);
+ foo(1.1, false);
+ assertOptimized(foo);
+})();
+
+(function() {
+ function foo(x, y) { return x >> y; }
+
+ foo(1.1, 0.1);
+ %BaselineFunctionOnNextCall(foo);
+ foo(0.1, 1.1);
+ %OptimizeFunctionOnNextCall(foo);
+ foo(undefined, 1.1);
+ assertOptimized(foo);
+ foo(1.1, undefined);
+ assertOptimized(foo);
+ foo(null, 1.1);
+ assertOptimized(foo);
+ foo(1.1, null);
+ assertOptimized(foo);
+ foo(true, 1.1);
+ assertOptimized(foo);
+ foo(1.1, true);
+ assertOptimized(foo);
+ foo(false, 1.1);
+ assertOptimized(foo);
+ foo(1.1, false);
+ assertOptimized(foo);
+})();
+
+(function() {
+ function foo(x, y) { return x >>> y; }
+
+ foo(1.1, 0.1);
+ %BaselineFunctionOnNextCall(foo);
+ foo(0.1, 1.1);
+ %OptimizeFunctionOnNextCall(foo);
+ foo(undefined, 1.1);
+ assertOptimized(foo);
+ foo(1.1, undefined);
+ assertOptimized(foo);
+ foo(null, 1.1);
+ assertOptimized(foo);
+ foo(1.1, null);
+ assertOptimized(foo);
+ foo(true, 1.1);
+ assertOptimized(foo);
+ foo(1.1, true);
+ assertOptimized(foo);
+ foo(false, 1.1);
+ assertOptimized(foo);
+ foo(1.1, false);
+ assertOptimized(foo);
+})();
+
+(function() {
+ function foo(x, y) { return x ^ y; }
+
+ foo(1.1, 0.1);
+ %BaselineFunctionOnNextCall(foo);
+ foo(0.1, 1.1);
+ %OptimizeFunctionOnNextCall(foo);
+ foo(undefined, 1.1);
+ assertOptimized(foo);
+ foo(1.1, undefined);
+ assertOptimized(foo);
+ foo(null, 1.1);
+ assertOptimized(foo);
+ foo(1.1, null);
+ assertOptimized(foo);
+ foo(true, 1.1);
+ assertOptimized(foo);
+ foo(1.1, true);
+ assertOptimized(foo);
+ foo(false, 1.1);
+ assertOptimized(foo);
+ foo(1.1, false);
+ assertOptimized(foo);
+})();
+
+(function() {
+ function foo(x, y) { return x | y; }
+
+ foo(1.1, 0.1);
+ %BaselineFunctionOnNextCall(foo);
+ foo(0.1, 1.1);
+ %OptimizeFunctionOnNextCall(foo);
+ foo(undefined, 1.1);
+ assertOptimized(foo);
+ foo(1.1, undefined);
+ assertOptimized(foo);
+ foo(null, 1.1);
+ assertOptimized(foo);
+ foo(1.1, null);
+ assertOptimized(foo);
+ foo(true, 1.1);
+ assertOptimized(foo);
+ foo(1.1, true);
+ assertOptimized(foo);
+ foo(false, 1.1);
+ assertOptimized(foo);
+ foo(1.1, false);
+ assertOptimized(foo);
+})();
+
+(function() {
+ function foo(x, y) { return x & y; }
+
+ foo(1.1, 0.1);
+ %BaselineFunctionOnNextCall(foo);
+ foo(0.1, 1.1);
+ %OptimizeFunctionOnNextCall(foo);
+ foo(undefined, 1.1);
+ assertOptimized(foo);
+ foo(1.1, undefined);
+ assertOptimized(foo);
+ foo(null, 1.1);
+ assertOptimized(foo);
+ foo(1.1, null);
+ assertOptimized(foo);
+ foo(true, 1.1);
+ assertOptimized(foo);
+ foo(1.1, true);
+ assertOptimized(foo);
+ foo(false, 1.1);
+ assertOptimized(foo);
+ foo(1.1, false);
+ assertOptimized(foo);
+})();
« no previous file with comments | « src/ic/ic-state.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698