mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 07:14:30 +02:00
8217846: [Graal] vmTestbase/nsk/jdi/VirtualMachine/instanceCounts/instancecounts003/instancecounts003.java crash
Make sure the array calls's mirror was successfully created before putting the array class on its class loader data list Reviewed-by: lfoltan, coleenp
This commit is contained in:
parent
4539863cf1
commit
1de7140185
2 changed files with 14 additions and 10 deletions
|
@ -126,17 +126,19 @@ Klass* ObjArrayKlass::allocate_objArray_klass(ClassLoaderData* loader_data,
|
|||
// Initialize instance variables
|
||||
ObjArrayKlass* oak = ObjArrayKlass::allocate(loader_data, n, element_klass, name, CHECK_0);
|
||||
|
||||
// Add all classes to our internal class loader list here,
|
||||
// including classes in the bootstrap (NULL) class loader.
|
||||
// GC walks these as strong roots.
|
||||
loader_data->add_class(oak);
|
||||
|
||||
ModuleEntry* module = oak->module();
|
||||
assert(module != NULL, "No module entry for array");
|
||||
|
||||
// Call complete_create_array_klass after all instance variables has been initialized.
|
||||
ArrayKlass::complete_create_array_klass(oak, super_klass, module, CHECK_0);
|
||||
|
||||
// Add all classes to our internal class loader list here,
|
||||
// including classes in the bootstrap (NULL) class loader.
|
||||
// Do this step after creating the mirror so that if the
|
||||
// mirror creation fails, loaded_classes_do() doesn't find
|
||||
// an array class without a mirror.
|
||||
loader_data->add_class(oak);
|
||||
|
||||
return oak;
|
||||
}
|
||||
|
||||
|
|
|
@ -55,14 +55,16 @@ TypeArrayKlass* TypeArrayKlass::create_klass(BasicType type,
|
|||
|
||||
TypeArrayKlass* ak = TypeArrayKlass::allocate(null_loader_data, type, sym, CHECK_NULL);
|
||||
|
||||
// Add all classes to our internal class loader list here,
|
||||
// including classes in the bootstrap (NULL) class loader.
|
||||
// GC walks these as strong roots.
|
||||
null_loader_data->add_class(ak);
|
||||
|
||||
// Call complete_create_array_klass after all instance variables have been initialized.
|
||||
complete_create_array_klass(ak, ak->super(), ModuleEntryTable::javabase_moduleEntry(), CHECK_NULL);
|
||||
|
||||
// Add all classes to our internal class loader list here,
|
||||
// including classes in the bootstrap (NULL) class loader.
|
||||
// Do this step after creating the mirror so that if the
|
||||
// mirror creation fails, loaded_classes_do() doesn't find
|
||||
// an array class without a mirror.
|
||||
null_loader_data->add_class(ak);
|
||||
|
||||
return ak;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue