asm.emitMOV_Reg_RegIdx_Byte(T0, T0, S0, asm.BYTE, 0);
asm.emitMOVZX_Reg_RegIdx_Byte(T0, T0, S0, asm.BYTE, 0);
  private final boolean genMagic (VM_MethodReference m) {    VM_Atom methodName = m.getName();    if (methodName == VM_MagicNames.attempt) {      // attempt gets called with four arguments      //   base      //   offset      //   oldVal      //   newVal      // returns ([base+offset] == oldVal)      // if ([base+offset] == oldVal) [base+offset] := newVal      // (operation on memory is atomic)      asm.emitPOP_Reg (T1);            // newVal      asm.emitPOP_Reg (EAX);           // oldVal (EAX is implicit arg to LCMPXCNG      asm.emitPOP_Reg (S0);            // S0 = offset      asm.emitADD_Reg_RegInd(S0, SP);  // S0 += base      if (VM.BuildForSingleVirtualProcessor) {	asm.emitMOV_RegInd_Reg (S0, T1);       // simply a store on uniprocessor (need not be atomic or cmp/xchg)	asm.emitMOV_RegInd_Imm (SP, 1);        // 'push' true (overwriting base)      } else {	asm.emitLockNextInstruction();	asm.emitCMPXCHG_RegInd_Reg (S0, T1);   // atomic compare-and-exchange	asm.emitMOV_RegInd_Imm (SP, 0);        // 'push' false (overwriting base)	VM_ForwardReference fr = asm.forwardJcc(asm.NE); // skip if compare fails	asm.emitMOV_RegInd_Imm (SP, 1);        // 'push' true (overwriting base)	fr.resolve(asm);      }      return true;    }        if (methodName == VM_MagicNames.invokeMain) {      // invokeMain gets "called" with two arguments:      //   String[] mainArgs       // the arguments to the main method      //   INSTRUCTION[] mainCode  // the code for the main method      asm.emitPOP_Reg (S0);            //       genParameterRegisterLoad(1); // pass 1 parameter word	      asm.emitCALL_Reg(S0);            // branches to mainCode with mainArgs on the stack      return true;    }        if (methodName == VM_MagicNames.saveThreadState) {      int offset = VM_Entrypoints.saveThreadStateInstructionsField.getOffset();      genParameterRegisterLoad(1); // pass 1 parameter word      asm.emitCALL_RegDisp(JTOC, offset);      return true;    }    if (methodName == VM_MagicNames.threadSwitch) {      int offset = VM_Entrypoints.threadSwitchInstructionsField.getOffset();      genParameterRegisterLoad(2); // pass 2 parameter words      asm.emitCALL_RegDisp(JTOC, offset);      return true;    }                      if (methodName == VM_MagicNames.restoreHardwareExceptionState) {      int offset = VM_Entrypoints.restoreHardwareExceptionStateInstructionsField.getOffset();      genParameterRegisterLoad(1); // pass 1 parameter word      asm.emitCALL_RegDisp(JTOC, offset);      return true;    }    if (methodName == VM_MagicNames.invokeClassInitializer) {      asm.emitPOP_Reg (S0);      asm.emitCALL_Reg(S0); // call address just popped      return true;    }        /*     * sysCall0, sysCall1, sysCall2, sysCall3 and sysCall4 return     * an integer (32 bits).     *     *	hi mem     *	  branch address	<- SP     *     * before call to C     *  hi mem     *	  branch address     *	  saved ebx     *	  saved pr     *	  saved jtoc		<- SP     */    if (methodName == VM_MagicNames.sysCall0) {      asm.emitMOV_Reg_Reg(T0, SP);	// T0 <- SP      asm.emitPUSH_Reg(EBX);	// save three nonvolatiles: EBX      asm.emitPUSH_Reg(ESI);	      asm.emitPUSH_Reg(JTOC);	// JTOC aka EDI      asm.emitCALL_RegInd(T0);	// branch to C code      asm.emitPOP_Reg(JTOC);	// restore the three nonvolatiles      asm.emitPOP_Reg(ESI);      asm.emitPOP_Reg(EBX);      asm.emitMOV_RegInd_Reg(SP, T0);	// store return value      return true;    }        if (methodName == VM_MagicNames.sysCall1) {      asm.emitPOP_Reg(S0);	// first and only argument      asm.emitMOV_Reg_Reg(T0, SP);	// T0 <- SP      asm.emitPUSH_Reg(EBX);	// save three nonvolatiles: EBX      asm.emitPUSH_Reg(ESI);	      asm.emitPUSH_Reg(JTOC);	// JTOC aka EDI      asm.emitPUSH_Reg(S0);	// push arg on stack      asm.emitCALL_RegInd(T0);	// branch to C code      asm.emitPOP_Reg(S0);	// pop the argument       asm.emitPOP_Reg(JTOC);	// restore the three nonvolatiles      asm.emitPOP_Reg(ESI);      asm.emitPOP_Reg(EBX);      asm.emitMOV_RegInd_Reg(SP, T0);	// store return value      return true;    }        if (methodName == VM_MagicNames.sysCall2) {      // C require its arguments reversed      asm.emitPOP_Reg(T1);	// second arg      asm.emitPOP_Reg(S0);	// first arg      asm.emitMOV_Reg_Reg(T0, SP);	// T0 <- SP      asm.emitPUSH_Reg(EBX);	// save three nonvolatiles: EBX      asm.emitPUSH_Reg(ESI);	      asm.emitPUSH_Reg(JTOC);	// JTOC aka EDI      asm.emitPUSH_Reg(T1);	// reorder arguments for C       asm.emitPUSH_Reg(S0);	// reorder arguments for C      asm.emitCALL_RegInd(T0);	// branch to C code      asm.emitADD_Reg_Imm(SP, WORDSIZE*2);	// pop the arguments       asm.emitPOP_Reg(JTOC);	// restore the three nonvolatiles      asm.emitPOP_Reg(ESI);      asm.emitPOP_Reg(EBX);      asm.emitMOV_RegInd_Reg(SP, T0);	// store return value      return true;    }        if (methodName == VM_MagicNames.sysCall3) {      // C require its arguments reversed      asm.emitMOV_Reg_RegInd(T0, SP);			// load 3rd arg      asm.emitMOV_RegDisp_Reg(SP, -1*WORDSIZE, T0);	// store 3rd arg      asm.emitMOV_Reg_RegDisp(T0, SP, WORDSIZE);	// load 2nd arg      asm.emitMOV_RegDisp_Reg(SP, -2*WORDSIZE, T0);	// store 2nd arg      asm.emitMOV_Reg_RegDisp(T0, SP, 2*WORDSIZE);	// load 1st arg      asm.emitMOV_RegDisp_Reg(SP, -3*WORDSIZE, T0);	// store 1st arg      asm.emitMOV_Reg_Reg(T0, SP);			// T0 <- SP      asm.emitMOV_RegDisp_Reg(SP, 2*WORDSIZE, EBX);	// save three nonvolatiles: EBX      asm.emitMOV_RegDisp_Reg(SP, 1*WORDSIZE, ESI);      asm.emitMOV_RegInd_Reg(SP, JTOC);			// JTOC aka EDI      asm.emitADD_Reg_Imm(SP, -3*WORDSIZE);		// grow the stack      asm.emitCALL_RegDisp(T0, 3*WORDSIZE); // fourth arg on stack is address to call      asm.emitADD_Reg_Imm(SP, WORDSIZE*3);		// pop the arguments       asm.emitPOP_Reg(JTOC);	// restore the three nonvolatiles      asm.emitPOP_Reg(ESI);      asm.emitPOP_Reg(EBX);      asm.emitMOV_RegInd_Reg(SP, T0);			// store return value      return true;    }        if (methodName == VM_MagicNames.sysCall4) {      // C require its arguments reversed      asm.emitMOV_Reg_RegDisp(T0, SP, WORDSIZE);	// load 3rd arg      asm.emitMOV_RegDisp_Reg(SP, -1*WORDSIZE, T0);	// store 3th arg      asm.emitMOV_Reg_RegDisp(T0, SP, 2*WORDSIZE);	// load 2nd arg      asm.emitMOV_RegDisp_Reg(SP, -2*WORDSIZE, T0);	// store 2nd arg      asm.emitMOV_Reg_RegDisp(T0, SP, 3*WORDSIZE);	// load 1st arg      asm.emitMOV_RegDisp_Reg(SP, -3*WORDSIZE, T0);	// store 1st arg      asm.emitMOV_Reg_Reg(T0, SP);			// T0 <- SP      asm.emitMOV_RegDisp_Reg(SP, 3*WORDSIZE, EBX);	// save three nonvolatiles: EBX      asm.emitMOV_RegDisp_Reg(SP, 2*WORDSIZE, ESI);	      asm.emitMOV_RegDisp_Reg(SP, 1*WORDSIZE, JTOC);	// JTOC aka EDI      asm.emitADD_Reg_Imm(SP, -3*WORDSIZE);		// grow the stack      asm.emitCALL_RegDisp(T0, 4*WORDSIZE); // fifth arg on stack is address to call      asm.emitADD_Reg_Imm(SP, WORDSIZE*4);		// pop the arguments       asm.emitPOP_Reg(JTOC);	// restore the three nonvolatiles      asm.emitPOP_Reg(ESI);      asm.emitPOP_Reg(EBX);      asm.emitMOV_RegInd_Reg(SP, T0);			// store return value      return true;    }        /*     * sysCall_L_0  returns a long and takes no arguments     */    if (methodName == VM_MagicNames.sysCall_L_0) {      asm.emitMOV_Reg_Reg(T0, SP);      asm.emitPUSH_Reg(EBX);	// save three nonvolatiles: EBX      asm.emitPUSH_Reg(ESI);	      asm.emitPUSH_Reg(JTOC);	// JTOC aka EDI      asm.emitCALL_RegInd(T0);	// first arg on stack is address to call      asm.emitPOP_Reg(JTOC);	// restore the three nonvolatiles      asm.emitPOP_Reg(ESI);      asm.emitPOP_Reg(EBX);      asm.emitMOV_RegInd_Reg(SP, T1);	// store return value: hi half      asm.emitPUSH_Reg(T0);	// low half      return true;    }        /*     * sysCall_L_I  returns a long and takes an integer argument     */    if (methodName == VM_MagicNames.sysCall_L_I) {      asm.emitPOP_Reg(S0);	// the one integer argument      asm.emitMOV_Reg_Reg(T0, SP);	// T0 <- SP      asm.emitPUSH_Reg(EBX);	// save three nonvolatiles: EBX      asm.emitPUSH_Reg(ESI);	      asm.emitPUSH_Reg(JTOC);	// JTOC aka EDI      asm.emitPUSH_Reg(S0);	// push arg on stack      asm.emitCALL_RegInd(T0);	// branch to C code      asm.emitPOP_Reg(S0);	// pop the argument       asm.emitPOP_Reg(JTOC);	// restore the three nonvolatiles      asm.emitPOP_Reg(ESI);      asm.emitPOP_Reg(EBX);      asm.emitMOV_RegInd_Reg(SP, T1);	// store return value: hi half      asm.emitPUSH_Reg(T0);	// low half      return true;    }        if (methodName == VM_MagicNames.sysCallAD) {  // address, double      // C require its arguments reversed      asm.emitMOV_Reg_RegInd(T0, SP);			// load 2nd arg      asm.emitMOV_RegDisp_Reg(SP, -2*WORDSIZE, T0);	// store 2nd arg      asm.emitMOV_Reg_RegDisp(T0, SP, WORDSIZE);	// load 2nd arg      asm.emitMOV_RegDisp_Reg(SP, -1*WORDSIZE, T0);	// store 2nd arg      asm.emitMOV_Reg_RegDisp(T0, SP, 2*WORDSIZE);	// load 1st arg      asm.emitMOV_RegDisp_Reg(SP, -3*WORDSIZE, T0);	// store 1st arg      asm.emitMOV_Reg_Reg(T0, SP);			// T0 <- SP      asm.emitMOV_RegDisp_Reg(SP, 2*WORDSIZE, EBX);	// save three nonvolatiles: EBX      asm.emitMOV_RegDisp_Reg(SP, 1*WORDSIZE, ESI);	      asm.emitMOV_RegInd_Reg(SP, JTOC);			// JTOC aka EDI      asm.emitADD_Reg_Imm(SP, -3*WORDSIZE);		// grow the stack      asm.emitCALL_RegDisp(T0, 3*WORDSIZE); // 4th word on orig. stack is address to call      asm.emitADD_Reg_Imm(SP, WORDSIZE*3);		// pop the arguments       asm.emitPOP_Reg(JTOC);	// restore the three nonvolatiles      asm.emitPOP_Reg(ESI);      asm.emitPOP_Reg(EBX);      asm.emitMOV_RegInd_Reg(SP, T0);			// store return value      return true;    }    /*     * A special version of sysCall2, for invoking sigWait and allowing     * collection of the frame making the call.  The signature of the     * magic is shared between powerPC and intel to simplify the caller.     * The signature is     * address to "call"     * toc or undefined for intel     * address of a lock/barrier which will be passed to sigWait     * value to store into the lock/barrier, also passed to sigWait.       * the VM_Register object of the executing thread.     *     * The magic stores the current ip/fp into the VM_Register, to     * allow collection of this thread from the current frame and below.     * It then reverses the order of the two parameters on the stack to     * conform to C calling convention, and finally invokes sigwait.     *     * stack:     *	low memory     *		ip -- address of sysPthreadSigWait in sys.C     *		toc --     *          p1 -- address of lockword     *		p2 -- value to store in lockword     *          address of VM_Register object for this thread     *	high mem     * This to be invoked from baseline code only.     */    if (methodName == VM_MagicNames.sysCallSigWait) {      int   fpOffset = VM_Entrypoints.registersFPField.getOffset();      int   ipOffset = VM_Entrypoints.registersIPField.getOffset();      int gprsOffset = VM_Entrypoints.registersGPRsField.getOffset();      asm.emitMOV_Reg_RegInd(T0, SP);	                // T0 <- context register obj @      asm.emitLEA_Reg_RegDisp(S0, SP, fp2spOffset(0));  // compute FP      asm.emitMOV_RegDisp_Reg(T0, fpOffset, S0);	// store fp in context      asm.emitCALL_Imm (asm.getMachineCodeIndex() + 5);      asm.emitPOP_Reg(T1);				// T1 <- IP      asm.emitMOV_RegDisp_Reg(T0, ipOffset, T1);	// store ip in context      asm.emitMOV_Reg_RegDisp(T0, T0, gprsOffset);	// T0 <- grps array @      asm.emitMOV_Reg_RegDisp(T1, SP, WORDSIZE);	// second arg      asm.emitMOV_Reg_RegDisp(S0, SP, 2*WORDSIZE);	// first arg      asm.emitMOV_Reg_Reg(T0, SP);	// T0 <- [sysPthreadSigWait @]      asm.emitADD_Reg_Imm(T0, 4*WORDSIZE);      asm.emitPUSH_Reg(JTOC);	// save JTOC aka EDI      asm.emitPUSH_Reg(T1);	// reorder arguments for C       asm.emitPUSH_Reg(S0);	// reorder arguments for C      asm.emitCALL_RegInd(T0);	// branch to C code      asm.emitADD_Reg_Imm(SP, WORDSIZE*2);	// pop the arguments       asm.emitPOP_Reg(JTOC);	// restore JTOC      asm.emitADD_Reg_Imm(SP, WORDSIZE*4);	// pop all but last      asm.emitMOV_RegInd_Reg(SP, T0);	// overwrite last with return value      return true;    }        if (methodName == VM_MagicNames.getFramePointer) {      asm.emitLEA_Reg_RegDisp(S0, SP, fp2spOffset(0));      asm.emitPUSH_Reg       (S0);      return true;    }        if (methodName == VM_MagicNames.getCallerFramePointer) {      asm.emitPOP_Reg(T0);                                       // Callee FP      asm.emitPUSH_RegDisp(T0, STACKFRAME_FRAME_POINTER_OFFSET); // Caller FP      return true;    }    if (methodName == VM_MagicNames.setCallerFramePointer) {      asm.emitPOP_Reg(T0);  // value      asm.emitPOP_Reg(S0);  // fp      asm.emitMOV_RegDisp_Reg(S0, STACKFRAME_FRAME_POINTER_OFFSET, T0); // [S0+SFPO] <- T0      return true;    }    if (methodName == VM_MagicNames.getCompiledMethodID) {      asm.emitPOP_Reg(T0);                                   // Callee FP      asm.emitPUSH_RegDisp(T0, STACKFRAME_METHOD_ID_OFFSET); // Callee CMID      return true;    }    if (methodName == VM_MagicNames.setCompiledMethodID) {      asm.emitPOP_Reg(T0);  // value      asm.emitPOP_Reg(S0);  // fp      asm.emitMOV_RegDisp_Reg(S0, STACKFRAME_METHOD_ID_OFFSET, T0); // [S0+SMIO] <- T0      return true;    }    if (methodName == VM_MagicNames.getReturnAddressLocation) {      asm.emitPOP_Reg(T0);                                        // Callee FP      asm.emitADD_Reg_Imm(T0, STACKFRAME_RETURN_ADDRESS_OFFSET);  // location containing callee return address      asm.emitPUSH_Reg(T0);                                       // Callee return address      return true;    }        if (methodName == VM_MagicNames.getTocPointer ||	methodName == VM_MagicNames.getJTOC ) {      asm.emitPUSH_Reg(JTOC);      return true;    }        if (methodName == VM_MagicNames.getThreadId) {      VM_ProcessorLocalState.emitPushField(asm,VM_Entrypoints.threadIdField.getOffset());      return true;    }           // set the Thread id register (not really a register)    if (methodName == VM_MagicNames.setThreadId) {      VM_ProcessorLocalState.emitPopField(asm,VM_Entrypoints.threadIdField.getOffset());       return true;    }        // get the processor register (PR)    if (methodName == VM_MagicNames.getProcessorRegister) {      asm.emitPUSH_Reg(PR);      return true;    }      // set the processor register (PR)    if (methodName == VM_MagicNames.setProcessorRegister) {      asm.emitPOP_Reg(PR);      return true;    }        // Get the value in ESI     if (methodName == VM_MagicNames.getESIAsProcessor) {      asm.emitPUSH_Reg(ESI);      return true;    }      // Set the value in ESI    if (methodName == VM_MagicNames.setESIAsProcessor) {      asm.emitPOP_Reg(ESI);      return true;    }      if (methodName == VM_MagicNames.getIntAtOffset ||	methodName == VM_MagicNames.getObjectAtOffset ||	methodName == VM_MagicNames.getObjectArrayAtOffset ||	methodName == VM_MagicNames.prepare) {      asm.emitPOP_Reg (T0);                  // object ref      asm.emitPOP_Reg (S0);                  // offset      asm.emitPUSH_RegIdx(T0, S0, asm.BYTE, 0); // pushes [T0+S0]      return true;    }        if (methodName == VM_MagicNames.getByteAtOffset) {      asm.emitPOP_Reg (T0);                  // object ref      asm.emitPOP_Reg (S0);                  // offset      asm.emitMOV_Reg_RegIdx_Byte(T0, T0, S0, asm.BYTE, 0); // load and zero extend byte [T0+S0]      asm.emitPUSH_Reg (T0);      return true;    }        if (methodName == VM_MagicNames.setIntAtOffset ||	methodName == VM_MagicNames.setObjectAtOffset ) {      asm.emitPOP_Reg(T0);                   // value      asm.emitPOP_Reg(S0);                   // offset      asm.emitPOP_Reg(T1);                   // obj ref      asm.emitMOV_RegIdx_Reg(T1, S0, asm.BYTE, 0, T0); // [T1+S0] <- T0      return true;    }        if (methodName == VM_MagicNames.setByteAtOffset) {      asm.emitPOP_Reg(T0);                   // value      asm.emitPOP_Reg(S0);                   // offset      asm.emitPOP_Reg(T1);                   // obj ref      asm.emitMOV_RegIdx_Reg_Byte(T1, S0, asm.BYTE, 0, T0); // [T1+S0] <- (byte) T0      return true;    }        if (methodName == VM_MagicNames.getLongAtOffset) {      asm.emitPOP_Reg (T0);                  // object ref      asm.emitPOP_Reg (S0);                  // offset      asm.emitPUSH_RegIdx(T0, S0, asm.BYTE, 4); // pushes [T0+S0+4]      asm.emitPUSH_RegIdx(T0, S0, asm.BYTE, 0); // pushes [T0+S0]      return true;    }        if ((methodName == VM_MagicNames.setLongAtOffset)       || (methodName == VM_MagicNames.setDoubleAtOffset)) {      asm.emitMOV_Reg_RegInd (T0, SP);		// value high      asm.emitMOV_Reg_RegDisp(S0, SP, +8 );	// offset      asm.emitMOV_Reg_RegDisp(T1, SP, +12);	// obj ref      asm.emitMOV_RegIdx_Reg (T1, S0, asm.BYTE, 0, T0); // [T1+S0] <- T0      asm.emitMOV_Reg_RegDisp(T0, SP, +4 );	// value low      asm.emitMOV_RegIdx_Reg (T1, S0, asm.BYTE, 4, T0); // [T1+S0+4] <- T0      asm.emitADD_Reg_Imm    (SP, WORDSIZE * 4); // pop stack locations      return true;    }        if (methodName == VM_MagicNames.getMemoryInt ||	methodName == VM_MagicNames.getMemoryWord ||	methodName == VM_MagicNames.getMemoryAddress) {      asm.emitPOP_Reg(T0);	// address      asm.emitPUSH_RegInd(T0); // pushes [T0+0]      return true;    }    if (methodName == VM_MagicNames.setMemoryInt ||	methodName == VM_MagicNames.setMemoryWord ||	methodName == VM_MagicNames.setMemoryAddress) {      asm.emitPOP_Reg(T0);  // value      asm.emitPOP_Reg(S0);  // address      asm.emitMOV_RegInd_Reg(S0,T0); // [S0+0] <- T0      return true;    }        if (methodName == VM_MagicNames.objectAsAddress         ||	methodName == VM_MagicNames.addressAsByteArray      ||	methodName == VM_MagicNames.addressAsIntArray       ||	methodName == VM_MagicNames.addressAsObject         ||	methodName == VM_MagicNames.addressAsObjectArray    ||	methodName == VM_MagicNames.addressAsType           ||	methodName == VM_MagicNames.objectAsType            ||	methodName == VM_MagicNames.objectAsShortArray      ||	methodName == VM_MagicNames.objectAsByteArray       ||	methodName == VM_MagicNames.objectAsIntArray       ||	methodName == VM_MagicNames.addressAsThread         ||	methodName == VM_MagicNames.objectAsThread          ||	methodName == VM_MagicNames.objectAsProcessor       ||//-#if RVM_WITH_JIKESRVM_MEMORY_MANAGERS	methodName == VM_MagicNames.addressAsBlockControl   ||	methodName == VM_MagicNames.addressAsSizeControl    ||	methodName == VM_MagicNames.addressAsSizeControlArray   ||//-#endif	methodName == VM_MagicNames.threadAsCollectorThread ||	methodName == VM_MagicNames.addressAsRegisters      ||	methodName == VM_MagicNames.addressAsStack          ||	methodName == VM_MagicNames.floatAsIntBits          ||	methodName == VM_MagicNames.intBitsAsFloat          ||	methodName == VM_MagicNames.doubleAsLongBits        ||	methodName == VM_MagicNames.longBitsAsDouble)      {	// no-op (a type change, not a representation change)	return true;      }        // code for      VM_Type VM_Magic.getObjectType(Object object)    if (methodName == VM_MagicNames.getObjectType) {      asm.emitPOP_Reg (T0);			          // object ref      VM_ObjectModel.baselineEmitLoadTIB(asm,S0,T0);      asm.emitPUSH_RegDisp(S0, TIB_TYPE_INDEX<<LG_WORDSIZE); // push VM_Type slot of TIB      return true;    }        if (methodName == VM_MagicNames.getArrayLength) {      asm.emitPOP_Reg(T0);			// object ref      asm.emitPUSH_RegDisp(T0, VM_ObjectModel.getArrayLengthOffset());       return true;    }        if (methodName == VM_MagicNames.sync) {  // nothing required on IA32      return true;    }        if (methodName == VM_MagicNames.isync) { // nothing required on IA32      return true;    }        // baseline compiled invocation only: all paramaters on the stack    // hi mem    //      Code    //      GPRs    //      FPRs    //      Spills    // low-mem    if (methodName == VM_MagicNames.invokeMethodReturningVoid) {      int offset = VM_Entrypoints.reflectiveMethodInvokerInstructionsField.getOffset();      genParameterRegisterLoad(4); // pass 4 parameter words      asm.emitCALL_RegDisp(JTOC, offset);      return true;    }                     if (methodName == VM_MagicNames.invokeMethodReturningInt) {      int offset = VM_Entrypoints.reflectiveMethodInvokerInstructionsField.getOffset();      genParameterRegisterLoad(4); // pass 4 parameter words      asm.emitCALL_RegDisp(JTOC, offset);      asm.emitPUSH_Reg(T0);      return true;    }                     if (methodName == VM_MagicNames.invokeMethodReturningLong) {      int offset = VM_Entrypoints.reflectiveMethodInvokerInstructionsField.getOffset();      genParameterRegisterLoad(4); // pass 4 parameter words      asm.emitCALL_RegDisp(JTOC, offset);      asm.emitPUSH_Reg(T0); // high half      asm.emitPUSH_Reg(T1); // low half      return true;    }                     if (methodName == VM_MagicNames.invokeMethodReturningFloat) {      int offset = VM_Entrypoints.reflectiveMethodInvokerInstructionsField.getOffset();      genParameterRegisterLoad(4); // pass 4 parameter words      asm.emitCALL_RegDisp(JTOC, offset);      asm.emitSUB_Reg_Imm  (SP, 4);      asm.emitFSTP_RegInd_Reg(SP, FP0);      return true;    }                     if (methodName == VM_MagicNames.invokeMethodReturningDouble) {      int offset = VM_Entrypoints.reflectiveMethodInvokerInstructionsField.getOffset();      genParameterRegisterLoad(4); // pass 4 parameter words      asm.emitCALL_RegDisp(JTOC, offset);      asm.emitSUB_Reg_Imm  (SP, 8);      asm.emitFSTP_RegInd_Reg_Quad(SP, FP0);      return true;    }                     if (methodName == VM_MagicNames.invokeMethodReturningObject) {      int offset = VM_Entrypoints.reflectiveMethodInvokerInstructionsField.getOffset();      genParameterRegisterLoad(4); // pass 4 parameter words      asm.emitCALL_RegDisp(JTOC, offset);      asm.emitPUSH_Reg(T0);      return true;    }                     // baseline invocation    // one paramater, on the stack  -- actual code    if (methodName == VM_MagicNames.dynamicBridgeTo) {      if (VM.VerifyAssertions) VM._assert(klass.isDynamicBridge());      // save the branch address for later      asm.emitPOP_Reg (S0);		// S0<-code address      asm.emitADD_Reg_Imm(SP, fp2spOffset(0) - 4); // just popped 4 bytes above.      // restore FPU state      asm.emitFRSTOR_RegDisp(SP, FPU_SAVE_OFFSET);      // restore GPRs      asm.emitMOV_Reg_RegDisp (T0,  SP, T0_SAVE_OFFSET);       asm.emitMOV_Reg_RegDisp (T1,  SP, T1_SAVE_OFFSET);       asm.emitMOV_Reg_RegDisp (EBX, SP, EBX_SAVE_OFFSET);       asm.emitMOV_Reg_RegDisp (JTOC,  SP, JTOC_SAVE_OFFSET);       // pop frame      asm.emitPOP_RegDisp (PR, VM_Entrypoints.framePointerField.getOffset()); // FP<-previous FP       // branch      asm.emitJMP_Reg (S0);      return true;    }                                                      if (methodName == VM_MagicNames.returnToNewStack) {      // SP gets frame pointer for new stack      asm.emitPOP_Reg (SP);	      // restore nonvolatile registers      asm.emitMOV_Reg_RegDisp (JTOC, SP, JTOC_SAVE_OFFSET);      asm.emitMOV_Reg_RegDisp (EBX, SP, EBX_SAVE_OFFSET);      // discard current stack frame      asm.emitPOP_RegDisp (PR, VM_Entrypoints.framePointerField.getOffset());      // return to caller- pop parameters from stack      asm.emitRET_Imm(parameterWords << LG_WORDSIZE);	       return true;    }    if (methodName == VM_MagicNames.roundToZero) {      // Store the FPU Control Word to a JTOC slot      asm.emitFNSTCW_RegDisp(JTOC, VM_Entrypoints.FPUControlWordField.getOffset());      // Set the bits in the status word that control round to zero.      // Note that we use a 32-bit OR, even though we only care about the      // low-order 16 bits      asm.emitOR_RegDisp_Imm(JTOC,VM_Entrypoints.FPUControlWordField.getOffset(), 0x00000c00);      // Now store the result back into the FPU Control Word      asm.emitFLDCW_RegDisp(JTOC,VM_Entrypoints.FPUControlWordField.getOffset());      return true;    }    if (methodName == VM_MagicNames.clearFloatingPointState) {      // Clear the hardware floating-point state      asm.emitFNINIT();      return true;    }        if (methodName == VM_MagicNames.getTime) {      VM.sysWrite("WARNING: VM_Compiler compiling unimplemented magic: getTime in " + method + "\n");      asm.emitMOV_RegInd_Imm(SP, 0);  // TEMP!! for now, return 0      return true;    }    if (methodName == VM_MagicNames.getTimeBase) {      asm.emitRDTSC();  // read timestamp counter instruction      asm.emitPUSH_Reg(EDX); // upper 32 bits      asm.emitPUSH_Reg(EAX); // lower 32 bits      return true;    }    if (methodName == VM_MagicNames.wordFromInt ||	methodName == VM_MagicNames.wordToInt ||	methodName == VM_MagicNames.wordToAddress ||	methodName == VM_MagicNames.wordToWord) {	// no-op	return true;    }    if (methodName == VM_MagicNames.wordAnd) {	asm.emitPOP_Reg(T0);	asm.emitAND_RegInd_Reg(SP, T0);	return true;    }    if (methodName == VM_MagicNames.wordOr) {	asm.emitPOP_Reg(T0);	asm.emitOR_RegInd_Reg(SP, T0);	return true;    }    if (methodName == VM_MagicNames.wordXor) {	asm.emitPOP_Reg(T0);	asm.emitXOR_RegInd_Reg(SP, T0);	return true;    }    if (methodName == VM_MagicNames.wordNot) {        asm.emitNOT_RegInd (SP);	return true;    }    if (methodName == VM_MagicNames.wordAdd) {	asm.emitPOP_Reg(T0);	asm.emitADD_RegInd_Reg(SP, T0);	return true;    }    if (methodName == VM_MagicNames.wordSub ||	methodName == VM_MagicNames.wordDiff) {	asm.emitPOP_Reg(T0);	asm.emitSUB_RegInd_Reg(SP, T0);	return true;    }    if (methodName == VM_MagicNames.wordZero) {	asm.emitPUSH_Imm(0);	return true;    }    if (methodName == VM_MagicNames.wordMax) {	asm.emitPUSH_Imm(-1);	return true;    }    if (methodName == VM_MagicNames.wordLT) {	generateAddrComparison(asm.LLT);	return true;    }    if (methodName == VM_MagicNames.wordLE) {	generateAddrComparison(asm.LLE);	return true;    }    if (methodName == VM_MagicNames.wordGT) {	generateAddrComparison(asm.LGT);	return true;    }    if (methodName == VM_MagicNames.wordGE) {	generateAddrComparison(asm.LGE);	return true;    }    if (methodName == VM_MagicNames.wordEQ) {	generateAddrComparison(asm.EQ);	return true;    }    if (methodName == VM_MagicNames.wordNE) {	generateAddrComparison(asm.NE);	return true;    }    if (methodName == VM_MagicNames.wordIsZero) {	asm.emitPUSH_Imm(0);	generateAddrComparison(asm.EQ);	return true;    }    if (methodName == VM_MagicNames.wordIsMax) {	asm.emitPUSH_Imm(-1);	generateAddrComparison(asm.EQ);	return true;    }						         return false;      }