Commit 199bfb9b authored by bmeurer's avatar bmeurer Committed by Commit bot

[test] Rewrite mjsunit/array-natives-elements to make it pass with Crankshaft.

There was an eval inside the array_natives_test() which prevented
Crankshaft, even tho it's unrelated, and so we always went to TurboFan
now, which both decreased test coverage and increased time for stress
opt runs.

R=machenbach@chromium.org

Review URL: https://codereview.chromium.org/1725383002

Cr-Commit-Position: refs/heads/master@{#34248}
parent bacfd2c4
...@@ -30,6 +30,16 @@ ...@@ -30,6 +30,16 @@
// IC and Crankshaft support for smi-only elements in dynamic array literals. // IC and Crankshaft support for smi-only elements in dynamic array literals.
function get(foo) { return foo; } // Used to generate dynamic values. function get(foo) { return foo; } // Used to generate dynamic values.
// This code exists to eliminate the learning influence of AllocationSites
// on the following tests.
function make_array_string(literal) {
this.__sequence = this.__sequence + 1;
return "/* " + this.__sequence + " */ " + literal;
}
function make_array(literal) {
return eval(make_array_string(literal));
}
var __sequence = 0; var __sequence = 0;
function array_natives_test() { function array_natives_test() {
...@@ -40,16 +50,6 @@ function array_natives_test() { ...@@ -40,16 +50,6 @@ function array_natives_test() {
assertTrue(%HasFastDoubleElements([1.1])); assertTrue(%HasFastDoubleElements([1.1]));
assertTrue(%HasFastDoubleElements([1.1,2])); assertTrue(%HasFastDoubleElements([1.1,2]));
// This code exists to eliminate the learning influence of AllocationSites
// on the following tests.
function make_array_string(literal) {
this.__sequence = this.__sequence + 1;
return "/* " + this.__sequence + " */ " + literal;
}
function make_array(literal) {
return eval(make_array_string(literal));
}
// Push // Push
var a0 = make_array("[1, 2, 3]"); var a0 = make_array("[1, 2, 3]");
assertTrue(%HasFastSmiElements(a0)); assertTrue(%HasFastSmiElements(a0));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment