mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-17 09:34:38 +02:00
8221477: Inject os/cpu-specific constants into Unsafe from JVM
Initialize Unsafe os/cpu-specific constants using injection instead of native callouts Reviewed-by: stuefe, coleenp, dholmes, plevart
This commit is contained in:
parent
7a093bcf50
commit
71164a973b
9 changed files with 190 additions and 52 deletions
|
@ -3628,6 +3628,7 @@ void Threads::initialize_java_lang_classes(JavaThread* main_thread, TRAPS) {
|
|||
initialize_class(vmSymbols::java_lang_Thread(), CHECK);
|
||||
oop thread_object = create_initial_thread(thread_group, main_thread, CHECK);
|
||||
main_thread->set_threadObj(thread_object);
|
||||
|
||||
// Set thread status to running since main thread has
|
||||
// been started and running.
|
||||
java_lang_Thread::set_thread_status(thread_object,
|
||||
|
@ -3636,6 +3637,15 @@ void Threads::initialize_java_lang_classes(JavaThread* main_thread, TRAPS) {
|
|||
// The VM creates objects of this class.
|
||||
initialize_class(vmSymbols::java_lang_Module(), CHECK);
|
||||
|
||||
#ifdef ASSERT
|
||||
InstanceKlass *k = SystemDictionary::UnsafeConstants_klass();
|
||||
assert(k->is_not_initialized(), "UnsafeConstants should not already be initialized");
|
||||
#endif
|
||||
|
||||
// initialize the hardware-specific constants needed by Unsafe
|
||||
initialize_class(vmSymbols::jdk_internal_misc_UnsafeConstants(), CHECK);
|
||||
jdk_internal_misc_UnsafeConstants::set_unsafe_constants();
|
||||
|
||||
// The VM preresolves methods to these classes. Make sure that they get initialized
|
||||
initialize_class(vmSymbols::java_lang_reflect_Method(), CHECK);
|
||||
initialize_class(vmSymbols::java_lang_ref_Finalizer(), CHECK);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue