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

Unified Diff: test/mjsunit/compiler/regress-5320.js

Issue 2292873002: [turbofan] Treat the INT32 state of a truncating binary op IC as number or oddball on 32-bit machin… (Closed)
Patch Set: Update. Created 4 years, 4 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/compiler/type-hint-analyzer.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/regress-5320.js
diff --git a/test/mjsunit/compiler/deopt-materialize-accumulator.js b/test/mjsunit/compiler/regress-5320.js
similarity index 70%
copy from test/mjsunit/compiler/deopt-materialize-accumulator.js
copy to test/mjsunit/compiler/regress-5320.js
index 0b19df8a1cf03fef0e94a92d7408d2a7dece0796..2e30a7b4f57aee8813f1d484ff491607093f222a 100644
--- a/test/mjsunit/compiler/deopt-materialize-accumulator.js
+++ b/test/mjsunit/compiler/regress-5320.js
@@ -26,16 +26,27 @@
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// Flags: --allow-natives-syntax
-//
-// Tests that Turbofan correctly materializes values which are in the
-// interpreters accumulator during deopt.
-var global = 3;
-function f(a) {
- // This will trigger a deopt since global was previously a SMI, with the
- // accumulator holding an unboxed double which needs materialized.
- global = Math.sqrt(a);
+function OptimizeTruncatingBinaryOp(func) {
+ func(42, -2);
+ func(31, undefined);
+ %BaselineFunctionOnNextCall(func);
+ func(42, -2);
+ func(31, undefined);
+ %OptimizeFunctionOnNextCall(func);
+ func(-1, 2.1);
+ assertOptimized(func);
}
-%OptimizeFunctionOnNextCall(f);
-f(0.25);
-assertEquals(0.5, global);
+
+// SAR
+OptimizeTruncatingBinaryOp(function(a, b) { return a >> b; });
+// SHR
+OptimizeTruncatingBinaryOp(function(a, b) { return a >>> b; });
+// SHL
+OptimizeTruncatingBinaryOp(function(a, b) { return a << b; });
+// BIT_AND
+OptimizeTruncatingBinaryOp(function(a, b) { return a & b; });
+// BIT_OR
+OptimizeTruncatingBinaryOp(function(a, b) { return a | b; });
+// BIT_XOR
+OptimizeTruncatingBinaryOp(function(a, b) { return a ^ b; });
« no previous file with comments | « src/compiler/type-hint-analyzer.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698