tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

pretenure-object-short-lived.js (455B)


      1 // Allocate many short-lived objects and check that we don't pretenure them.
      2 
      3 load(libdir + "pretenure.js");
      4 
      5 setupPretenureTest();
      6 
      7 allocateObjects(nurseryCount, false);  // Warm up.
      8 
      9 let { minor, major } = runTestAndCountCollections(
     10  () => allocateObjects(nurseryCount * 5, false)
     11 );
     12 
     13 // Check that after the warm up period we only do minor GCs.
     14 print(`${minor} minor GCs, ${major} major GCs`);
     15 assertEq(minor >= 5, true);
     16 assertEq(major == 0, true);