Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/Firefox/js/src/jit-test/tests/wasm/stack-switching/   (Firefox Browser Version 153.0.1©)  Datei vom 27.6.2026 mit Größe 1 kB image not shown  

Quelle  oom.js

  Sprache: JAVA
 

// |jit-test| skip-if: !wasmStackSwitchingEnabled()

// Tests that OOM during stack-switching operations doesn't cause state
// corruption; the allocating call should throw without affecting the module.

// OOM during cont.new.
{
  let { make } = wasmEvalText(`(module
    (type $ft (func))
    (type $ct (cont $ft))
    (func $f (type $ft))
    (elem declare func $f)
    (func (export "make")
      ref.func $f
      cont.new $ct
      drop
    )
  )`).exports;
  oomTest(() => make());
}

// OOM during Ion code generation for resume with multiple handlers (bug 2035793).
{
  const bin = wasmTextToBinary(`(module
    (type $ft (func))
    (type $ct (cont $ft))
    (tag $tag1)
    (tag $tag2)
    (tag $tag3)
    (func $f (type $ft))
    (elem declare func $f)
    (func (export "run")
      (block (result (ref $ct))
        (block (result (ref $ct))
          (block (result (ref $ct))
            ref.func $f
            cont.new $ct
            resume $ct (on $tag1 0) (on $tag2 1) (on $tag3 2)
            unreachable
          )
          unreachable
        )
        unreachable
      )
      drop
    )
  )`);
  oomTest(function() {
    var m = new WebAssembly.Module(bin);
    return new WebAssembly.Instance(m, {});
  });
}

// OOM during cont.new + resume with a suspend.
{
  let { start, step, finish } = wasmEvalText(`(module
    (type $ft (func))
    (type $ct (cont $ft))
    (tag $tag)
    (global $k (mut (ref null $ct)) (ref.null $ct))
    (func $f (type $ft)
      suspend $tag
    )
    (elem declare func $f)
    (func (export "start")
      ref.func $f
      cont.new $ct
      global.set $k
    )
    (func (export "step")
      (block (result (ref $ct))
        global.get $k
        resume $ct (on $tag 0)
        return
      )
      global.set $k
    )
    (func (export "finish")
      global.get $k
      resume $ct
    )
  )`).exports;

  oomTest(function() {
    start();
    step();
    finish();
  });
}

Messung V0.5 in Prozent
C=94 H=100 G=96

¤ Dauer der Verarbeitung: 0.3 Sekunden  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

Cephes Mathematical Library

Vienna Development Method

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.