< prev index next >

src/share/vm/classfile/javaClasses.cpp

Print this page




2846   return module->obj_field(name_offset);
2847 }
2848 
2849 void java_lang_reflect_Module::set_name(oop module, oop value) {
2850   assert(Universe::is_fully_initialized(), "Need to find another solution to the reflection problem");
2851   module->obj_field_put(name_offset, value);
2852 }
2853 
2854 ModuleEntry* java_lang_reflect_Module::module_entry(oop module, TRAPS) {
2855   assert(_module_entry_offset != -1, "Uninitialized module_entry_offset");
2856   assert(module != NULL, "module can't be null");
2857   assert(module->is_oop(), "module must be oop");
2858 
2859   ModuleEntry* module_entry = (ModuleEntry*)module->address_field(_module_entry_offset);
2860   if (module_entry == NULL) {
2861     // If the inject field containing the ModuleEntry* is null then return the
2862     // class loader's unnamed module.
2863     oop loader = java_lang_reflect_Module::loader(module);
2864     Handle h_loader = Handle(THREAD, loader);
2865     ClassLoaderData* loader_cld = SystemDictionary::register_loader(h_loader, CHECK_NULL);
2866     return loader_cld->modules()->unnamed_module();
2867   }
2868   return module_entry;
2869 }
2870 
2871 void java_lang_reflect_Module::set_module_entry(oop module, ModuleEntry* module_entry) {
2872   assert(_module_entry_offset != -1, "Uninitialized module_entry_offset");
2873   assert(module != NULL, "module can't be null");
2874   assert(module->is_oop(), "module must be oop");
2875   module->address_field_put(_module_entry_offset, (address)module_entry);
2876 }
2877 
2878 Handle reflect_ConstantPool::create(TRAPS) {
2879   assert(Universe::is_fully_initialized(), "Need to find another solution to the reflection problem");
2880   InstanceKlass* k = SystemDictionary::reflect_ConstantPool_klass();
2881   // Ensure it is initialized
2882   k->initialize(CHECK_NH);
2883   return k->allocate_instance_handle(THREAD);
2884 }
2885 
2886 




2846   return module->obj_field(name_offset);
2847 }
2848 
2849 void java_lang_reflect_Module::set_name(oop module, oop value) {
2850   assert(Universe::is_fully_initialized(), "Need to find another solution to the reflection problem");
2851   module->obj_field_put(name_offset, value);
2852 }
2853 
2854 ModuleEntry* java_lang_reflect_Module::module_entry(oop module, TRAPS) {
2855   assert(_module_entry_offset != -1, "Uninitialized module_entry_offset");
2856   assert(module != NULL, "module can't be null");
2857   assert(module->is_oop(), "module must be oop");
2858 
2859   ModuleEntry* module_entry = (ModuleEntry*)module->address_field(_module_entry_offset);
2860   if (module_entry == NULL) {
2861     // If the inject field containing the ModuleEntry* is null then return the
2862     // class loader's unnamed module.
2863     oop loader = java_lang_reflect_Module::loader(module);
2864     Handle h_loader = Handle(THREAD, loader);
2865     ClassLoaderData* loader_cld = SystemDictionary::register_loader(h_loader, CHECK_NULL);
2866     return loader_cld->unnamed_module();
2867   }
2868   return module_entry;
2869 }
2870 
2871 void java_lang_reflect_Module::set_module_entry(oop module, ModuleEntry* module_entry) {
2872   assert(_module_entry_offset != -1, "Uninitialized module_entry_offset");
2873   assert(module != NULL, "module can't be null");
2874   assert(module->is_oop(), "module must be oop");
2875   module->address_field_put(_module_entry_offset, (address)module_entry);
2876 }
2877 
2878 Handle reflect_ConstantPool::create(TRAPS) {
2879   assert(Universe::is_fully_initialized(), "Need to find another solution to the reflection problem");
2880   InstanceKlass* k = SystemDictionary::reflect_ConstantPool_klass();
2881   // Ensure it is initialized
2882   k->initialize(CHECK_NH);
2883   return k->allocate_instance_handle(THREAD);
2884 }
2885 
2886 


< prev index next >