Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/Firefox/js/src/jit-test/tests/ion/   (Firefox Browser Version 136.0.1©)  Datei vom 10.2.2025 mit Größe 957 B image not shown  

Quelle  bailout-env.js

  Sprache: JAVA
 

function inner_env() {
    let result = [];

    let x = 0;
    result.push(() => x);

    var tmp = [1,2,3];
    for (let y in tmp)
        result.push(() => tmp[y])

    for (let z = 4; z < 7; z++)
        result.push(() => z)

    return result;
}

function outer_env() {
    let result = inner_env();

    var tmp = [7,8,9];
    for (let x in tmp)
        result.push(() => tmp[x])

    return result;
}

function check_result(result, expectedLen) {
    assertEq(result.length, expectedLen);

    for (var i = 0; i < expectedLen; ++i)
        assertEq(result[i], i);
}

// Wipeout jitcode
bailout();
gc(); gc();

// Test lexical environment bailouts
for (var i = 0; i < 100; ++i)
{
    bailAfter(i);

    var result = inner_env().map(fn => fn());
    check_result(result, 7);
}

// Test inlined lexical environment bailouts
for (var i = 0; i < 100; ++i)
{
    bailAfter(i);

    var result = outer_env().map(fn => fn());
    check_result(result, 10);
}

Messung V0.5 in Prozent
C=95 H=34 G=71

¤ Dauer der Verarbeitung: 0.9 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.