if (VM.BuildFor32Addr) { argObjectArray[i] = VM_Reflection.wrapBoolean((hiword.toInt() & 0xFF000000) >>> 24); } else { argObjectArray[i] = VM_Reflection.wrapBoolean((int)((hiword.toLong() & 0xFF00000000000000L) >>> 56)); }
argObjectArray[i] = VM_Reflection.wrapBoolean((int) (hiword  >>> (BITS_IN_ADDRESS - BITS_IN_BOOLEAN)));
  static Object[] packageParameterFromJValue(VM_Method targetMethod, Address argAddress) {    VM_TypeReference[] argTypes = targetMethod.getParameterTypes();    int argCount = argTypes.length;    Object[] argObjectArray = new Object[argCount];    // get the VM_JNIEnvironment for this thread in case we need to dereference any object arg    VM_JNIEnvironment env = VM_Thread.getCurrentThread().getJNIEnv();    // VM.sysWrite("JNI packageParameterFromJValue: packaging " + argCount + " arguments\n");    for (int i=0; i<argCount; i++) {      Address addr = argAddress.add(BYTES_IN_DOUBLE*i);      Word hiword = addr.loadWord();      Word loword;      if (VM.BuildFor32Addr) {        loword = addr.add(BYTES_IN_ADDRESS).loadWord();      }      // VM.sysWrite("JNI packageParameterFromJValue:  arg " + i + " = " + hiword +       //          " or " + VM.intAsHexString(hiword) + "\n");      // convert and wrap the argument according to the expected type      if (argTypes[i].isFloatType()) {        if (VM.BuildFor32Addr) {          argObjectArray[i] = VM_Reflection.wrapFloat(Float.intBitsToFloat(hiword.toInt()));        } else {          argObjectArray[i] = VM_Reflection.wrapFloat(Float.intBitsToFloat((int)((hiword.toLong() & 0xFFFFFFFF00000000L)>>>32)));        }      } else if (argTypes[i].isDoubleType()) {        if (VM.BuildFor32Addr) {          long doubleBits = (((long) hiword.toInt()) << BITS_IN_INT) | (loword.toInt() & 0xFFFFFFFFL);          argObjectArray[i] = VM_Reflection.wrapDouble(Double.longBitsToDouble(doubleBits));        } else {          argObjectArray[i] = VM_Reflection.wrapDouble(Double.longBitsToDouble(hiword.toLong()));        }      } else if (argTypes[i].isLongType()) {         if (VM.BuildFor32Addr) {          long longValue = (((long) hiword.toInt()) << BITS_IN_INT) | (loword.toInt() & 0xFFFFFFFFL);          argObjectArray[i] = VM_Reflection.wrapLong(longValue);        } else {          argObjectArray[i] = VM_Reflection.wrapLong(hiword.toLong());        }      } else if (argTypes[i].isBooleanType()) {        // the 0/1 bit is stored in the high byte               if (VM.BuildFor32Addr) {          argObjectArray[i] = VM_Reflection.wrapBoolean((hiword.toInt() & 0xFF000000) >>> 24);        } else {          argObjectArray[i] = VM_Reflection.wrapBoolean((int)((hiword.toLong() & 0xFF00000000000000L) >>> 56));        }      } else if (argTypes[i].isByteType()) {        if (VM.BuildFor32Addr) {          // the target byte is stored in the high byte          argObjectArray[i] = VM_Reflection.wrapByte((byte) ((hiword.toInt() & 0xFF000000) >>> 24));        } else {          argObjectArray[i] = VM_Reflection.wrapByte((byte) ((hiword.toLong() & 0xFF00000000000000L) >>> 56));        }      } else if (argTypes[i].isCharType()) {        // char is stored in the high 2 bytes        if (VM.BuildFor32Addr) {          argObjectArray[i] = VM_Reflection.wrapChar((char) ((hiword.toInt() & 0xFFFF0000) >>> 16));        } else {          argObjectArray[i] = VM_Reflection.wrapChar((char) ((hiword.toLong() & 0xFFFF000000000000L) >>> 48));        }      } else if (argTypes[i].isShortType()) {        // short is stored in the high 2 bytes        if (VM.BuildFor32Addr) {          argObjectArray[i] = VM_Reflection.wrapShort((short) ((hiword.toInt() & 0xFFFF0000) >>> 16));        } else {          argObjectArray[i] = VM_Reflection.wrapShort((short) ((hiword.toLong() & 0xFFFF000000000000L) >>> 48));        }      } else if (argTypes[i].isReferenceType()) {        // for object, the arg is a JREF index, dereference to get the real object        argObjectArray[i] =  env.getJNIRef(hiword.toInt());         } else if (argTypes[i].isIntType()) {        if (VM.BuildFor32Addr) {          argObjectArray[i] = VM_Reflection.wrapInt(hiword.toInt());        } else {          argObjectArray[i] = VM_Reflection.wrapInt((int) ((hiword.toLong() & 0xFFFFFFFF00000000L) >>> 32));        }      } else {        return null;      }    }    return argObjectArray;  }