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); |
+})(); |