if (phaseId == StopTheWorld.INITIATE) { Collection.prepareCollector(this); return; }
  public void collectionPhase(int phaseId, boolean primary)  throws InlinePragma {    if (phaseId == StopTheWorld.PREPARE) {      // Nothing to do      return;    }    if (phaseId == StopTheWorld.PRECOPY) {      if (ActivePlan.constraints().movesObjects()) {        Scanning.preCopyGCInstances(getCurrentTrace());      }      return;    }    if (phaseId == StopTheWorld.ROOTS) {      Scanning.computeAllRoots(getCurrentTrace());      return;    }    if (phaseId == StopTheWorld.SOFT_REFS) {      if (primary && !Options.noReferenceTypes.getValue())        ReferenceProcessor.processSoftReferences(            global().isCurrentGCNursery());      return;    }    if (phaseId == StopTheWorld.WEAK_REFS) {      if (primary && !Options.noReferenceTypes.getValue())        ReferenceProcessor.processWeakReferences(            global().isCurrentGCNursery());      return;    }    if (phaseId == StopTheWorld.FINALIZABLE) {      if (primary) {        if (Options.noFinalizer.getValue())          Finalizer.kill();        else          Finalizer.moveToFinalizable(getCurrentTrace());      }      return;    }    if (phaseId == StopTheWorld.PHANTOM_REFS) {      if (primary && !Options.noReferenceTypes.getValue())        ReferenceProcessor.processPhantomReferences(            global().isCurrentGCNursery());      return;    }    if (phaseId == StopTheWorld.FORWARD_REFS) {      if (primary && !Options.noReferenceTypes.getValue() &&          ActivePlan.constraints().needsForwardAfterLiveness()) {        ReferenceProcessor.forwardReferences();      }      return;    }    if (phaseId == StopTheWorld.FORWARD_FINALIZABLE) {      if (primary && !Options.noFinalizer.getValue() &&          ActivePlan.constraints().needsForwardAfterLiveness()) {        Finalizer.forward(getCurrentTrace());      }      return;    }    if (phaseId == StopTheWorld.COMPLETE) {      // Nothing to do      return;    }    if (phaseId == StopTheWorld.RELEASE) {      // Nothing to do      return;    }    if (Options.sanityCheck.getValue() &&        getSanityChecker().collectionPhase(phaseId, primary)) {      return;    }    Log.write("Per-collector phase "); Log.write(Phase.getName(phaseId));     Log.writeln(" not handled.");    Assert.fail("Per-collector phase not handled!");  }