513 // Add to null class loader list first before creating the mirror
514 // (same order as class file parsing)
515 loader_data->add_class(this);
516 }
517
518 // Recreate the class mirror.
519 // Only recreate it if not present. A previous attempt to restore may have
520 // gotten an OOM later but keep the mirror if it was created.
521 if (java_mirror() == NULL) {
522 Handle loader = loader_data->class_loader();
523 ModuleEntry* module_entry = NULL;
524 Klass* k = this;
525 if (k->is_objArray_klass()) {
526 k = ObjArrayKlass::cast(k)->bottom_klass();
527 }
528 // Obtain klass' module.
529 if (k->is_instance_klass()) {
530 InstanceKlass* ik = (InstanceKlass*) k;
531 module_entry = ik->module();
532 } else {
533 module_entry = ModuleEntryTable::javabase_module();
534 }
535 // Obtain java.lang.reflect.Module, if available
536 Handle module_handle(THREAD, ((module_entry != NULL) ? JNIHandles::resolve(module_entry->module()) : (oop)NULL));
537 java_lang_Class::create_mirror(this, loader, module_handle, protection_domain, CHECK);
538 }
539 }
540
541 Klass* Klass::array_klass_or_null(int rank) {
542 EXCEPTION_MARK;
543 // No exception can be thrown by array_klass_impl when called with or_null == true.
544 // (In anycase, the execption mark will fail if it do so)
545 return array_klass_impl(true, rank, THREAD);
546 }
547
548
549 Klass* Klass::array_klass_or_null() {
550 EXCEPTION_MARK;
551 // No exception can be thrown by array_klass_impl when called with or_null == true.
552 // (In anycase, the execption mark will fail if it do so)
553 return array_klass_impl(true, THREAD);
|
513 // Add to null class loader list first before creating the mirror
514 // (same order as class file parsing)
515 loader_data->add_class(this);
516 }
517
518 // Recreate the class mirror.
519 // Only recreate it if not present. A previous attempt to restore may have
520 // gotten an OOM later but keep the mirror if it was created.
521 if (java_mirror() == NULL) {
522 Handle loader = loader_data->class_loader();
523 ModuleEntry* module_entry = NULL;
524 Klass* k = this;
525 if (k->is_objArray_klass()) {
526 k = ObjArrayKlass::cast(k)->bottom_klass();
527 }
528 // Obtain klass' module.
529 if (k->is_instance_klass()) {
530 InstanceKlass* ik = (InstanceKlass*) k;
531 module_entry = ik->module();
532 } else {
533 module_entry = ModuleEntryTable::javabase_moduleEntry();
534 }
535 // Obtain java.lang.reflect.Module, if available
536 Handle module_handle(THREAD, ((module_entry != NULL) ? JNIHandles::resolve(module_entry->module()) : (oop)NULL));
537 java_lang_Class::create_mirror(this, loader, module_handle, protection_domain, CHECK);
538 }
539 }
540
541 Klass* Klass::array_klass_or_null(int rank) {
542 EXCEPTION_MARK;
543 // No exception can be thrown by array_klass_impl when called with or_null == true.
544 // (In anycase, the execption mark will fail if it do so)
545 return array_klass_impl(true, rank, THREAD);
546 }
547
548
549 Klass* Klass::array_klass_or_null() {
550 EXCEPTION_MARK;
551 // No exception can be thrown by array_klass_impl when called with or_null == true.
552 // (In anycase, the execption mark will fail if it do so)
553 return array_klass_impl(true, THREAD);
|