Index: test/mjsunit/allocation-site-info.js |
diff --git a/test/mjsunit/allocation-site-info.js b/test/mjsunit/allocation-site-info.js |
index 4d534e30369bfe468613241ee3a58050f88df12e..5df9c173055179a2f9853f9e4a68191b4551f7c9 100644 |
--- a/test/mjsunit/allocation-site-info.js |
+++ b/test/mjsunit/allocation-site-info.js |
@@ -26,7 +26,7 @@ |
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
// Flags: --allow-natives-syntax --smi-only-arrays --expose-gc |
-// Flags: --track-allocation-sites --nooptimize-constructed-arrays |
+// Flags: --track-allocation-sites --noalways-opt |
// TODO(mvstanton): remove --nooptimize-constructed-arrays and enable |
// the constructed array code below when the feature is turned on |
@@ -39,8 +39,9 @@ |
// in this test case. Depending on whether smi-only arrays are actually |
// enabled, this test takes the appropriate code path to check smi-only arrays. |
-support_smi_only_arrays = %HasFastSmiElements(new Array(1,2,3,4,5,6,7,8)); |
-optimize_constructed_arrays = false; |
+// support_smi_only_arrays = %HasFastSmiElements(new Array(1,2,3,4,5,6,7,8)); |
+support_smi_only_arrays = true; |
+optimize_constructed_arrays = true; |
if (support_smi_only_arrays) { |
print("Tests include smi-only arrays."); |
@@ -121,6 +122,7 @@ if (support_smi_only_arrays) { |
assertKind(elements_kind.fast_smi_only, obj); |
obj = new Array(1,2,3); |
+ |
assertNotHoley(obj); |
assertKind(elements_kind.fast_smi_only, obj); |
@@ -148,12 +150,17 @@ if (support_smi_only_arrays) { |
// sites work again for fast literals |
//assertKind(elements_kind.fast_double, obj); |
- obj = fastliteralcase([5, 3, 2], 1.5); |
- assertKind(elements_kind.fast_double, obj); |
- obj = fastliteralcase([3, 6, 2], 1.5); |
- assertKind(elements_kind.fast_double, obj); |
- obj = fastliteralcase([2, 6, 3], 2); |
- assertKind(elements_kind.fast_smi_only, obj); |
+ // The test below is in a loop because arrays that live |
+ // at global scope without the chance of being recreated |
+ // don't have allocation site information attached. |
+ for(i=0;i<2;i++) { |
Hannes Payer (out of office)
2013/04/18 11:14:39
codestyle: for (i=0; i<2; i++) {
mvstanton
2013/04/18 13:39:26
Done.
|
+ obj = fastliteralcase([5, 3, 2], 1.5); |
+ assertKind(elements_kind.fast_double, obj); |
+ obj = fastliteralcase([3, 6, 2], 1.5); |
+ assertKind(elements_kind.fast_double, obj); |
+ obj = fastliteralcase([2, 6, 3], 2); |
+ assertKind(elements_kind.fast_smi_only, obj); |
+ } |
// Verify that we will not pretransition the double->fast path. |
obj = fastliteralcase(get_standard_literal(), "elliot"); |
@@ -164,6 +171,12 @@ if (support_smi_only_arrays) { |
// obj = fastliteralcase(3); |
// assertKind(elements_kind.fast_double, obj); |
+ // Make sure this works in crankshafted code too. |
+ %OptimizeFunctionOnNextCall(get_standard_literal); |
+ get_standard_literal(); |
+ obj = get_standard_literal(); |
+ assertKind(elements_kind.fast_double, obj); |
+ |
function fastliteralcase_smifast(value) { |
var literal = [1, 2, 3, 4]; |
literal[0] = value; |
@@ -208,6 +221,7 @@ if (support_smi_only_arrays) { |
obj = newarraycase_smiobj(2); |
assertKind(elements_kind.fast, obj); |
+ // first death if we optimze ArraySingleArgumentConstructorStub |
function newarraycase_length_smidouble(value) { |
var a = new Array(3); |
a[0] = value; |