src/java.base/share/native/libjava/Bits.c
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File jdk Cdiff src/java.base/share/native/libjava/Bits.c

src/java.base/share/native/libjava/Bits.c

Print this page

        

*** 56,80 **** Java_java_nio_Bits_copyFromShortArray(JNIEnv *env, jclass clazz, jobject src, jlong srcPos, jlong dstAddr, jlong length) { jbyte *bytes; size_t size; ! jshort *srcShort, *dstShort, *endShort; ! jshort tmpShort; ! dstShort = (jshort *)jlong_to_ptr(dstAddr); while (length > 0) { size = (length < MBYTE) ? (size_t)length : (size_t)MBYTE; GETCRITICAL_OR_RETURN(bytes, env, src); srcShort = (jshort *)(bytes + srcPos); ! endShort = srcShort + (size / sizeof(jshort)); while (srcShort < endShort) { ! tmpShort = *srcShort++; ! *dstShort++ = SWAPSHORT(tmpShort); } RELEASECRITICAL(bytes, env, src, JNI_ABORT); length -= size; --- 56,82 ---- Java_java_nio_Bits_copyFromShortArray(JNIEnv *env, jclass clazz, jobject src, jlong srcPos, jlong dstAddr, jlong length) { jbyte *bytes; size_t size; ! jshort *srcShort, *endShort; ! unsigned char* dst; ! dst = jlong_to_ptr(dstAddr); while (length > 0) { size = (length < MBYTE) ? (size_t)length : (size_t)MBYTE; GETCRITICAL_OR_RETURN(bytes, env, src); srcShort = (jshort *)(bytes + srcPos); ! endShort = (jshort *)(bytes + srcPos + size); while (srcShort < endShort) { ! jshort tmp = SWAPSHORT(*srcShort); ! memcpy(dst, &tmp, sizeof(jshort)); ! srcShort++; ! dst += sizeof(jshort); } RELEASECRITICAL(bytes, env, src, JNI_ABORT); length -= size;
*** 86,110 **** Java_java_nio_Bits_copyToShortArray(JNIEnv *env, jclass clazz, jlong srcAddr, jobject dst, jlong dstPos, jlong length) { jbyte *bytes; size_t size; ! jshort *srcShort, *dstShort, *endShort; ! jshort tmpShort; ! srcShort = (jshort *)jlong_to_ptr(srcAddr); while (length > 0) { size = (length < MBYTE) ? (size_t)length : (size_t)MBYTE; GETCRITICAL_OR_RETURN(bytes, env, dst); dstShort = (jshort *)(bytes + dstPos); ! endShort = srcShort + (size / sizeof(jshort)); ! while (srcShort < endShort) { ! tmpShort = *srcShort++; ! *dstShort++ = SWAPSHORT(tmpShort); } RELEASECRITICAL(bytes, env, dst, 0); length -= size; --- 88,114 ---- Java_java_nio_Bits_copyToShortArray(JNIEnv *env, jclass clazz, jlong srcAddr, jobject dst, jlong dstPos, jlong length) { jbyte *bytes; size_t size; ! jshort *dstShort; ! unsigned char *src, *end; ! src = jlong_to_ptr(srcAddr); while (length > 0) { size = (length < MBYTE) ? (size_t)length : (size_t)MBYTE; GETCRITICAL_OR_RETURN(bytes, env, dst); dstShort = (jshort *)(bytes + dstPos); ! end = src + size; ! while (src < end) { ! jshort tmp; ! memcpy(&tmp, src, sizeof(jshort)); ! *dstShort++ = SWAPSHORT(tmp); ! src += sizeof(jshort); } RELEASECRITICAL(bytes, env, dst, 0); length -= size;
*** 116,140 **** Java_java_nio_Bits_copyFromIntArray(JNIEnv *env, jclass clazz, jobject src, jlong srcPos, jlong dstAddr, jlong length) { jbyte *bytes; size_t size; ! jint *srcInt, *dstInt, *endInt; ! jint tmpInt; ! dstInt = (jint *)jlong_to_ptr(dstAddr); while (length > 0) { size = (length < MBYTE) ? (size_t)length : (size_t)MBYTE; GETCRITICAL_OR_RETURN(bytes, env, src); srcInt = (jint *)(bytes + srcPos); ! endInt = srcInt + (size / sizeof(jint)); while (srcInt < endInt) { ! tmpInt = *srcInt++; ! *dstInt++ = SWAPINT(tmpInt); } RELEASECRITICAL(bytes, env, src, JNI_ABORT); length -= size; --- 120,146 ---- Java_java_nio_Bits_copyFromIntArray(JNIEnv *env, jclass clazz, jobject src, jlong srcPos, jlong dstAddr, jlong length) { jbyte *bytes; size_t size; ! jint *srcInt, *endInt; ! unsigned char *dst; ! dst = jlong_to_ptr(dstAddr); while (length > 0) { size = (length < MBYTE) ? (size_t)length : (size_t)MBYTE; GETCRITICAL_OR_RETURN(bytes, env, src); srcInt = (jint *)(bytes + srcPos); ! endInt = (jint *)(bytes + srcPos + size); while (srcInt < endInt) { ! jint tmp = SWAPINT(*srcInt); ! memcpy(dst, &tmp, sizeof(jint)); ! srcInt++; ! dst += sizeof(jint); } RELEASECRITICAL(bytes, env, src, JNI_ABORT); length -= size;
*** 146,170 **** Java_java_nio_Bits_copyToIntArray(JNIEnv *env, jclass clazz, jlong srcAddr, jobject dst, jlong dstPos, jlong length) { jbyte *bytes; size_t size; ! jint *srcInt, *dstInt, *endInt; ! jint tmpInt; ! srcInt = (jint *)jlong_to_ptr(srcAddr); while (length > 0) { size = (length < MBYTE) ? (size_t)length : (size_t)MBYTE; GETCRITICAL_OR_RETURN(bytes, env, dst); dstInt = (jint *)(bytes + dstPos); ! endInt = srcInt + (size / sizeof(jint)); ! while (srcInt < endInt) { ! tmpInt = *srcInt++; ! *dstInt++ = SWAPINT(tmpInt); } RELEASECRITICAL(bytes, env, dst, 0); length -= size; --- 152,178 ---- Java_java_nio_Bits_copyToIntArray(JNIEnv *env, jclass clazz, jlong srcAddr, jobject dst, jlong dstPos, jlong length) { jbyte *bytes; size_t size; ! unsigned char *src, *end; ! jint *dstInt; ! src = jlong_to_ptr(srcAddr); while (length > 0) { size = (length < MBYTE) ? (size_t)length : (size_t)MBYTE; GETCRITICAL_OR_RETURN(bytes, env, dst); dstInt = (jint *)(bytes + dstPos); ! end = src + size; ! while (src < end) { ! jint tmp; ! memcpy(&tmp, src, sizeof(jint)); ! *dstInt++ = SWAPINT(tmp); ! src += sizeof(jint); } RELEASECRITICAL(bytes, env, dst, 0); length -= size;
*** 176,200 **** Java_java_nio_Bits_copyFromLongArray(JNIEnv *env, jclass clazz, jobject src, jlong srcPos, jlong dstAddr, jlong length) { jbyte *bytes; size_t size; ! jlong *srcLong, *dstLong, *endLong; ! jlong tmpLong; ! dstLong = (jlong *)jlong_to_ptr(dstAddr); while (length > 0) { size = (length < MBYTE) ? (size_t)length : (size_t)MBYTE; GETCRITICAL_OR_RETURN(bytes, env, src); srcLong = (jlong *)(bytes + srcPos); ! endLong = srcLong + (size / sizeof(jlong)); while (srcLong < endLong) { ! tmpLong = *srcLong++; ! *dstLong++ = SWAPLONG(tmpLong); } RELEASECRITICAL(bytes, env, src, JNI_ABORT); length -= size; --- 184,210 ---- Java_java_nio_Bits_copyFromLongArray(JNIEnv *env, jclass clazz, jobject src, jlong srcPos, jlong dstAddr, jlong length) { jbyte *bytes; size_t size; ! jlong *srcLong, *endLong; ! unsigned char* dst; ! dst = jlong_to_ptr(dstAddr); while (length > 0) { size = (length < MBYTE) ? (size_t)length : (size_t)MBYTE; GETCRITICAL_OR_RETURN(bytes, env, src); srcLong = (jlong *)(bytes + srcPos); ! endLong = (jlong *)(bytes + srcPos + size); while (srcLong < endLong) { ! jlong tmp = SWAPLONG(*srcLong); ! memcpy(dst, &tmp, sizeof(jlong)); ! srcLong++; ! dst += sizeof(jlong); } RELEASECRITICAL(bytes, env, src, JNI_ABORT); length -= size;
*** 206,230 **** Java_java_nio_Bits_copyToLongArray(JNIEnv *env, jclass clazz, jlong srcAddr, jobject dst, jlong dstPos, jlong length) { jbyte *bytes; size_t size; ! jlong *srcLong, *dstLong, *endLong; ! jlong tmpLong; ! srcLong = (jlong *)jlong_to_ptr(srcAddr); while (length > 0) { size = (length < MBYTE) ? (size_t)length : (size_t)MBYTE; GETCRITICAL_OR_RETURN(bytes, env, dst); dstLong = (jlong *)(bytes + dstPos); ! endLong = srcLong + (size / sizeof(jlong)); ! while (srcLong < endLong) { ! tmpLong = *srcLong++; ! *dstLong++ = SWAPLONG(tmpLong); } RELEASECRITICAL(bytes, env, dst, 0); length -= size; --- 216,242 ---- Java_java_nio_Bits_copyToLongArray(JNIEnv *env, jclass clazz, jlong srcAddr, jobject dst, jlong dstPos, jlong length) { jbyte *bytes; size_t size; ! unsigned char *src, *end; ! jlong *dstLong; ! src = jlong_to_ptr(srcAddr); while (length > 0) { size = (length < MBYTE) ? (size_t)length : (size_t)MBYTE; GETCRITICAL_OR_RETURN(bytes, env, dst); dstLong = (jlong *)(bytes + dstPos); ! end = src + size; ! while (src < end) { ! jlong tmp; ! memcpy(&tmp, src, sizeof(jlong)); ! *dstLong++ = SWAPLONG(tmp); ! src += sizeof(jlong); } RELEASECRITICAL(bytes, env, dst, 0); length -= size;
src/java.base/share/native/libjava/Bits.c
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File