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

Quelle  dedupe-02.js   Sprache: JAVA

 
// AutoStableStringChars needs to prevent the owner of its chars from being
// deduplicated, even if they are held by a different string.

gczeal(0);

function makeExtensibleStrFrom(str) {
  var left = str.substr(0, str.length/2);
  var right = str.substr(str.length/2, str.length);
  var ropeStr = left + right;
  return ensureLinearString(ropeStr);
}

// Make a string to deduplicate to.
var original = makeExtensibleStrFrom('{ "phbbbbbbbbbbbbbbttt!!!!??": [1] }\n\n');

// Construct D2 -> D1 -> base
var D2 = makeExtensibleStrFrom('{ "phbbbbbbbbbbbbbbttt!!!!??": [1] }');
var D1 = newRope(D2, '\n', {nursery: true});
ensureLinearString(D1);
var base = newRope(D1, '\n', {nursery: true});
ensureLinearString(base);

// Make an AutoStableStringChars(D2) and do a minor GC within it. (This will do
// a major GC, but it'll start out with a minor GC.) `base` would get
// deduplicated to `original`, if it weren't for AutoStableStringChars marking
// all of D2, D1, and base non-deduplicatable.

// The first time JSON.parse runs, it will create several (14 in my test) GC
// things before getting to the point where it does an allocation while holding
// the chars pointer. Get them out of the way now.
JSON.parse(D2);

// Cause a minor GC to happen during JSON.parse after AutoStableStringChars
// gives up its pointer.
schedulegc(1);
JSON.parse(D2);

// Access `D2` to verify that it is not using the deduplicated chars.
print(D2);

Messung V0.5
C=65 H=100 G=84

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