Index: test/mjsunit/array-constructor-feedback.js |
diff --git a/test/mjsunit/array-constructor-feedback.js b/test/mjsunit/array-constructor-feedback.js |
index 7c75a597e569c5f45b787f992884908c262d5ce8..865b8ba44fc06bcfcdbe3105fae0c067bf0ba281 100644 |
--- a/test/mjsunit/array-constructor-feedback.js |
+++ b/test/mjsunit/array-constructor-feedback.js |
@@ -26,10 +26,7 @@ |
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
// Flags: --allow-natives-syntax --expose-gc |
-// Flags: --no-always-opt --crankshaft |
- |
-assertFalse(isNeverOptimize()); |
-assertFalse(isAlwaysOptimize()); |
+// Flags: --noalways-opt |
// Test element kind of objects. |
@@ -75,7 +72,7 @@ |
a[0] = 3.5; |
b = bar0(Array); |
assertKind(elements_kind.fast_double, b); |
- %OptimizeFunctionOnNextCall(bar0); |
+ %OptimizeFunctionOnNextCall(bar0); |
b = bar0(Array); |
assertKind(elements_kind.fast_double, b); |
assertOptimized(bar0); |
@@ -84,16 +81,18 @@ |
assertUnoptimized(bar0) |
// When it's re-optimized, we should call through the full stub |
bar0(Array); |
- %OptimizeFunctionOnNextCall(bar0); |
+ %OptimizeFunctionOnNextCall(bar0); |
b = bar0(Array); |
// This only makes sense to test if we allow crankshafting |
- // We also lost our ability to record kind feedback, as the site |
- // is megamorphic now. |
- assertKind(elements_kind.fast_smi_only, b); |
- assertOptimized(bar0); |
- b[0] = 3.5; |
- c = bar0(Array); |
- assertKind(elements_kind.fast_smi_only, c); |
+ if (4 != %GetOptimizationStatus(bar0)) { |
+ // We also lost our ability to record kind feedback, as the site |
+ // is megamorphic now. |
+ assertKind(elements_kind.fast_smi_only, b); |
+ assertOptimized(bar0); |
+ b[0] = 3.5; |
+ c = bar0(Array); |
+ assertKind(elements_kind.fast_smi_only, c); |
+ } |
})(); |
@@ -142,15 +141,17 @@ |
} |
a = bar(); |
bar(); |
- %OptimizeFunctionOnNextCall(bar); |
+ %OptimizeFunctionOnNextCall(bar); |
b = bar(); |
// This only makes sense to test if we allow crankshafting |
- assertOptimized(bar); |
- %DebugPrint(3); |
- b[0] = 3.5; |
- c = bar(); |
- assertKind(elements_kind.fast_smi_only, c); |
- assertOptimized(bar); |
+ if (4 != %GetOptimizationStatus(bar)) { |
+ assertOptimized(bar); |
+ %DebugPrint(3); |
+ b[0] = 3.5; |
+ c = bar(); |
+ assertKind(elements_kind.fast_smi_only, c); |
+ assertOptimized(bar); |
+ } |
})(); |
@@ -179,7 +180,7 @@ |
function bar(len) { return new Array(len); } |
bar(0); |
bar(0); |
- %OptimizeFunctionOnNextCall(bar); |
+ %OptimizeFunctionOnNextCall(bar); |
a = bar(0); |
assertOptimized(bar); |
assertFalse(isHoley(a)); |
@@ -191,8 +192,10 @@ |
a = bar(0); |
assertOptimized(bar); |
// Crankshafted functions don't use mementos, so feedback still |
- // indicates a packed array is desired. |
- assertFalse(isHoley(a)); |
+ // indicates a packed array is desired. (unless --nocrankshaft is in use). |
+ if (4 != %GetOptimizationStatus(bar)) { |
+ assertFalse(isHoley(a)); |
+ } |
})(); |
// Test: Make sure that crankshaft continues with feedback for large arrays. |