tor-browser

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

recover-rest-osr.js (611B)


      1 setJitCompilerOption("baseline.warmup.trigger", 0);
      2 setJitCompilerOption("ion.warmup.trigger", 120);
      3 gczeal(0);
      4 
      5 with ({}) {}
      6 
      7 function bar(...rest) {
      8  // |rest| can be recovered, even if this is inlined into an OSR script.
      9  assertRecoveredOnBailout(rest, true);
     10  return rest[0];
     11 }
     12 
     13 function foo(n, ...rest) {
     14  // |rest| for an OSR script can't be recovered.
     15  assertRecoveredOnBailout(rest, false);
     16  var sum = 0;
     17  for (var i = 0; i < n; i++) {
     18    sum += bar(i);
     19  }
     20  trialInline();
     21  return sum;
     22 }
     23 
     24 // Trigger trial-inlining of bar into foo.
     25 foo(110);
     26 
     27 // OSR-compile foo.
     28 assertEq(foo(1000), 499500);