nondedup-erasure.js (890B)
1 gczeal(0); 2 3 function address(s) { 4 return JSON.parse(stringRepresentation(s)).address; 5 } 6 7 // Create a nursery string to deduplicate the test string to. 8 var dedup_to = newString("abcdefghijklmnopqrstuvwxyz01", { 9 tenured: false, 10 capacity: 28, 11 }); 12 13 // ...and make it be processed first during a minorgc by putting something in the store buffer that points to it. 14 var look_at_me_first = newDependentString(dedup_to, 3, { tenured: true }); 15 16 var orig_owner = newString("abcdefghijklmnopqrstuvwxyz", { 17 capacity: 4000, 18 tenured: true, 19 }); 20 var trouble_dep = newDependentString(orig_owner, 1, { tenured: true }); 21 var inner_rope = newRope(orig_owner, "0"); 22 var flattened_inner_rope = ensureLinearString(inner_rope); 23 24 var outer_rope = newRope(flattened_inner_rope, "1"); 25 var flattened_outer_rope = ensureLinearString(outer_rope); 26 27 minorgc(); 28 assertEq(trouble_dep, "bcdefghijklmnopqrstuvwxyz");