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