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

Quelle  bug1420910.js   Sprache: JAVA

 
// Testing InstanceOf IC.

Array.prototype.sum = function() {
    return this.reduce(( acc, cur ) => acc + cur, 0);
}


Iters = 20;

function resultArray(fn, obj) {
    res = new Array();
    for (var x = 0; x < Iters; x++) {
        res.push(fn(obj) ? 1 : 0);
    }
    return res;
}

// Ensure alteration of .prototype invalidates IC
function basic() {};

protoA = { prop1: "1"};
basic.prototype = protoA;

io1 = x => { return x instanceof basic; }

var x = new basic();
beforePrototypeModification = resultArray(io1,x).sum(); //Attach and test IC
assertEq(beforePrototypeModification,Iters);

basic.prototype = {}; // Invalidate IC
afterPrototypeModification  = resultArray(io1,x).sum(); //Test
assertEq(afterPrototypeModification,0);

//Primitive LHS returns false.
assertEq(resultArray(io1,0).sum(),0);

Messung V0.5
C=94 H=93 G=93

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