pretenure-array-long-lived.js (479B)
1 // Allocate many long-lived objects and check that we pretenure them. 2 3 load(libdir + "pretenure.js"); 4 5 setupPretenureTest(); 6 7 allocateArrays(nurseryCount, true); // Warm up. 8 9 let { minor, major } = runTestAndCountCollections( 10 () => allocateArrays(tenuredCount, true) 11 ); 12 13 // Check that after the warm up period we 'only' do major GCs (we allow one 14 // nursery collection). 15 print(`${minor} minor GCs, ${major} major GCs`); 16 assertEq(minor <= 1, true); 17 assertEq(major >= 5, true);