boolean useLowSpace = hi ^ (event == AFTER_COLLECTION); if (useLowSpace) { objectMap.iterator(ss0VM.getStart(), ss0VM.getCursor()); gcspyDriver.setRange(0, ss0VM.getStart(), ss0VM.getCursor()); } else { objectMap.iterator(ss1VM.getStart(), ss1VM.getCursor()); gcspyDriver.setRange(1, ss1VM.getStart(), ss1VM.getCursor());
boolean useLowSpace = hi ^ (event != BEFORE_COLLECTION); switch (event) { case BEFORE_COLLECTION: case AFTER_COLLECTION:  if (useLowSpace) gcspyGatherSemispacedata(0, ss0VM, true); else gcspyGatherSemispacedata(1, ss1VM, true); break; case SEMISPACE_COPIED:  gcspyGatherSemispacedata(0, ss0VM, !hi); gcspyGatherSemispacedata(1, ss1VM,  hi); break;
  private void gcspyGatherData(int event) {    // Port = 0 means no gcspy    if (GCSpy.getGCSpyPort() == 0)      return;    // We should not allocate anything while transmitting    //if (VM_Interface.VerifyAssertions)    //  objectMap.trapAllocation(true);    if (ServerInterpreter.shouldTransmit(event)) {		      ServerInterpreter.startCompensationTimer();            // -- Handle the semispace collector --            // iterate through toSpace      // at this point, hi has been flipped by globalPrepare()            gcspyDriver.zero();      boolean useLowSpace = hi ^ (event == AFTER_COLLECTION);      if (useLowSpace) {	objectMap.iterator(ss0VM.getStart(), ss0VM.getCursor());	        gcspyDriver.setRange(0, ss0VM.getStart(), ss0VM.getCursor());      } else {	objectMap.iterator(ss1VM.getStart(), ss1VM.getCursor());        gcspyDriver.setRange(1, ss1VM.getStart(), ss1VM.getCursor());      }            VM_Address addr = VM_Address.zero();      int length = 0;      //int count = 0;      while (objectMap.hasNext()) {        addr = objectMap.next();	//count++;        if (VM_Interface.VerifyAssertions) 	  VM_Interface._assert(VMResource.refInVM(addr));	gcspyDriver.traceObject(addr);      }      //Log.writeln("Objects in semispace = ", count);            // -- Handle the Treadmill space --      tmDriver.zero();      los.gcspyGatherData(event, tmDriver);            // -- Handle the immortal space --      immortalDriver.zero();       immortal.gcspyGatherData(event, immortalDriver);      ServerInterpreter.stopCompensationTimer();	      gcspyDriver.finish(event, useLowSpace ? 0 : 1);      immortalDriver.finish(event);      tmDriver.finish(event);    } else {      //Log.write("not transmitting...");    }    ServerInterpreter.serverSafepoint(event);		    //if (VM_Interface.VerifyAssertions)    //  objectMap.trapAllocation(false);   }