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 1023 B image not shown  

Quelle  megamorphic-permissive.js   Sprache: JAVA

 
var throwCount = 0;

var objs = [
  // This is just bread and butter trigger-the-megamorphic-path stuff
  {x: 2, a: 1},
  {x: 2, b: 1},
  {x: 2, c: 1},
  {x: 2, d: 1},
  {x: 2, e: 1},
  {x: 2, f: 1},

  // These ensure we hit the megamorphic permissive case
  { get x() { return 2; }, l: 2 },
  { get x() { return 2; }, m: 2 },
  { get x() { return 2; }, n: 2 },
  { get x() { return 2; }, o: 2 },
  { get x() { return 2; }, p: 2 },
  { get x() { return 2; }, q: 2 },
];

function bar(o) {
  return o.x;
}

with({}){}

var count = 0;

for (var i = 0; i < 1000; i++) {
  count += bar(objs[i % objs.length]);
}


try {
  // Throw once during a cache miss
  count += bar({ get x() { throwCount++; throw new Error("foo"); }, z: 2 });
catch(e) {}

try {
  // Populate the shape so we get a cache hit, and then throw during that cache hit
  count += bar({ get x() { return 2 }, z: 2 });
  count += bar({ get x() { throwCount++; throw new Error("foo"); }, z: 2 });
catch(e) {}

assertEq(count, 2002);
assertEq(throwCount, 2);

Messung V0.5
C=89 H=93 G=90

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