summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/warp/scalar-replace-array-iterator-next.js
blob: d523bdb896c973dbf5ab8f812ed5f11a42ae1fd1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
//|jit-test| --ion-pruning=on

// Verify that we can inline ArrayIteratorNext,
// and scalar-replace the result object.

if (getJitCompilerOptions()["ion.warmup.trigger"] <= 150)
    setJitCompilerOption("ion.warmup.trigger", 150);

gczeal(0);

function foo(arr) {
    var iterator = arr[Symbol.iterator]();
    while (true) {
	var result = iterator.next();
	trialInline();
	assertRecoveredOnBailout(result, true);
	if (result.done) {
	    break;
	}
    }
}

with ({}) {}
foo(Array(1000));