tor-browser

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

bug1633740.js (633B)


      1 // Test for bug 1633740, an intermittent GC-related crash caused by
      2 // the bigint/i64 conversion in inlined Ion to Wasm calls.
      3 
      4 // Used to help ensure this will trigger the Ion inlined call path.
      5 var threshold = 2 * getJitCompilerOptions()["ion.warmup.trigger"] + 10;
      6 function testWithJit(f) {
      7  for (var i = 0; i < threshold; i++) {
      8    f();
      9  }
     10 }
     11 
     12 function test() {
     13  var exports = wasmEvalText(`(module
     14    (func (export "f") (param i64) (result i64)
     15      (local.get 0)
     16    ))`).exports;
     17  var f = exports.f;
     18 
     19  testWithJit(() => {
     20    assertEq(f("5"), 5n);
     21  });
     22 }
     23 
     24 gczeal(7, 1); // Collect nursery on every allocation.
     25 test();