if (t.jniEnv != null) ScanObject.scan(t.jniEnv);
if (t.jniEnv != null) ScanObject.rootScan(t.jniEnv);
  public static void scanThread(VM_Thread t, AddressQueue rootLocations, AddressPairQueue codeLocations) {	    Plan plan = VM_Interface.getPlan();	// An additional complication is that when a stack is copied,	// special adjustments relating to SP values have to be made.	// These are not handled by GC maps.  We are ensured that the	// thread, before scanning, still refers to the original stack	// object, whether it has already been copied or will be	// copied by the scan.  queued for later scanning.	int[] oldstack = t.stack;    	ScanObject.rootScan(t);	if (t.jniEnv != null) ScanObject.scan(t.jniEnv);	ScanObject.rootScan(t.contextRegisters);	ScanObject.rootScan(t.hardwareExceptionRegisters);	if (oldstack != t.stack) 	  t.fixupMovedStack(VM_Magic.objectAsAddress(t.stack).diff(VM_Magic.objectAsAddress(oldstack)).toInt());		if (VM.VerifyAssertions) {	  VM._assert(Plan.willNotMove(VM_Magic.objectAsAddress(t)));	  VM._assert(Plan.willNotMove(VM_Magic.objectAsAddress(t.stack)));	  VM._assert(t.jniEnv == null || Plan.willNotMove(VM_Magic.objectAsAddress(t.jniEnv)));	  VM._assert(t.jniEnv == null || t.jniEnv.refsArray() == null || Plan.willNotMove(VM_Magic.objectAsAddress(t.jniEnv.refsArray())));	  VM._assert(Plan.willNotMove(VM_Magic.objectAsAddress(t.contextRegisters)));	  VM._assert(Plan.willNotMove(VM_Magic.objectAsAddress(t.contextRegisters.gprs)));	  VM._assert(Plan.willNotMove(VM_Magic.objectAsAddress(t.hardwareExceptionRegisters)));	  VM._assert(Plan.willNotMove(VM_Magic.objectAsAddress(t.hardwareExceptionRegisters.gprs)));	}	// all threads in "unusual" states, such as running threads in	// SIGWAIT (nativeIdleThreads, nativeDaemonThreads,	// passiveCollectorThreads), set their ContextRegisters before	// calling SIGWAIT so that scans of their stacks will start at	// the caller of SIGWAIT	// fp = -1 case, which we need to add support for again this	// is for "attached" threads that have returned to C, but have	// been given references which now reside in the JNIEnv	// sidestack	scanThreadInternal(rootLocations, codeLocations, t, VM_Address.zero());	if (failed == t) {	    VM.sysWriteln("RESCANNING with verbose on");	    DUMP_STACK = 3;	    scanThreadInternal(rootLocations, codeLocations, t, VM_Address.zero());	    VM._assert(false);	}  }