summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/warp/cancel-offthread-compile.js
blob: 939d128ae14e61f7c7b174fe779d68835e4d3388 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// |jit-test| --fast-warmup; skip-if: helperThreadCount() === 0

function foo(o) {
    return o.y;
}

with ({}) {}

var sum = 0;

// Trigger an off-thread Warp compile.
for (var i = 0; i < 30; i++) {
    sum += foo({y: 1});
}

// Attach a new stub and cancel that compile.
for (var i = 0; i < 30; i++) {
    sum += foo({x: 1, y: 1});
}

assertEq(sum, 60);