From 1fd400608e9ea423a6e4f1797652bd02f027da1b Mon Sep 17 00:00:00 2001 From: Coleen Phillimore Date: Fri, 14 Apr 2023 15:34:29 +0000 Subject: [PATCH] 8305405: Compile_lock not needed in Universe::genesis() Reviewed-by: dholmes, fparain --- src/hotspot/share/memory/universe.cpp | 41 +++++++++++++-------------- 1 file changed, 19 insertions(+), 22 deletions(-) diff --git a/src/hotspot/share/memory/universe.cpp b/src/hotspot/share/memory/universe.cpp index 1bef6b69aa3..a7cf043aa7e 100644 --- a/src/hotspot/share/memory/universe.cpp +++ b/src/hotspot/share/memory/universe.cpp @@ -326,31 +326,28 @@ void Universe::genesis(TRAPS) { { AutoModifyRestore temporarily(_bootstrapping, true); - { MutexLocker mc(THREAD, Compile_lock); + java_lang_Class::allocate_fixup_lists(); - java_lang_Class::allocate_fixup_lists(); + // determine base vtable size; without that we cannot create the array klasses + compute_base_vtable_size(); - // determine base vtable size; without that we cannot create the array klasses - compute_base_vtable_size(); - - if (!UseSharedSpaces) { - // Initialization of the fillerArrayKlass must come before regular - // int-TypeArrayKlass so that the int-Array mirror points to the - // int-TypeArrayKlass. - _fillerArrayKlassObj = TypeArrayKlass::create_klass(T_INT, "Ljdk/internal/vm/FillerArray;", CHECK); - for (int i = T_BOOLEAN; i < T_LONG+1; i++) { - _typeArrayKlassObjs[i] = TypeArrayKlass::create_klass((BasicType)i, CHECK); - } - - ClassLoaderData* null_cld = ClassLoaderData::the_null_class_loader_data(); - - _the_array_interfaces_array = MetadataFactory::new_array(null_cld, 2, nullptr, CHECK); - _the_empty_int_array = MetadataFactory::new_array(null_cld, 0, CHECK); - _the_empty_short_array = MetadataFactory::new_array(null_cld, 0, CHECK); - _the_empty_method_array = MetadataFactory::new_array(null_cld, 0, CHECK); - _the_empty_klass_array = MetadataFactory::new_array(null_cld, 0, CHECK); - _the_empty_instance_klass_array = MetadataFactory::new_array(null_cld, 0, CHECK); + if (!UseSharedSpaces) { + // Initialization of the fillerArrayKlass must come before regular + // int-TypeArrayKlass so that the int-Array mirror points to the + // int-TypeArrayKlass. + _fillerArrayKlassObj = TypeArrayKlass::create_klass(T_INT, "Ljdk/internal/vm/FillerArray;", CHECK); + for (int i = T_BOOLEAN; i < T_LONG+1; i++) { + _typeArrayKlassObjs[i] = TypeArrayKlass::create_klass((BasicType)i, CHECK); } + + ClassLoaderData* null_cld = ClassLoaderData::the_null_class_loader_data(); + + _the_array_interfaces_array = MetadataFactory::new_array(null_cld, 2, nullptr, CHECK); + _the_empty_int_array = MetadataFactory::new_array(null_cld, 0, CHECK); + _the_empty_short_array = MetadataFactory::new_array(null_cld, 0, CHECK); + _the_empty_method_array = MetadataFactory::new_array(null_cld, 0, CHECK); + _the_empty_klass_array = MetadataFactory::new_array(null_cld, 0, CHECK); + _the_empty_instance_klass_array = MetadataFactory::new_array(null_cld, 0, CHECK); } vmSymbols::initialize();