< prev index next >

src/hotspot/share/prims/jvm.cpp

Print this page
rev 58870 : 8242452: During module definition, move conversion of packages from native to VM
8242290: Pointless verification in get_package_entry_by_name
Reviewed-by: lfoltan, alanb, iklam


1041   }
1042 
1043   Klass* k = SystemDictionary::find_instance_or_array_klass(klass_name,
1044                                                               h_loader,
1045                                                               Handle(),
1046                                                               CHECK_NULL);
1047 #if INCLUDE_CDS
1048   if (k == NULL) {
1049     // If the class is not already loaded, try to see if it's in the shared
1050     // archive for the current classloader (h_loader).
1051     k = SystemDictionaryShared::find_or_load_shared_class(klass_name, h_loader, CHECK_NULL);
1052   }
1053 #endif
1054   return (k == NULL) ? NULL :
1055             (jclass) JNIHandles::make_local(env, k->java_mirror());
1056 JVM_END
1057 
1058 // Module support //////////////////////////////////////////////////////////////////////////////
1059 
1060 JVM_ENTRY(void, JVM_DefineModule(JNIEnv *env, jobject module, jboolean is_open, jstring version,
1061                                  jstring location, const char* const* packages, jsize num_packages))
1062   JVMWrapper("JVM_DefineModule");
1063   Modules::define_module(module, is_open, version, location, packages, num_packages, CHECK);
1064 JVM_END
1065 
1066 JVM_ENTRY(void, JVM_SetBootLoaderUnnamedModule(JNIEnv *env, jobject module))
1067   JVMWrapper("JVM_SetBootLoaderUnnamedModule");
1068   Modules::set_bootloader_unnamed_module(module, CHECK);
1069 JVM_END
1070 
1071 JVM_ENTRY(void, JVM_AddModuleExports(JNIEnv *env, jobject from_module, const char* package, jobject to_module))
1072   JVMWrapper("JVM_AddModuleExports");
1073   Modules::add_module_exports_qualified(from_module, package, to_module, CHECK);
1074 JVM_END
1075 
1076 JVM_ENTRY(void, JVM_AddModuleExportsToAllUnnamed(JNIEnv *env, jobject from_module, const char* package))
1077   JVMWrapper("JVM_AddModuleExportsToAllUnnamed");
1078   Modules::add_module_exports_to_all_unnamed(from_module, package, CHECK);
1079 JVM_END
1080 
1081 JVM_ENTRY(void, JVM_AddModuleExportsToAll(JNIEnv *env, jobject from_module, const char* package))
1082   JVMWrapper("JVM_AddModuleExportsToAll");
1083   Modules::add_module_exports(from_module, package, NULL, CHECK);
1084 JVM_END
1085 
1086 JVM_ENTRY (void, JVM_AddReadsModule(JNIEnv *env, jobject from_module, jobject source_module))
1087   JVMWrapper("JVM_AddReadsModule");
1088   Modules::add_reads_module(from_module, source_module, CHECK);
1089 JVM_END
1090 
1091 // Reflection support //////////////////////////////////////////////////////////////////////////////
1092 
1093 JVM_ENTRY(jstring, JVM_InitClassName(JNIEnv *env, jclass cls))
1094   assert (cls != NULL, "illegal class");
1095   JVMWrapper("JVM_InitClassName");
1096   JvmtiVMObjectAllocEventCollector oam;
1097   ResourceMark rm(THREAD);
1098   HandleMark hm(THREAD);
1099   Handle java_class(THREAD, JNIHandles::resolve(cls));
1100   oop result = java_lang_Class::name(java_class, CHECK_NULL);
1101   return (jstring) JNIHandles::make_local(env, result);




1041   }
1042 
1043   Klass* k = SystemDictionary::find_instance_or_array_klass(klass_name,
1044                                                               h_loader,
1045                                                               Handle(),
1046                                                               CHECK_NULL);
1047 #if INCLUDE_CDS
1048   if (k == NULL) {
1049     // If the class is not already loaded, try to see if it's in the shared
1050     // archive for the current classloader (h_loader).
1051     k = SystemDictionaryShared::find_or_load_shared_class(klass_name, h_loader, CHECK_NULL);
1052   }
1053 #endif
1054   return (k == NULL) ? NULL :
1055             (jclass) JNIHandles::make_local(env, k->java_mirror());
1056 JVM_END
1057 
1058 // Module support //////////////////////////////////////////////////////////////////////////////
1059 
1060 JVM_ENTRY(void, JVM_DefineModule(JNIEnv *env, jobject module, jboolean is_open, jstring version,
1061                                  jstring location, jobjectArray packages))
1062   JVMWrapper("JVM_DefineModule");
1063   Modules::define_module(module, is_open, version, location, packages, CHECK);
1064 JVM_END
1065 
1066 JVM_ENTRY(void, JVM_SetBootLoaderUnnamedModule(JNIEnv *env, jobject module))
1067   JVMWrapper("JVM_SetBootLoaderUnnamedModule");
1068   Modules::set_bootloader_unnamed_module(module, CHECK);
1069 JVM_END
1070 
1071 JVM_ENTRY(void, JVM_AddModuleExports(JNIEnv *env, jobject from_module, jstring package, jobject to_module))
1072   JVMWrapper("JVM_AddModuleExports");
1073   Modules::add_module_exports_qualified(from_module, package, to_module, CHECK);
1074 JVM_END
1075 
1076 JVM_ENTRY(void, JVM_AddModuleExportsToAllUnnamed(JNIEnv *env, jobject from_module, jstring package))
1077   JVMWrapper("JVM_AddModuleExportsToAllUnnamed");
1078   Modules::add_module_exports_to_all_unnamed(from_module, package, CHECK);
1079 JVM_END
1080 
1081 JVM_ENTRY(void, JVM_AddModuleExportsToAll(JNIEnv *env, jobject from_module, jstring package))
1082   JVMWrapper("JVM_AddModuleExportsToAll");
1083   Modules::add_module_exports(from_module, package, NULL, CHECK);
1084 JVM_END
1085 
1086 JVM_ENTRY (void, JVM_AddReadsModule(JNIEnv *env, jobject from_module, jobject source_module))
1087   JVMWrapper("JVM_AddReadsModule");
1088   Modules::add_reads_module(from_module, source_module, CHECK);
1089 JVM_END
1090 
1091 // Reflection support //////////////////////////////////////////////////////////////////////////////
1092 
1093 JVM_ENTRY(jstring, JVM_InitClassName(JNIEnv *env, jclass cls))
1094   assert (cls != NULL, "illegal class");
1095   JVMWrapper("JVM_InitClassName");
1096   JvmtiVMObjectAllocEventCollector oam;
1097   ResourceMark rm(THREAD);
1098   HandleMark hm(THREAD);
1099   Handle java_class(THREAD, JNIHandles::resolve(cls));
1100   oop result = java_lang_Class::name(java_class, CHECK_NULL);
1101   return (jstring) JNIHandles::make_local(env, result);


< prev index next >