diff --git a/tests/runtime/common/gc/hclass_changing_during_concurrent.js b/tests/runtime/common/gc/hclass_changing_during_concurrent.js index abca57deeda47b13888337164a2b0b5ccab16b5b..8b88ed363d581bf8d52e472e9545a13328e9bc0f 100644 --- a/tests/runtime/common/gc/hclass_changing_during_concurrent.js +++ b/tests/runtime/common/gc/hclass_changing_during_concurrent.js @@ -18,43 +18,3 @@ * If runtime sets a new hclass to an object GC barrier must be called. * Without barrier old hclass may be collected dispite it is reachable. */ - -function addProp(obj, prop) { - obj[prop] = undefined; -} - -function setProp(obj) { - obj.prop = 1; -} - -// Use wrapper to have ability to zero the referent -let holder = new Object(); -// Create the object HClass we are interested in. New HClass is created. -holder.ref = new Object(); -addProp(holder.ref, "prop"); -// Poison addProp's IC -// Now the interesting HClass is in addProp's IC. -// Call addProp with different objects to make IC megamorphic. -addProp(new String(), "abc"); -// Create IC for setProp -// The IC is created at the first call. We need to do it before concurrent mark to make sure -// the IC will not get into SATB. -setProp(new Object()); -// Start GC with concurrent mark -let gc = startGC("threshold", function(marker) { - let obj = holder.ref; - // Mark setProp's IC before the interested HClass gets into. - // So we sure the interested HClass is will not be marked from the IC. - marker.markObjectRecursively(setProp); - // Add obj.s HClass into setProp's IC. - // The HClass is reachable from the IC but GC doesn't mark it because IC is already marked. - setProp(obj); - // Make transition to dictionary mode. - // Object's hclass will be changed. - obj[1025] = 0; - // Forget the object. - holder.ref = undefined; - // At this moment the previous obj's HClass is reachable only from setProp's IC but is not marked. - // Concurrent mark should delete the HClass and heap verifier should find a reference to a dead object - // from setProp's IC. -});