/** * Collectors that move objects <b>must</b> override this method. It performs the deferred * scanning of objects which are forwarded during bootstrap of each copying collection. Because of * the complexities of the collection bootstrap (such objects are generally themselves * gc-critical), the forwarding and scanning of the objects must be dislocated. It is an error for * a non-moving collector to call this method. * * @param object The forwarded object to be scanned */ @Inline @Override protected void scanObject(ObjectReference object) { if (VM.VERIFY_ASSERTIONS) VM.assertions._assert(Immix.immixSpace.inImmixDefragCollection()); super.scanObject(object); if (MARK_LINE_AT_SCAN_TIME && Space.isInSpace(Immix.IMMIX, object)) Immix.immixSpace.markLines(object); }
private void scanReferenceSet(TraceLocal trace, Set<ReferenceValue> set) { for (ReferenceValue value : set) { ObjectReference referent = value.getObjectValue(); if (trace.isReferentLive(referent)) { value.processReference(trace); } else { value.clear(); } } }
/** * Perform some concurrent collection work. * * @param phaseId The unique phase identifier */ @Unpreemptible public void concurrentCollectionPhase(short phaseId) { if (phaseId == Concurrent.CONCURRENT_CLOSURE) { if (VM.VERIFY_ASSERTIONS) { VM.assertions._assert(!Plan.gcInProgress()); } TraceLocal trace = getCurrentTrace(); while (!trace.incrementalTrace(100)) { if (group.isAborted()) { trace.flush(); break; } } if (rendezvous() == 0) { continueCollecting = false; if (!group.isAborted()) { /* We are responsible for ensuring termination. */ if (Options.verbose.getValue() >= 2) Log.writeln("< requesting mutator flush >"); VM.collection.requestMutatorFlush(); if (Options.verbose.getValue() >= 2) Log.writeln("< mutators flushed >"); if (concurrentTraceComplete()) { continueCollecting = Phase.notifyConcurrentPhaseComplete(); } else { continueCollecting = true; Phase.notifyConcurrentPhaseIncomplete(); } } } rendezvous(); return; } Log.write("Concurrent phase "); Log.write(Phase.getName(phaseId)); Log.writeln(" not handled."); VM.assertions.fail("Concurrent phase not handled!"); }
/** * GC-time processing of the contained object * * @param trace The trace object */ public void traceObject(TraceLocal trace) { if (lastDiscoveryPhase < currentRootDiscoveryPhase) { value = trace.traceObject(value, true); lastDiscoveryPhase = currentRootDiscoveryPhase; } }