src/share/vm/prims/jni.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File
*** old/src/share/vm/prims/jni.cpp	Fri Mar 18 14:59:01 2011
--- new/src/share/vm/prims/jni.cpp	Fri Mar 18 14:59:01 2011

*** 1,7 **** --- 1,7 ---- /* ! * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. ! * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation.
*** 1856,1866 **** --- 1856,1866 ---- if (isStatic) { // Static field. The fieldID a JNIid specifying the field holder and the offset within the klassOop. JNIid* id = jfieldIDWorkaround::from_static_jfieldID(fieldID); assert(id->is_static_field_id(), "invalid static field id"); ! found = instanceKlass::cast(id->holder())->find_local_field_from_offset(id->offset(), true, &fd); ! found = id->find_local_field(&fd); } else { // Non-static field. The fieldID is really the offset of the field within the instanceOop. int offset = jfieldIDWorkaround::from_instance_jfieldID(k, fieldID); found = instanceKlass::cast(k)->find_field_from_offset(offset, false, &fd); }
*** 1904,1916 **** --- 1904,1914 ---- // A jfieldID for a static field is a JNIid specifying the field holder and the offset within the klassOop JNIid* id = instanceKlass::cast(fd.field_holder())->jni_id_for(fd.offset()); debug_only(id->set_is_static_field_id();) ! debug_only(int first_offset = instanceKlass::cast(fd.field_holder())->offset_of_static_fields();) debug_only(int end_offset = first_offset + (instanceKlass::cast(fd.field_holder())->static_field_size() * wordSize);) assert(id->offset() >= first_offset && id->offset() < end_offset, "invalid static field offset"); ! debug_only(id->verify(fd.field_holder())); ret = jfieldIDWorkaround::to_static_jfieldID(id); return ret; JNI_END
*** 1926,1936 **** --- 1924,1934 ---- // Keep JVMTI addition small and only check enabled flag here. // jni_GetField_probe() assumes that is okay to create handles. if (JvmtiExport::should_post_field_access()) { JvmtiExport::jni_GetField_probe(thread, NULL, NULL, id->holder(), fieldID, true); } ! jobject ret = JNIHandles::make_local(id->holder()->java_mirror()->obj_field(id->offset())); DTRACE_PROBE1(hotspot_jni, GetStaticObjectField__return, ret); return ret; JNI_END #define DEFINE_GETSTATICFIELD(Return,Fieldname,Result) \
*** 1948,1958 **** --- 1946,1956 ---- /* Keep JVMTI addition small and only check enabled flag here. */ \ /* jni_GetField_probe() assumes that is okay to create handles. */ \ if (JvmtiExport::should_post_field_access()) { \ JvmtiExport::jni_GetField_probe(thread, NULL, NULL, id->holder(), fieldID, true); \ } \ ! ret = id->holder()->java_mirror()-> Fieldname##_field (id->offset()); \ return ret;\ JNI_END DEFINE_GETSTATICFIELD(jboolean, bool, Boolean) DEFINE_GETSTATICFIELD(jbyte, byte, Byte)
*** 1974,1984 **** --- 1972,1982 ---- if (JvmtiExport::should_post_field_modification()) { jvalue field_value; field_value.l = value; JvmtiExport::jni_SetField_probe(thread, NULL, NULL, id->holder(), fieldID, true, 'L', (jvalue *)&field_value); } ! id->holder()->java_mirror()->obj_field_put(id->offset(), JNIHandles::resolve(value)); DTRACE_PROBE(hotspot_jni, SetStaticObjectField__return); JNI_END #define DEFINE_SETSTATICFIELD(Argument,Fieldname,Result,SigType,unionType) \
*** 1997,2007 **** --- 1995,2005 ---- if (JvmtiExport::should_post_field_modification()) { \ jvalue field_value; \ field_value.unionType = value; \ JvmtiExport::jni_SetField_probe(thread, NULL, NULL, id->holder(), fieldID, true, SigType, (jvalue *)&field_value); \ } \ ! id->holder()->java_mirror()-> Fieldname##_field_put (id->offset(), value); \ DTRACE_PROBE(hotspot_jni, SetStatic##Result##Field__return);\ JNI_END DEFINE_SETSTATICFIELD(jboolean, bool, Boolean, 'Z', z) DEFINE_SETSTATICFIELD(jbyte, byte, Byte, 'B', b)

src/share/vm/prims/jni.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File