@@ -742,17 +742,6 @@ JVM_END
742742// Misc. class handling ///////////////////////////////////////////////////////////
743743
744744
745- JVM_ENTRY (void , JVM_LinkClass(JNIEnv* env, jclass classClass, jclass arg))
746- JVMWrapper (" JVM_LinkClass" );
747-
748- oop r = JNIHandles::resolve(arg);
749- Klass* klass = java_lang_Class::as_Klass(r);
750-
751- if (!ClassForNameDeferLinking && klass->is_instance_klass ()) {
752- InstanceKlass::cast (klass)->link_class (CHECK );
753- }
754- JVM_END
755-
756745JVM_ENTRY (jclass, JVM_GetCallerClass(JNIEnv* env))
757746 JVMWrapper (" JVM_GetCallerClass" );
758747
@@ -863,10 +852,9 @@ JVM_ENTRY(jclass, JVM_FindClassFromCaller(JNIEnv* env, const char* name,
863852
864853 Handle h_loader (THREAD , loader_oop);
865854 Handle h_prot (THREAD , protection_domain);
866-
867- jboolean link = !ClassForNameDeferLinking;
868- jclass result = find_class_from_class_loader(env, h_name, init, link, h_loader,
855+ jclass result = find_class_from_class_loader(env, h_name, init, h_loader,
869856 h_prot, false , THREAD );
857+
870858 if (log_is_enabled(Debug, class , resolve) && result != NULL ) {
871859 trace_class_resolution (java_lang_Class::as_Klass (JNIHandles::resolve_non_null (result)));
872860 }
@@ -903,7 +891,7 @@ JVM_ENTRY(jclass, JVM_FindClassFromClass(JNIEnv *env, const char *name,
903891 }
904892 Handle h_loader (THREAD , class_loader);
905893 Handle h_prot (THREAD , protection_domain);
906- jclass result = find_class_from_class_loader(env, h_name, init, false , h_loader,
894+ jclass result = find_class_from_class_loader(env, h_name, init, h_loader,
907895 h_prot, true , thread);
908896
909897 if (log_is_enabled(Debug, class , resolve) && result != NULL ) {
@@ -3410,12 +3398,9 @@ JNIEXPORT void JNICALL JVM_RawMonitorExit(void *mon) {
34103398
34113399// Shared JNI/JVM entry points //////////////////////////////////////////////////////////////
34123400
3413- jclass find_class_from_class_loader (JNIEnv* env, Symbol* name, jboolean init, jboolean link,
3401+ jclass find_class_from_class_loader (JNIEnv* env, Symbol* name, jboolean init,
34143402 Handle loader, Handle protection_domain,
34153403 jboolean throwError, TRAPS ) {
3416- // Initialization also implies linking - check for coherent args
3417- assert ((init && link) || !init, " incorrect use of init/link arguments" );
3418-
34193404 // Security Note:
34203405 // The Java level wrapper will perform the necessary security check allowing
34213406 // us to pass the NULL as the initiating class loader. The VM is responsible for
@@ -3424,11 +3409,9 @@ jclass find_class_from_class_loader(JNIEnv* env, Symbol* name, jboolean init, jb
34243409 // if there is no security manager in 3-arg Class.forName().
34253410 Klass* klass = SystemDictionary::resolve_or_fail (name, loader, protection_domain, throwError != 0 , CHECK_NULL );
34263411
3427- // Check if we should initialize the class (which implies linking), or just link it
3412+ // Check if we should initialize the class
34283413 if (init && klass->is_instance_klass ()) {
34293414 klass->initialize (CHECK_NULL );
3430- } else if (link && klass->is_instance_klass ()) {
3431- InstanceKlass::cast (klass)->link_class (CHECK_NULL );
34323415 }
34333416 return (jclass) JNIHandles::make_local (env, klass->java_mirror ());
34343417}
0 commit comments