} else vOffset -=  BYTES_IN_STACKSLOT;
} else vOffset = vOffset.sub( BYTES_IN_STACKSLOT);
  private static void getVariableValue(byte[] stack,                                       int   offset,                                       byte[] types,                                       VM_BaselineCompiledMethod compiledMethod,                                       VM_CodeArray instructions,                                       int   kind,                                       OSR_ExecutionState state) {    int size = types.length;    int vOffset = offset;    for (int i=0; i<size; i++) {      switch (types[i]) {      case VoidTypeCode:        vOffset -= BYTES_IN_STACKSLOT;        break;      case BooleanTypeCode:      case ByteTypeCode:      case ShortTypeCode:      case CharTypeCode:      case IntTypeCode:      case FloatTypeCode:{        int value = VM_Magic.getIntAtOffset(stack, vOffset - BYTES_IN_INT);        vOffset -= BYTES_IN_STACKSLOT;                  int tcode = (types[i] == FloatTypeCode) ? FLOAT : INT;        state.add(new OSR_VariableElement(kind,                                         i,                                         tcode,                                         value));        break;      }      case LongTypeCode:       case DoubleTypeCode: {      //KV: this code would be nicer if VoidTypeCode would always follow a 64-bit value. Rigth now for LOCAL it follows, for STACK it proceeds        int memoff =           (kind == LOCAL) ? (vOffset-BYTES_IN_DOUBLE) : VM.BuildFor64Addr? vOffset : (vOffset - BYTES_IN_STACKSLOT);        long value = VM_Magic.getLongAtOffset(stack, memoff);                int tcode = (types[i] == LongTypeCode) ? LONG : DOUBLE;        state.add(new OSR_VariableElement(kind,                                         i,                                         tcode,                                         value));        if (kind == LOCAL) { //KV:VoidTypeCode is next          vOffset -= 2*BYTES_IN_STACKSLOT;          i++; //KV:skip VoidTypeCode        } else vOffset -=  BYTES_IN_STACKSLOT; //KV:VoidTypeCode was already in front        break;      }      case ReturnAddressTypeCode: {        VM.disableGC();        Address rowIP = VM_Magic.objectAsAddress(stack).add(vOffset - BYTES_IN_ADDRESS).loadAddress();        int ipIndex = rowIP.diff(VM_Magic.objectAsAddress(instructions)).toInt() >> LG_INSTRUCTION_WIDTH;        VM.enableGC();        vOffset -= BYTES_IN_STACKSLOT;        if (VM.TraceOnStackReplacement) {          VM.sysWrite("baseline ret_addr ip "+ipIndex+" --> ");        }                int bcIndex =           compiledMethod.findBytecodeIndexForInstruction(ipIndex+1);        if (VM.TraceOnStackReplacement) {          VM.sysWrite(" bc "+ bcIndex+"\n");        }                state.add(new OSR_VariableElement(kind,                                         i,                                         RET_ADDR,                                         bcIndex));        break;      }      case ClassTypeCode:       case ArrayTypeCode: {        VM.disableGC();        Object ref = VM_Magic.getObjectAtOffset(stack, vOffset - BYTES_IN_ADDRESS);        VM.enableGC();        vOffset -= BYTES_IN_STACKSLOT;        state.add(new OSR_VariableElement(kind,                                         i,                                         REF,                                         ref));        break;      }      case WordTypeCode: {        Word value = VM_Magic.getWordAtOffset(stack, vOffset - BYTES_IN_ADDRESS);        vOffset -= BYTES_IN_STACKSLOT;                  state.add(new OSR_VariableElement(kind,                                         i,                                         WORD,                                         value));        break;      }      default:        if (VM.VerifyAssertions) VM._assert(VM.NOT_REACHED);        break;      } // switch     } // for loop  }  