// (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 --smi-only-arrays --noparallel-recompilation
+// Flags: --allow-natives-syntax --smi-only-arrays --expose-gc
+// Flags: --noparallel-recompilation
// Ensure that ElementsKind transitions in various situations are hoisted (or
// not hoisted) correctly, don't change the semantics programs and don't trigger
print("Tests do NOT include smi-only arrays.");
}
+// Force existing ICs from previous stress runs to be flushed, otherwise the
+// assumptions in this test about when deoptimizations get triggered are not
+// valid.
+gc();
+
if (support_smi_only_arrays) {
// Make sure that a simple elements array transitions inside a loop before
// stores to an array gets hoisted in a way that doesn't generate a deopt in
testDoubleConversion4(new Array(5));
testDoubleConversion4(new Array(5));
assertTrue(2 != %GetOptimizationStatus(testDoubleConversion4));
- %ClearFunctionTypeFeedback(testDoubleConversion4);
// Make sure that non-element related map checks that are not preceded by
// transitions in a loop still get hoisted in a way that doesn't generate a
testExactMapHoisting(new Array(5));
testExactMapHoisting(new Array(5));
assertTrue(2 != %GetOptimizationStatus(testExactMapHoisting));
- %ClearFunctionTypeFeedback(testExactMapHoisting);
// Make sure that non-element related map checks do NOT get hoisted if they
// depend on an elements transition before them and it's not possible to hoist
testExactMapHoisting2(new Array(5));
// Temporarily disabled - see bug 2176.
// assertTrue(2 != %GetOptimizationStatus(testExactMapHoisting2));
- %ClearFunctionTypeFeedback(testExactMapHoisting2);
// Make sure that non-element related map checks do get hoisted if they use
// the transitioned map for the check and all transitions that they depend
testExactMapHoisting3(new Array(5));
testExactMapHoisting3(new Array(5));
assertTrue(2 != %GetOptimizationStatus(testExactMapHoisting3));
- %ClearFunctionTypeFeedback(testExactMapHoisting3);
function testDominatingTransitionHoisting1(a) {
var object = new Object();
testDominatingTransitionHoisting1(new Array(5));
testDominatingTransitionHoisting1(new Array(5));
assertTrue(2 != %GetOptimizationStatus(testDominatingTransitionHoisting1));
- %ClearFunctionTypeFeedback(testDominatingTransitionHoisting1);
function testHoistingWithSideEffect(a) {
var object = new Object();
testHoistingWithSideEffect(new Array(5));
testHoistingWithSideEffect(new Array(5));
assertTrue(2 != %GetOptimizationStatus(testHoistingWithSideEffect));
- %ClearFunctionTypeFeedback(testHoistingWithSideEffect);
- function testStraightLineDupeElimination(a,b,c,d,e,f) {
+ function testStraightLineDupeElinination(a,b,c,d,e,f) {
var count = 3;
do {
assertTrue(true);
} while (--count > 3);
}
- testStraightLineDupeElimination(new Array(0, 0, 0, 0, 0),0,0,0,0,.5);
- testStraightLineDupeElimination(new Array(0, 0, 0, 0, 0),0,0,0,.5,0);
- testStraightLineDupeElimination(new Array(0, 0, 0, 0, 0),0,0,.5,0,0);
- testStraightLineDupeElimination(new Array(0, 0, 0, 0, 0),0,.5,0,0,0);
- testStraightLineDupeElimination(new Array(0, 0, 0, 0, 0),.5,0,0,0,0);
- testStraightLineDupeElimination(new Array(.1,.1,.1,.1,.1),0,0,0,0,.5);
- testStraightLineDupeElimination(new Array(.1,.1,.1,.1,.1),0,0,0,.5,0);
- testStraightLineDupeElimination(new Array(.1,.1,.1,.1,.1),0,0,.5,0,0);
- testStraightLineDupeElimination(new Array(.1,.1,.1,.1,.1),0,.5,0,0,0);
- testStraightLineDupeElimination(new Array(.1,.1,.1,.1,.1),.5,0,0,0,0);
- testStraightLineDupeElimination(new Array(5),.5,0,0,0,0);
- testStraightLineDupeElimination(new Array(5),0,.5,0,0,0);
- testStraightLineDupeElimination(new Array(5),0,0,.5,0,0);
- testStraightLineDupeElimination(new Array(5),0,0,0,.5,0);
- testStraightLineDupeElimination(new Array(5),0,0,0,0,.5);
- testStraightLineDupeElimination(new Array(5),.5,0,0,0,0);
- testStraightLineDupeElimination(new Array(5),0,.5,0,0,0);
- testStraightLineDupeElimination(new Array(5),0,0,.5,0,0);
- testStraightLineDupeElimination(new Array(5),0,0,0,.5,0);
- testStraightLineDupeElimination(new Array(5),0,0,0,0,.5);
- %OptimizeFunctionOnNextCall(testStraightLineDupeElimination);
- testStraightLineDupeElimination(new Array(5));
- testStraightLineDupeElimination(new Array(5));
- assertTrue(2 != %GetOptimizationStatus(testStraightLineDupeElimination));
- %ClearFunctionTypeFeedback(testStraightLineDupeElimination);
+ testStraightLineDupeElinination(new Array(0, 0, 0, 0, 0),0,0,0,0,.5);
+ testStraightLineDupeElinination(new Array(0, 0, 0, 0, 0),0,0,0,.5,0);
+ testStraightLineDupeElinination(new Array(0, 0, 0, 0, 0),0,0,.5,0,0);
+ testStraightLineDupeElinination(new Array(0, 0, 0, 0, 0),0,.5,0,0,0);
+ testStraightLineDupeElinination(new Array(0, 0, 0, 0, 0),.5,0,0,0,0);
+ testStraightLineDupeElinination(new Array(.1,.1,.1,.1,.1),0,0,0,0,.5);
+ testStraightLineDupeElinination(new Array(.1,.1,.1,.1,.1),0,0,0,.5,0);
+ testStraightLineDupeElinination(new Array(.1,.1,.1,.1,.1),0,0,.5,0,0);
+ testStraightLineDupeElinination(new Array(.1,.1,.1,.1,.1),0,.5,0,0,0);
+ testStraightLineDupeElinination(new Array(.1,.1,.1,.1,.1),.5,0,0,0,0);
+ testStraightLineDupeElinination(new Array(5),.5,0,0,0,0);
+ testStraightLineDupeElinination(new Array(5),0,.5,0,0,0);
+ testStraightLineDupeElinination(new Array(5),0,0,.5,0,0);
+ testStraightLineDupeElinination(new Array(5),0,0,0,.5,0);
+ testStraightLineDupeElinination(new Array(5),0,0,0,0,.5);
+ testStraightLineDupeElinination(new Array(5),.5,0,0,0,0);
+ testStraightLineDupeElinination(new Array(5),0,.5,0,0,0);
+ testStraightLineDupeElinination(new Array(5),0,0,.5,0,0);
+ testStraightLineDupeElinination(new Array(5),0,0,0,.5,0);
+ testStraightLineDupeElinination(new Array(5),0,0,0,0,.5);
+ %OptimizeFunctionOnNextCall(testStraightLineDupeElinination);
+ testStraightLineDupeElinination(new Array(5));
+ testStraightLineDupeElinination(new Array(5));
+ assertTrue(2 != %GetOptimizationStatus(testStraightLineDupeElinination));
}