summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/gc/pretenure-array-long-lived.js
blob: 77ea7c0efc210d7a9ce46dd0e545164a4eebf794 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// Allocate many long-lived objects and check that we pretenure them.

load(libdir + "pretenure.js");

setupPretenureTest();

allocateArrays(nurseryCount, true);  // Warm up.

let { minor, major } = runTestAndCountCollections(
  () => allocateArrays(tenuredCount, true)
);

// Check that after the warm up period we 'only' do major GCs (we allow one
// nursery collection).
print(`${minor} minor GCs, ${major} major GCs`);
assertEq(minor <= 1, true);
assertEq(major >= 5, true);