Eine aufbereitete Darstellung der Quelle

 
     
 
 
Anforderungen  |   Konzepte  |   Entwurf  |   Entwicklung  |   Qualitätssicherung  |   Lebenszyklus  |   Steuerung
 
 
 
 

Benutzer

Quelle  excessive-inlining.js

  Sprache: JAVA
 

// |jit-test| test-also=--setpref=wasm_lazy_tiering --setpref=wasm_lazy_tiering_synchronous; skip-if: wasmCompileMode() != "baseline+ion" || !getPrefValue("wasm_lazy_tiering")

// Tests the inliner on a recursive function, in particular to establish that
// the inlining heuristics have some way to stop the compiler looping
// indefinitely and, more constrainingly, that it has some way to stop
// excessive but finite inlining.

// `func $recursive` has 95 bytecode bytes.  With module- and function-level
// inlining budgeting disabled, it is inlined into itself 1110 times,
// processing an extra 105450 bytecode bytes.  This is definitely excessive.
//
// With budgeting re-enabled, it is inlined just 9 times, as intended.

let t = `
(module
  (func $recursive (export "recursive") (param i32) (result i32)
    (i32.le_u (local.get 0) (i32.const 1))
    if (result i32)
      (i32.const 1)
    else
      (i32.const 1)

      (call $recursive (i32.sub (local.get 0) (i32.const 1)))
      i32.add
      (call $recursive (i32.sub (local.get 0) (i32.const 2)))
      i32.add

      (call $recursive (i32.sub (local.get 0) (i32.const 1)))
      i32.add
      (call $recursive (i32.sub (local.get 0) (i32.const 2)))
      i32.add

      (call $recursive (i32.sub (local.get 0) (i32.const 1)))
      i32.add
      (call $recursive (i32.sub (local.get 0) (i32.const 2)))
      i32.add

      (call $recursive (i32.sub (local.get 0) (i32.const 1)))
      i32.add
      (call $recursive (i32.sub (local.get 0) (i32.const 2)))
      i32.add

      (call $recursive (i32.sub (local.get 0) (i32.const 1)))
      i32.add
      (call $recursive (i32.sub (local.get 0) (i32.const 2)))
      i32.add
    end
  )
)`;

let i = new WebAssembly.Instance(new WebAssembly.Module(wasmTextToBinary(t)));

assertEq(i.exports.recursive(10), 14517361);

// This assertion will fail if there is runaway recursion, because the
// optimised compilation will run long and hence not be completed by the time
// the assertion is evaluated.
assertEq(wasmFunctionTier(i.exports.recursive), "optimized");

Messung V0.5 in Prozent
C=90 H=98 G=94

¤ Dauer der Verarbeitung: 0.10 Sekunden  (vorverarbeitet am  2026-06-06) ¤

*© 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.






                                                                                                                                                                                                                                                                                                                                                                                                     


Neuigkeiten

     Aktuelles
     Motto des Tages

Software

     Quellcodebibliothek
     Eigene Quellcodes
     Fremde Quellcodes
     Suchen

Aktivitäten

     Artikel über Sicherheit
     Anleitung zur Aktivierung von SSL

Muße

     Gedichte
     Musik
     Bilder

Jenseits des Üblichen ....

Besucherstatistik

Besucherstatistik