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

Quelle  depended-on-bit-1.js   Sprache: JAVA

 
var dependedOnStrings = [];

var length = 50;

function getSubstr(src, i) {
  return src.substring(i, i + 50);
}

function checkProp(o, prop) {
  return o[prop];
}

var substrs = [];
var objs = [];

with({})
for (var i = 0; i < 1000; i++) {
  var pieces = [];
  for (var j = 0; j < 99; j++) {
    pieces.push("a");
    pieces.push(Math.floor(Math.random() * 10));
  }
  dependedOnStrings.push(pieces.join(""));
}

for (var i = 0; i < 1000; i++) {
  // Create a bunch of substrings depending on strings in dependedOnStrings
  substrs.push(getSubstr(dependedOnStrings[i], (i * 2) % 50));
  objs.push({});
}

for (var i = 0; i < 1000; i++) {
  // Use the depended on strings as keys to get them replaced with
  // JSAtomRefStrings
  checkProp(objs[i], dependedOnStrings[i]);
}

// Use a bunch of memory to try to ensure that we overwrite the buffers
// that could have erroneously been freed
for (var i = 0; i < 1000; i++) {
  var pieces = [];
  for (var j = 0; j < 99; j++) {
    pieces.push("b");
    pieces.push(Math.floor(Math.random() * 10));
  }
  dependedOnStrings.push(pieces.join(""));
}

// Ensure the buffers were not in fact freed
for (var i = 0; i < 1000; i++) {
  assertEq(substrs[i].startsWith("a"), true);
}

Messung V0.5
C=89 H=44 G=70

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