diff options
Diffstat (limited to 'deps/v8/test/mjsunit/elements-kind.js')
-rw-r--r-- | deps/v8/test/mjsunit/elements-kind.js | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/deps/v8/test/mjsunit/elements-kind.js b/deps/v8/test/mjsunit/elements-kind.js index 3ffdbba2a8..5a2355ecf6 100644 --- a/deps/v8/test/mjsunit/elements-kind.js +++ b/deps/v8/test/mjsunit/elements-kind.js @@ -25,7 +25,7 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// Flags: --allow-natives-syntax --expose-gc --nostress-opt --typed-array-max-size-in-heap=2048 +// Flags: --allow-natives-syntax --expose-gc --nostress-opt var elements_kind = { fast_smi_only : 'fast smi only elements', @@ -174,20 +174,25 @@ function make_array() { return eval(make_array_string()); } +%EnsureFeedbackVectorForFunction(construct_smis); function construct_smis() { var a = make_array(); a[0] = 0; // Send the COW array map to the steak house. assertKind(elements_kind.fast_smi_only, a); return a; } + %NeverOptimizeFunction(construct_doubles); +%EnsureFeedbackVectorForFunction(construct_doubles); function construct_doubles() { var a = construct_smis(); a[0] = 1.5; assertKind(elements_kind.fast_double, a); return a; } + %NeverOptimizeFunction(construct_objects); +%EnsureFeedbackVectorForFunction(construct_objects); function construct_objects() { var a = construct_smis(); a[0] = "one"; @@ -196,7 +201,7 @@ function construct_objects() { } // Test crankshafted transition SMI->DOUBLE. - %NeverOptimizeFunction(convert_to_double); + %EnsureFeedbackVectorForFunction(convert_to_double); function convert_to_double(array) { array[1] = 2.5; assertKind(elements_kind.fast_double, array); @@ -208,7 +213,7 @@ for (var i = 0; i < 3; i++) convert_to_double(smis); smis = construct_smis(); convert_to_double(smis); // Test crankshafted transitions SMI->FAST and DOUBLE->FAST. - %NeverOptimizeFunction(convert_to_fast); + %EnsureFeedbackVectorForFunction(convert_to_fast); function convert_to_fast(array) { array[1] = "two"; assertKind(elements_kind.fast, array); @@ -225,7 +230,7 @@ convert_to_fast(smis); convert_to_fast(doubles); // Test transition chain SMI->DOUBLE->FAST (crankshafted function will // transition to FAST directly). - %NeverOptimizeFunction(convert_mixed); +%EnsureFeedbackVectorForFunction(convert_mixed); function convert_mixed(array, value, kind) { array[1] = value; assertKind(kind, array); @@ -267,6 +272,7 @@ function crankshaft_test() { var c = [get(1), get(2), get(3.5)]; assertKind(elements_kind.fast_double, c); } +%PrepareFunctionForOptimization(crankshaft_test); for (var i = 0; i < 3; i++) { crankshaft_test(); } |