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

Unified Diff: test/mjsunit/elements-kind.js

Issue 10545080: Optimize call sites that only ever have a single elements transition (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 8 years, 6 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/ic.cc ('k') | test/mjsunit/elements-transition-hoisting.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/elements-kind.js
===================================================================
--- test/mjsunit/elements-kind.js (revision 11733)
+++ test/mjsunit/elements-kind.js (working copy)
@@ -43,6 +43,7 @@
}
var elements_kind = {
+ any : 'ignoreme',
fast_smi_only : 'fast smi only elements',
fast : 'fast elements',
fast_double : 'fast double elements',
@@ -95,6 +96,8 @@
}
function assertKind(expected, obj, name_opt) {
+ if (expected == elements_kind.any)
+ return;
if (!support_smi_only_arrays &&
expected == elements_kind.fast_smi_only) {
expected = elements_kind.fast;
@@ -191,9 +194,12 @@
}
var smis = construct_smis();
for (var i = 0; i < 3; i++) convert_to_double(smis);
+ smis = construct_smis();
+ for (var i = 0; i < 3; i++) convert_to_double(smis);
%OptimizeFunctionOnNextCall(convert_to_double);
smis = construct_smis();
convert_to_double(smis);
+ assertTrue(2 != %GetOptimizationStatus(convert_to_double));
// Test crankshafted transitions SMI->FAST and DOUBLE->FAST.
function convert_to_fast(array) {
array[1] = "two";
@@ -205,10 +211,13 @@
var doubles = construct_doubles();
for (var i = 0; i < 3; i++) convert_to_fast(doubles);
smis = construct_smis();
+ for (var i = 0; i < 3; i++) convert_to_fast(smis);
+ smis = construct_smis();
doubles = construct_doubles();
%OptimizeFunctionOnNextCall(convert_to_fast);
convert_to_fast(smis);
convert_to_fast(doubles);
+ assertTrue(2 != %GetOptimizationStatus(convert_to_fast));
// Test transition chain SMI->DOUBLE->FAST (crankshafted function will
// transition to FAST directly).
function convert_mixed(array, value, kind) {
@@ -225,10 +234,15 @@
convert_mixed(doubles, "three", elements_kind.fast);
}
smis = construct_smis();
+ for (var i = 0; i < 3; i++) {
+ convert_mixed(smis, 1.5, elements_kind.any);
+ }
+ smis = construct_smis();
doubles = construct_doubles();
%OptimizeFunctionOnNextCall(convert_mixed);
convert_mixed(smis, 1, elements_kind.fast);
convert_mixed(doubles, 1, elements_kind.fast);
+ assertTrue(2 != %GetOptimizationStatus(convert_mixed));
assertTrue(%HaveSameMap(smis, doubles));
}
« no previous file with comments | « src/ic.cc ('k') | test/mjsunit/elements-transition-hoisting.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698