tor-browser

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

assertRecoveredOnBailout-1.js (967B)


      1 // |jit-test| crash; skip-if: getBuildConfiguration("tsan") || getBuildConfiguration("wasi"); --ion-warmup-threshold=50
      2 setJitCompilerOption("offthread-compilation.enable", 0);
      3 
      4 var opts = getJitCompilerOptions();
      5 if (!opts['ion.enable'] || !opts['baseline.enable'] ||
      6    opts["ion.forceinlineCaches"] || opts["ion.check-range-analysis"])
      7 {
      8    crash("Cannot test assertRecoveredOnBailout");
      9 }
     10 
     11 // Prevent the GC from cancelling Ion compilations, when we expect them to succeed
     12 gczeal(0);
     13 
     14 function g() {
     15    return inIon();
     16 }
     17 
     18 // Wait until IonMonkey compilation finished.
     19 while(!(res = g()));
     20 
     21 // Check that we entered Ion succesfully.
     22 if (res !== true)
     23    crash("Cannot enter IonMonkey");
     24 
     25 // Test that assertRecoveredOnBailout fails as expected.
     26 function f () {
     27    var o = {};
     28    assertRecoveredOnBailout(o, false);
     29    return inIon();
     30 }
     31 
     32 // Wait until IonMonkey compilation finished.
     33 while(!(res = f()));
     34 
     35 // Ensure that we entered Ion.
     36 assertEq(res, true);