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

Unified Diff: test/mjsunit/array-non-smi-length.js

Issue 12491023: Remove (H|L)JSArrayLength instructions (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Cleanup Created 7 years, 9 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/x64/lithium-x64.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/array-non-smi-length.js
diff --git a/test/mjsunit/regress/regress-crbug-217858.js b/test/mjsunit/array-non-smi-length.js
similarity index 85%
copy from test/mjsunit/regress/regress-crbug-217858.js
copy to test/mjsunit/array-non-smi-length.js
index 8563e07eee9e1acbcdc8c5c28c461f2d27fad6f1..23a25ee797bd68690ad2a7ce26a9135e23b486e2 100644
--- a/test/mjsunit/regress/regress-crbug-217858.js
+++ b/test/mjsunit/array-non-smi-length.js
@@ -27,14 +27,20 @@
// Flags: --allow-natives-syntax
-var r = /r/;
-var a = "";
-function f() {
- %OptimizeFunctionOnNextCall(f, "osr");
- for (var i = 0; i < 1000000; i++) {
- a += i.toString();
- r[r] = function() {};
+function TestNonSmiArrayLength() {
+ function f(a) {
+ return a.length+1;
}
+
+ var a = [];
+ a.length = 0xFFFF;
+ assertSame(0x10000, f(a));
+ assertSame(0x10000, f(a));
+
+ %OptimizeFunctionOnNextCall(f);
+ a.length = 0xFFFFFFFF;
+ assertSame(0x100000000, f(a));
}
-f();
+TestNonSmiArrayLength();
+
« no previous file with comments | « src/x64/lithium-x64.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698