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

Unified Diff: test/mjsunit/compiler/uint32.js

Issue 1077113002: Treat HArgumentsObject as a safe use during Uint32 analysis phase. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: remove assertOptimized Created 5 years, 8 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/hydrogen-uint32-analysis.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/uint32.js
diff --git a/test/mjsunit/compiler/uint32.js b/test/mjsunit/compiler/uint32.js
index abed2858303665fbf1b52bb8a7895bbb89b81856..3568e27f0315c134c47326329afe86c9cf2fd0b7 100644
--- a/test/mjsunit/compiler/uint32.js
+++ b/test/mjsunit/compiler/uint32.js
@@ -171,3 +171,34 @@ FillOldArrayWithHeapNumbers(1);
%OptimizeFunctionOnNextCall(FillOldArrayWithHeapNumbers);
FillOldArrayWithHeapNumbers(old_array.length);
gc();
+
+// Test that HArgumentsObject does not prevent uint32 optimization and
+// that arguments object with uint32 values inside is correctly materialized.
+function Pack(x, y) {
+ try { // Prevent inlining.
+ return [x, y];
+ } catch (e) {
+ }
+}
+
+function InnerWithArguments(x, f) {
+ "use strict";
+ x >>>= 8;
+ return f(arguments[0], x|0);
+}
+
+function Outer(v, f) {
+ return InnerWithArguments(v >>> 0, f);
+}
+
+assertArrayEquals([0x0100, 0x01], Outer(0x0100, Pack));
+assertArrayEquals([0x0100, 0x01], Outer(0x0100, Pack));
+assertArrayEquals([0x0100, 0x01], Outer(0x0100, Pack));
+%OptimizeFunctionOnNextCall(Outer);
+assertArrayEquals([0x0100, 0x01], Outer(0x0100, Pack));
+assertArrayEquals([0xFFFFFFFF, 0x00FFFFFF], Outer(-1, Pack));
+
+// Cause deopt inside InnerWithArguments by passing different pack function.
+assertArrayEquals([0xFFFFFFFF, 0x00FFFFFF], Outer(-1, function (x, y) {
+ return [x, y];
+}));
« no previous file with comments | « src/hydrogen-uint32-analysis.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698