< prev index next >

src/hotspot/share/prims/jni.cpp

Print this page

        

*** 86,95 **** --- 86,99 ---- #include "utilities/dtrace.hpp" #include "utilities/events.hpp" #include "utilities/histogram.hpp" #include "utilities/macros.hpp" #include "utilities/vmError.hpp" + #if INCLUDE_JVMCI + #include "jvmci/jvmciCompiler.hpp" + #include "jvmci/jvmciRuntime.hpp" + #endif static jint CurrentVersion = JNI_VERSION_10; #ifdef _WIN32 extern LONG WINAPI topLevelExceptionFilter(_EXCEPTION_POINTERS* );
*** 346,355 **** --- 350,360 ---- } Klass* k = SystemDictionary::resolve_from_stream(class_name, class_loader, Handle(), &st, + NULL, // dynamic_nest_host CHECK_NULL); if (log_is_enabled(Debug, class, resolve) && k != NULL) { trace_class_resolution(k); }
*** 1312,1330 **** if (name == NULL || signature == NULL) { THROW_MSG_0(vmSymbols::java_lang_NoSuchMethodError(), name_str); } - Klass* klass = java_lang_Class::as_Klass(JNIHandles::resolve_non_null(clazz)); - // Throw a NoSuchMethodError exception if we have an instance of a // primitive java.lang.Class if (java_lang_Class::is_primitive(JNIHandles::resolve_non_null(clazz))) { ! ResourceMark rm; ! THROW_MSG_0(vmSymbols::java_lang_NoSuchMethodError(), err_msg("%s%s.%s%s", is_static ? "static " : "", klass->signature_name(), name_str, sig)); } // Make sure class is linked and initialized before handing id's out to // Method*s. klass->initialize(CHECK_NULL); Method* m; --- 1317,1334 ---- if (name == NULL || signature == NULL) { THROW_MSG_0(vmSymbols::java_lang_NoSuchMethodError(), name_str); } // Throw a NoSuchMethodError exception if we have an instance of a // primitive java.lang.Class if (java_lang_Class::is_primitive(JNIHandles::resolve_non_null(clazz))) { ! THROW_MSG_0(vmSymbols::java_lang_NoSuchMethodError(), name_str); } + Klass* klass = java_lang_Class::as_Klass(JNIHandles::resolve_non_null(clazz)); + // Make sure class is linked and initialized before handing id's out to // Method*s. klass->initialize(CHECK_NULL); Method* m;
*** 1341,1352 **** if (m == NULL && klass->is_instance_klass()) { m = InstanceKlass::cast(klass)->lookup_method_in_ordered_interfaces(name, signature); } } if (m == NULL || (m->is_static() != is_static)) { ! ResourceMark rm; ! THROW_MSG_0(vmSymbols::java_lang_NoSuchMethodError(), err_msg("%s%s.%s%s", is_static ? "static " : "", klass->signature_name(), name_str, sig)); } return m->jmethod_id(); } --- 1345,1355 ---- if (m == NULL && klass->is_instance_klass()) { m = InstanceKlass::cast(klass)->lookup_method_in_ordered_interfaces(name, signature); } } if (m == NULL || (m->is_static() != is_static)) { ! THROW_MSG_0(vmSymbols::java_lang_NoSuchMethodError(), name_str); } return m->jmethod_id(); }
*** 2010,2039 **** JNIWrapper("GetFieldID"); HOTSPOT_JNI_GETFIELDID_ENTRY(env, clazz, (char *) name, (char *) sig); jfieldID ret = 0; DT_RETURN_MARK(GetFieldID, jfieldID, (const jfieldID&)ret); - Klass* k = java_lang_Class::as_Klass(JNIHandles::resolve_non_null(clazz)); - // The class should have been loaded (we have an instance of the class // passed in) so the field and signature should already be in the symbol // table. If they're not there, the field doesn't exist. TempNewSymbol fieldname = SymbolTable::probe(name, (int)strlen(name)); TempNewSymbol signame = SymbolTable::probe(sig, (int)strlen(sig)); if (fieldname == NULL || signame == NULL) { ! ResourceMark rm; ! THROW_MSG_0(vmSymbols::java_lang_NoSuchFieldError(), err_msg("%s.%s %s", k->external_name(), name, sig)); } ! // Make sure class is initialized before handing id's out to fields k->initialize(CHECK_NULL); fieldDescriptor fd; if (!k->is_instance_klass() || !InstanceKlass::cast(k)->find_field(fieldname, signame, false, &fd)) { ! ResourceMark rm; ! THROW_MSG_0(vmSymbols::java_lang_NoSuchFieldError(), err_msg("%s.%s %s", k->external_name(), name, sig)); } // A jfieldID for a non-static field is simply the offset of the field within the instanceOop // It may also have hash bits for k, if VerifyJNIFields is turned on. ret = jfieldIDWorkaround::to_instance_jfieldID(k, fd.offset()); --- 2013,2038 ---- JNIWrapper("GetFieldID"); HOTSPOT_JNI_GETFIELDID_ENTRY(env, clazz, (char *) name, (char *) sig); jfieldID ret = 0; DT_RETURN_MARK(GetFieldID, jfieldID, (const jfieldID&)ret); // The class should have been loaded (we have an instance of the class // passed in) so the field and signature should already be in the symbol // table. If they're not there, the field doesn't exist. TempNewSymbol fieldname = SymbolTable::probe(name, (int)strlen(name)); TempNewSymbol signame = SymbolTable::probe(sig, (int)strlen(sig)); if (fieldname == NULL || signame == NULL) { ! THROW_MSG_0(vmSymbols::java_lang_NoSuchFieldError(), (char*) name); } ! Klass* k = java_lang_Class::as_Klass(JNIHandles::resolve_non_null(clazz)); // Make sure class is initialized before handing id's out to fields k->initialize(CHECK_NULL); fieldDescriptor fd; if (!k->is_instance_klass() || !InstanceKlass::cast(k)->find_field(fieldname, signame, false, &fd)) { ! THROW_MSG_0(vmSymbols::java_lang_NoSuchFieldError(), (char*) name); } // A jfieldID for a non-static field is simply the offset of the field within the instanceOop // It may also have hash bits for k, if VerifyJNIFields is turned on. ret = jfieldIDWorkaround::to_instance_jfieldID(k, fd.offset());
< prev index next >