Debian Codegraph @

js/src/jit-test/tests/warp/cancel-offthread-compile.js

raw
1 // |jit-test| --fast-warmup; skip-if: helperThreadCount() === 0
2
3 function foo(o) {
4 return o.y;
5 }
6
7 with ({}) {}
8
9 var sum = 0;
10
11 // Trigger an off-thread Warp compile.
12 for (var i = 0; i < 30; i++) {
13 sum += foo({y: 1});
14 }
15
16 // Attach a new stub and cancel that compile.
17 for (var i = 0; i < 30; i++) {
18 sum += foo({x: 1, y: 1});
19 }
20
21 assertEq(sum, 60);