Mercurial > hg > graal-jvmci-8
diff src/share/vm/prims/jvm.cpp @ 12813:675ffabf3798
8024087: Remove dead JVM_{Get,Set}PrimitiveFieldValues functions
Summary: The two functions were used to support JDK 1.3 but are no longer in use
Reviewed-by: coleenp, ctornqvi, twisti, dsamersoff
author | mikael |
---|---|
date | Wed, 02 Oct 2013 09:18:56 -0700 |
parents | 0f37d1badced |
children | 2720ab7a0d70 |
line wrap: on
line diff
--- a/src/share/vm/prims/jvm.cpp Thu Oct 03 12:39:58 2013 +0400 +++ b/src/share/vm/prims/jvm.cpp Wed Oct 02 09:18:56 2013 -0700 @@ -3954,248 +3954,6 @@ } -// Serialization -JVM_ENTRY(void, JVM_SetPrimitiveFieldValues(JNIEnv *env, jclass cb, jobject obj, - jlongArray fieldIDs, jcharArray typecodes, jbyteArray data)) - assert(!JDK_Version::is_gte_jdk14x_version(), "should only be used in 1.3.1 and earlier"); - - typeArrayOop tcodes = typeArrayOop(JNIHandles::resolve(typecodes)); - typeArrayOop dbuf = typeArrayOop(JNIHandles::resolve(data)); - typeArrayOop fids = typeArrayOop(JNIHandles::resolve(fieldIDs)); - oop o = JNIHandles::resolve(obj); - - if (o == NULL || fids == NULL || dbuf == NULL || tcodes == NULL) { - THROW(vmSymbols::java_lang_NullPointerException()); - } - - jsize nfids = fids->length(); - if (nfids == 0) return; - - if (tcodes->length() < nfids) { - THROW(vmSymbols::java_lang_ArrayIndexOutOfBoundsException()); - } - - jsize off = 0; - /* loop through fields, setting values */ - for (jsize i = 0; i < nfids; i++) { - jfieldID fid = (jfieldID)(intptr_t) fids->long_at(i); - int field_offset; - if (fid != NULL) { - // NULL is a legal value for fid, but retrieving the field offset - // trigger assertion in that case - field_offset = jfieldIDWorkaround::from_instance_jfieldID(o->klass(), fid); - } - - switch (tcodes->char_at(i)) { - case 'Z': - if (fid != NULL) { - jboolean val = (dbuf->byte_at(off) != 0) ? JNI_TRUE : JNI_FALSE; - o->bool_field_put(field_offset, val); - } - off++; - break; - - case 'B': - if (fid != NULL) { - o->byte_field_put(field_offset, dbuf->byte_at(off)); - } - off++; - break; - - case 'C': - if (fid != NULL) { - jchar val = ((dbuf->byte_at(off + 0) & 0xFF) << 8) - + ((dbuf->byte_at(off + 1) & 0xFF) << 0); - o->char_field_put(field_offset, val); - } - off += 2; - break; - - case 'S': - if (fid != NULL) { - jshort val = ((dbuf->byte_at(off + 0) & 0xFF) << 8) - + ((dbuf->byte_at(off + 1) & 0xFF) << 0); - o->short_field_put(field_offset, val); - } - off += 2; - break; - - case 'I': - if (fid != NULL) { - jint ival = ((dbuf->byte_at(off + 0) & 0xFF) << 24) - + ((dbuf->byte_at(off + 1) & 0xFF) << 16) - + ((dbuf->byte_at(off + 2) & 0xFF) << 8) - + ((dbuf->byte_at(off + 3) & 0xFF) << 0); - o->int_field_put(field_offset, ival); - } - off += 4; - break; - - case 'F': - if (fid != NULL) { - jint ival = ((dbuf->byte_at(off + 0) & 0xFF) << 24) - + ((dbuf->byte_at(off + 1) & 0xFF) << 16) - + ((dbuf->byte_at(off + 2) & 0xFF) << 8) - + ((dbuf->byte_at(off + 3) & 0xFF) << 0); - jfloat fval = (*int_bits_to_float_fn)(env, NULL, ival); - o->float_field_put(field_offset, fval); - } - off += 4; - break; - - case 'J': - if (fid != NULL) { - jlong lval = (((jlong) dbuf->byte_at(off + 0) & 0xFF) << 56) - + (((jlong) dbuf->byte_at(off + 1) & 0xFF) << 48) - + (((jlong) dbuf->byte_at(off + 2) & 0xFF) << 40) - + (((jlong) dbuf->byte_at(off + 3) & 0xFF) << 32) - + (((jlong) dbuf->byte_at(off + 4) & 0xFF) << 24) - + (((jlong) dbuf->byte_at(off + 5) & 0xFF) << 16) - + (((jlong) dbuf->byte_at(off + 6) & 0xFF) << 8) - + (((jlong) dbuf->byte_at(off + 7) & 0xFF) << 0); - o->long_field_put(field_offset, lval); - } - off += 8; - break; - - case 'D': - if (fid != NULL) { - jlong lval = (((jlong) dbuf->byte_at(off + 0) & 0xFF) << 56) - + (((jlong) dbuf->byte_at(off + 1) & 0xFF) << 48) - + (((jlong) dbuf->byte_at(off + 2) & 0xFF) << 40) - + (((jlong) dbuf->byte_at(off + 3) & 0xFF) << 32) - + (((jlong) dbuf->byte_at(off + 4) & 0xFF) << 24) - + (((jlong) dbuf->byte_at(off + 5) & 0xFF) << 16) - + (((jlong) dbuf->byte_at(off + 6) & 0xFF) << 8) - + (((jlong) dbuf->byte_at(off + 7) & 0xFF) << 0); - jdouble dval = (*long_bits_to_double_fn)(env, NULL, lval); - o->double_field_put(field_offset, dval); - } - off += 8; - break; - - default: - // Illegal typecode - THROW_MSG(vmSymbols::java_lang_IllegalArgumentException(), "illegal typecode"); - } - } -JVM_END - - -JVM_ENTRY(void, JVM_GetPrimitiveFieldValues(JNIEnv *env, jclass cb, jobject obj, - jlongArray fieldIDs, jcharArray typecodes, jbyteArray data)) - assert(!JDK_Version::is_gte_jdk14x_version(), "should only be used in 1.3.1 and earlier"); - - typeArrayOop tcodes = typeArrayOop(JNIHandles::resolve(typecodes)); - typeArrayOop dbuf = typeArrayOop(JNIHandles::resolve(data)); - typeArrayOop fids = typeArrayOop(JNIHandles::resolve(fieldIDs)); - oop o = JNIHandles::resolve(obj); - - if (o == NULL || fids == NULL || dbuf == NULL || tcodes == NULL) { - THROW(vmSymbols::java_lang_NullPointerException()); - } - - jsize nfids = fids->length(); - if (nfids == 0) return; - - if (tcodes->length() < nfids) { - THROW(vmSymbols::java_lang_ArrayIndexOutOfBoundsException()); - } - - /* loop through fields, fetching values */ - jsize off = 0; - for (jsize i = 0; i < nfids; i++) { - jfieldID fid = (jfieldID)(intptr_t) fids->long_at(i); - if (fid == NULL) { - THROW(vmSymbols::java_lang_NullPointerException()); - } - int field_offset = jfieldIDWorkaround::from_instance_jfieldID(o->klass(), fid); - - switch (tcodes->char_at(i)) { - case 'Z': - { - jboolean val = o->bool_field(field_offset); - dbuf->byte_at_put(off++, (val != 0) ? 1 : 0); - } - break; - - case 'B': - dbuf->byte_at_put(off++, o->byte_field(field_offset)); - break; - - case 'C': - { - jchar val = o->char_field(field_offset); - dbuf->byte_at_put(off++, (val >> 8) & 0xFF); - dbuf->byte_at_put(off++, (val >> 0) & 0xFF); - } - break; - - case 'S': - { - jshort val = o->short_field(field_offset); - dbuf->byte_at_put(off++, (val >> 8) & 0xFF); - dbuf->byte_at_put(off++, (val >> 0) & 0xFF); - } - break; - - case 'I': - { - jint val = o->int_field(field_offset); - dbuf->byte_at_put(off++, (val >> 24) & 0xFF); - dbuf->byte_at_put(off++, (val >> 16) & 0xFF); - dbuf->byte_at_put(off++, (val >> 8) & 0xFF); - dbuf->byte_at_put(off++, (val >> 0) & 0xFF); - } - break; - - case 'F': - { - jfloat fval = o->float_field(field_offset); - jint ival = (*float_to_int_bits_fn)(env, NULL, fval); - dbuf->byte_at_put(off++, (ival >> 24) & 0xFF); - dbuf->byte_at_put(off++, (ival >> 16) & 0xFF); - dbuf->byte_at_put(off++, (ival >> 8) & 0xFF); - dbuf->byte_at_put(off++, (ival >> 0) & 0xFF); - } - break; - - case 'J': - { - jlong val = o->long_field(field_offset); - dbuf->byte_at_put(off++, (val >> 56) & 0xFF); - dbuf->byte_at_put(off++, (val >> 48) & 0xFF); - dbuf->byte_at_put(off++, (val >> 40) & 0xFF); - dbuf->byte_at_put(off++, (val >> 32) & 0xFF); - dbuf->byte_at_put(off++, (val >> 24) & 0xFF); - dbuf->byte_at_put(off++, (val >> 16) & 0xFF); - dbuf->byte_at_put(off++, (val >> 8) & 0xFF); - dbuf->byte_at_put(off++, (val >> 0) & 0xFF); - } - break; - - case 'D': - { - jdouble dval = o->double_field(field_offset); - jlong lval = (*double_to_long_bits_fn)(env, NULL, dval); - dbuf->byte_at_put(off++, (lval >> 56) & 0xFF); - dbuf->byte_at_put(off++, (lval >> 48) & 0xFF); - dbuf->byte_at_put(off++, (lval >> 40) & 0xFF); - dbuf->byte_at_put(off++, (lval >> 32) & 0xFF); - dbuf->byte_at_put(off++, (lval >> 24) & 0xFF); - dbuf->byte_at_put(off++, (lval >> 16) & 0xFF); - dbuf->byte_at_put(off++, (lval >> 8) & 0xFF); - dbuf->byte_at_put(off++, (lval >> 0) & 0xFF); - } - break; - - default: - // Illegal typecode - THROW_MSG(vmSymbols::java_lang_IllegalArgumentException(), "illegal typecode"); - } - } -JVM_END - // Shared JNI/JVM entry points //////////////////////////////////////////////////////////////