Quellcodebibliothek Statistik Leitseite products/sources/formale Sprachen/C/Firefox/js/src/jit-test/tests/profiler/   (Browser von der Mozilla Stiftung Version 136.0.1©)  Datei vom 10.2.2025 mit Größe 852 B image not shown  

Quelle  native-trampoline-3.js   Sprache: JAVA

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

// Use a Wasm module to get the following stack frames:
//
//  .. => array sort trampoline => wasmfunc comparator (Wasm) => comparator (JS)

let binary = wasmTextToBinary(`
(module
  (import "" "comparator" (func $comparator (param i32) (param i32) (result i32)))
  (func $wasmfunc
    (export "wasmfunc")
    (param $x i32)
    (param $y i32)
    (result i32)
    (return (call $comparator (local.get $x) (local.get $y)))
  )
)`);
let mod = new WebAssembly.Module(binary);
let instance = new WebAssembly.Instance(mod, {"": {comparator}});

function comparator(x, y) {
  readGeckoProfilingStack();
  return y - x;
}

enableGeckoProfilingWithSlowAssertions();

for (let i = 0; i < 20; i++) {
  let arr = [3, 1, 2, -1, 0, 4];
  arr.sort(instance.exports.wasmfunc);
  assertEq(arr.toString(), "4,3,2,1,0,-1");
}

Messung V0.5
C=88 H=72 G=80

¤ Dauer der Verarbeitung: 0.11 Sekunden  (vorverarbeitet)  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

Beweissystem der NASA

Beweissystem Isabelle

NIST Cobol Testsuite

Cephes Mathematical Library

Wiener Entwicklungsmethode

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.