Eine aufbereitete Darstellung der Quelle

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

Benutzer

Quelle  recover-lambdas.js

  Sprache: JAVA
 

// |jit-test| --no-ion; --ion-osr=off
// Warp lacks Scalar Replacement support (bug 1650233). Re-evaluate after that
// bug has been fixed.

var max = 40;
setJitCompilerOption("ion.warmup.trigger", max - 10);

// Prevent the GC from cancelling Ion compilations, when we expect them to succeed
gczeal(0);

// This function is used to escape "g" which is a non-escaped inner function.
// As it is not escaped within "f", the lambda for "g" would be computed on the
// bailout path. Resolving the first ".caller" implies that we have to recover
// the lambda. Resolving the second ".caller" is needed such as we can build the
// test case without explicitly escaping "g", which would prevent this
// optimization.

function return_f(i) {
  if (i != max - 1)
    return f;

  // return_f.caller == g
  // return_f.caller.caller == f
  return return_f.caller.caller;
}

function f(i) {
  function g() {
    return return_f(i);
  }

  assertRecoveredOnBailout(g, true);
  return g();
}

// This function is used to cause an invalidation after having removed a branch.
// These functions are used to check if we correctly recover the lambda
// and its environment during a bailout.
var uceFault = function (i) {
    if (i == max - 1)
        uceFault = function (i) { return true; };
    return false;
};

var uceFault_lambdaCall = eval(`(${uceFault})`.replace('uceFault''uceFault_lambdaCall'));
function lambdaCall(i) {
    function g() {
        return i;
    }

    if (uceFault_lambdaCall(i) || uceFault_lambdaCall(i))
        assertEq(g(), i);

    assertRecoveredOnBailout(g, true);
};



for (var i = 0; i < max; i++) {
  assertEq(f(i), f);
  lambdaCall(i);
}

Messung V0.5 in Prozent
C=76 H=93 G=84

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

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