Debian Codegraph @

js/src/jit-test/tests/gc/bug-1692221.js

raw
1 // |jit-test| allow-oom
2
3 // Test TenuredChunk::decommitFreeArenasWithoutUnlocking updates chunk
4 // metadata correctly. The data is checked by assertions so this test is about
5 // exercising the code in question.
6
7 function allocateGarbage() {
8 gc();
9 for (let j = 0; j < 100000; j++) {
10 Symbol();
11 }
12 }
13
14 function collectUntilDecommit() {
15 startgc(1);
16 while (gcstate() != "NotActive" && gcstate() != "Decommit") {
17 gcslice(1000);
18 }
19 }
20
21 function triggerSyncDecommit() {
22 reportLargeAllocationFailure(1);
23 }
24
25 gczeal(0);
26
27 // Normally we skip decommit if GCs are happening frequently. Disable that for
28 // this test
29 gcparam("highFrequencyTimeLimit", 0);
30
31 allocateGarbage();
32 collectUntilDecommit();
33 triggerSyncDecommit();
34
35 allocateGarbage();
36 collectUntilDecommit();
37 oomAtAllocation(10);
38 triggerSyncDecommit();
39 resetOOMFailure();