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

Quelle  pretenured-operations.js

  Sprache: JAVA
 

// Check individual operations that support pretenuring their result.

load(libdir + "pretenure.js");

let a;

function run(op) {
  a = [];
  for (let i = 0; i < 1000; i++) {
    a.push(op());
  }
  return a[0];
}

function check(op) {
  assertEq(isNurseryAllocated(run(op)), true);
  minorgc();
  assertEq(isNurseryAllocated(run(op)), false);

  a = undefined;
  gc();
}

setupPretenureTest();

// Object allocation.
check(() => { return {}; });

// Array allocation.
check(() => { return []; });

// Object construction.
check(() => { return new Object(); });
check(() => { return Object(); });

// Array construction.
check(() => { return Array(); });
check(() => { return Array(150); });
check(() => { return new Array(); });
check(() => { return new Array(150); });

// Lambda objects.
check(() => { return () => 0 });
function f() {
  let x = 1;
  check(() => { return () => x });
  x = 2;
}
f();

// DOM Allocations
let fdo = new FakeDOMObject();
check(() => { return fdo.doBar(); })

// Scripted constructors
class C {}
class D extends C {}
let boundC = C.bind({},1,2);

check(() => { return new C() });
check(() => { return new D() });
check(() => { return new boundC() });

Messung V0.5 in Prozent
C=97 H=84 G=90

¤ Dauer der Verarbeitung: 0.3 Sekunden  ¤

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