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

Quelle  object-keys-06.js

  Sprache: JAVA
 

load(libdir + 'array-compare.js'); // arraysEqual

// Ion eager fails the test below because we have not yet created any
// Cache IR IC in baseline before running the content of the top-level
// function.
if (getJitCompilerOptions()["ion.warmup.trigger"] <= 100)
    setJitCompilerOption("ion.warmup.trigger"100);

// This test case checks that we are capable of recovering the Object.keys array
// even if we optimized it away. It also checks that we indeed optimize it away
// as we would expect.

// Prevent GC from cancelling/discarding Ion compilations.
gczeal(0);

function objKeysIterate(obj, expected, i) {
    var keys = Object.keys(obj);
    for (let i = 0; i < keys.length; i++) {
        assertEq(keys[i], expected[i]);
    }
    assertRecoveredOnBailout(keys, true);
}

function objKeysIterateMutated(obj, expected, i) {
    var keys = Object.keys(obj);
    obj.foo = 42;
    for (let i = 0; i < keys.length; i++) {
        assertEq(keys[i], expected[i]);
    }
    assertRecoveredOnBailout(keys, true);
}

// Prevent compilation of the top-level.
eval(`${arraysEqual}`);
let obj = {a: 0, b: 1, c: 2, d: 3};

for (let i = 0; i < 100; i++) {
    objKeysIterate({...obj}, ["a""b""c""d"], i);
    objKeysIterateMutated({...obj}, ["a""b""c""d"], i);
}

Messung V0.5 in Prozent
C=78 H=40 G=61

¤ Dauer der Verarbeitung: 0.14 Sekunden  (vorverarbeitet am  2026-08-25) ¤

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