summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/gc/pretenure-object-long-lived.js
blob: 4b741e3ebea452fd167ebbdc67fc93d68c5bf309 (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();

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

let { minor, major } = runTestAndCountCollections(
  () => allocateObjects(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);