int offset = sig.getIMTOffset();
int offset = sig.getIMTOffset().toInt();
  protected final void emit_invokeinterface(VM_MethodReference methodRef) {    int count = methodRef.getParameterWords() + 1; // +1 for "this" parameter    VM_Method resolvedMethod = null;    resolvedMethod = methodRef.peekInterfaceMethod();    // (1) Emit dynamic type checking sequence if required to     // do so inline.    if (VM.BuildForIMTInterfaceInvocation ||         (VM.BuildForITableInterfaceInvocation &&          VM.DirectlyIndexedITables)) {      if (resolvedMethod == null) {        // Can't successfully resolve it at compile time.        // Call uncommon case typechecking routine to do the right thing when this code actually executes.        asm.emitLAddrToc(T0, VM_Entrypoints.unresolvedInvokeinterfaceImplementsTestMethod.getOffset());        asm.emitMTCTR(T0);        asm.emitLVAL(T0, methodRef.getId());            // id of method reference we are trying to call        peekAddr(T1, count-1);           // the "this" object        VM_ObjectModel.baselineEmitLoadTIB(asm,T1,T1);        asm.emitBCCTRL();                 // throw exception, if link error      } else {        // normal case.  Not a ghost ref.        asm.emitLAddrToc(T0, VM_Entrypoints.invokeinterfaceImplementsTestMethod.getOffset());        asm.emitMTCTR(T0);        asm.emitLAddrToc(T0, resolvedMethod.getDeclaringClass().getTibOffset()); // tib of the interface method        asm.emitLAddr(T0, TIB_TYPE_INDEX << LOG_BYTES_IN_ADDRESS, T0);                   // type of the interface method        peekAddr(T1, count-1);                        // the "this" object        VM_ObjectModel.baselineEmitLoadTIB(asm,T1,T1);        asm.emitBCCTRL();                              // throw exception, if link error      }    }    // (2) Emit interface invocation sequence.    if (VM.BuildForIMTInterfaceInvocation) {      VM_InterfaceMethodSignature sig = VM_InterfaceMethodSignature.findOrCreate(methodRef);      int offset = sig.getIMTOffset();      genMoveParametersToRegisters(true, methodRef); // T0 is "this"      VM_ObjectModel.baselineEmitLoadTIB(asm,S0,T0);      if (VM.BuildForIndirectIMT) {        // Load the IMT base into S0        asm.emitLAddr(S0, TIB_IMT_TIB_INDEX << LOG_BYTES_IN_ADDRESS, S0);      }      asm.emitLAddr(S0, offset, S0);                  // the method address      asm.emitMTCTR(S0);      asm.emitLVAL(S1, sig.getId());      // pass "hidden" parameter in S1 scratch  register      asm.emitBCCTRL();    } else if (VM.BuildForITableInterfaceInvocation &&                VM.DirectlyIndexedITables &&                resolvedMethod != null) {      VM_Class I = resolvedMethod.getDeclaringClass();      genMoveParametersToRegisters(true, methodRef);        //T0 is "this"      VM_ObjectModel.baselineEmitLoadTIB(asm,S0,T0);      asm.emitLAddr (S0, TIB_ITABLES_TIB_INDEX << LOG_BYTES_IN_ADDRESS, S0); // iTables       asm.emitLAddr (S0, I.getInterfaceId() << LOG_BYTES_IN_ADDRESS, S0);  // iTable      int idx = VM_InterfaceInvocation.getITableIndex(I, methodRef.getName(), methodRef.getDescriptor());      asm.emitLAddr(S0, idx << LOG_BYTES_IN_ADDRESS, S0); // the method to call      asm.emitMTCTR(S0);      asm.emitBCCTRL();    } else {      int itableIndex = -1;      if (VM.BuildForITableInterfaceInvocation && resolvedMethod != null) {        // get the index of the method in the Itable        itableIndex = VM_InterfaceInvocation.getITableIndex(resolvedMethod.getDeclaringClass(),                                                             methodRef.getName(), methodRef.getDescriptor());      }      if (itableIndex == -1) {        // itable index is not known at compile-time.        // call "invokeInterface" to resolve object + method id into method address        int methodRefId = methodRef.getId();        asm.emitLAddrToc(T0, VM_Entrypoints.invokeInterfaceMethod.getOffset());        asm.emitMTCTR(T0);        peekAddr(T0, count-1); // object        asm.emitLVAL(T1, methodRefId);        // method id        asm.emitBCCTRL();       // T0 := resolved method address        asm.emitMTCTR(T0);        genMoveParametersToRegisters(true, methodRef);        asm.emitBCCTRL();      } else {        // itable index is known at compile-time.        // call "findITable" to resolve object + interface id into         // itable address        asm.emitLAddrToc(T0, VM_Entrypoints.findItableMethod.getOffset());        asm.emitMTCTR(T0);        peekAddr(T0, count-1);     // object        VM_ObjectModel.baselineEmitLoadTIB(asm,T0,T0);        asm.emitLVAL(T1, resolvedMethod.getDeclaringClass().getInterfaceId());    // interface id        asm.emitBCCTRL();   // T0 := itable reference        asm.emitLAddr(T0, itableIndex << LOG_BYTES_IN_ADDRESS, T0); // T0 := the method to call        asm.emitMTCTR(T0);        genMoveParametersToRegisters(true, methodRef);        //T0 is "this"        asm.emitBCCTRL();      }    }    genPopParametersAndPushReturnValue(true, methodRef);  }