tor-browser

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

bug-1852063.js (670B)


      1 // |jit-test| --fast-warmup
      2 
      3 gczeal(0);
      4 
      5 // Create a gray function.
      6 grayRoot()[0] = (obj) => obj.x;
      7 
      8 function foo(obj, skip) {
      9  if (!skip)
     10    return grayRoot()[0](obj);
     11 }
     12 
     13 with ({}) {}
     14 
     15 // Set up `foo` to inline the gray function when we hit the threshold.
     16 for (var i = 0; i < 6; i++) {
     17  foo({x:1}, false);
     18  foo({y:1, x:2}, false);
     19 }
     20 
     21 // Start a gc, yielding after marking gray roots.
     22 gczeal(25);
     23 startgc(1);
     24 
     25 // Trigger inlining, being careful not to call and mark the gray function.
     26 // This adds the gray function to cellsToAssertNotGray.
     27 for (var i = 0; i < 10; i++) {
     28  foo({x:1}, true);
     29 }
     30 
     31 // Finish the gc and process the delayed gray checks list.
     32 finishgc();