src/share/vm/runtime/thread.cpp

Print this page




 945   JavaValue result(T_VOID);
 946   JavaCalls::call_special(&result, thread_oop,
 947                                    klass,
 948                                    vmSymbols::object_initializer_name(),
 949                                    vmSymbols::threadgroup_string_void_signature(),
 950                                    thread_group,
 951                                    string,
 952                                    CHECK_NULL);
 953   return thread_oop();
 954 }
 955 
 956 static void call_initializeSystemClass(TRAPS) {
 957   klassOop k =  SystemDictionary::resolve_or_fail(vmSymbols::java_lang_System(), true, CHECK);
 958   instanceKlassHandle klass (THREAD, k);
 959 
 960   JavaValue result(T_VOID);
 961   JavaCalls::call_static(&result, klass, vmSymbols::initializeSystemClass_name(),
 962                                          vmSymbols::void_method_signature(), CHECK);
 963 }
 964 
 965 #ifdef KERNEL
 966 static void set_jkernel_boot_classloader_hook(TRAPS) {
 967   klassOop k = SystemDictionary::sun_jkernel_DownloadManager_klass();
 968   instanceKlassHandle klass (THREAD, k);
 969 
 970   if (k == NULL) {
 971     // sun.jkernel.DownloadManager may not present in the JDK; just return
 972     return;
 973   }
 974 
 975   JavaValue result(T_VOID);
 976   JavaCalls::call_static(&result, klass, vmSymbols::setBootClassLoaderHook_name(),
 977                                          vmSymbols::void_method_signature(), CHECK);
 978 }
 979 #endif // KERNEL
 980 
 981 // General purpose hook into Java code, run once when the VM is initialized.
 982 // The Java library method itself may be changed independently from the VM.
 983 static void call_postVMInitHook(TRAPS) {
 984   klassOop k = SystemDictionary::sun_misc_PostVMInitHook_klass();
 985   instanceKlassHandle klass (THREAD, k);
 986   if (klass.not_null()) {
 987     JavaValue result(T_VOID);
 988     JavaCalls::call_static(&result, klass, vmSymbols::run_method_name(),
 989                                            vmSymbols::void_method_signature(),
 990                                            CHECK);
 991   }
 992 }
 993 
 994 static void reset_vm_info_property(TRAPS) {
 995   // the vm info string
 996   ResourceMark rm(THREAD);
 997   const char *vm_info = VM_Version::vm_info_string();
 998 
 999   // java.lang.System class
1000   klassOop k =  SystemDictionary::resolve_or_fail(vmSymbols::java_lang_System(), true, CHECK);


3267 
3268   // Set flag that basic initialization has completed. Used by exceptions and various
3269   // debug stuff, that does not work until all basic classes have been initialized.
3270   set_init_completed();
3271 
3272   HS_DTRACE_PROBE(hotspot, vm__init__end);
3273 
3274   // record VM initialization completion time
3275   Management::record_vm_init_completed();
3276 
3277   // Compute system loader. Note that this has to occur after set_init_completed, since
3278   // valid exceptions may be thrown in the process.
3279   // Note that we do not use CHECK_0 here since we are inside an EXCEPTION_MARK and
3280   // set_init_completed has just been called, causing exceptions not to be shortcut
3281   // anymore. We call vm_exit_during_initialization directly instead.
3282   SystemDictionary::compute_java_system_loader(THREAD);
3283   if (HAS_PENDING_EXCEPTION) {
3284     vm_exit_during_initialization(Handle(THREAD, PENDING_EXCEPTION));
3285   }
3286 
3287 #ifdef KERNEL
3288   if (JDK_Version::is_gte_jdk17x_version()) {
3289     set_jkernel_boot_classloader_hook(THREAD);
3290   }
3291 #endif // KERNEL
3292 
3293 #ifndef SERIALGC
3294   // Support for ConcurrentMarkSweep. This should be cleaned up
3295   // and better encapsulated. The ugly nested if test would go away
3296   // once things are properly refactored. XXX YSR
3297   if (UseConcMarkSweepGC || UseG1GC) {
3298     if (UseConcMarkSweepGC) {
3299       ConcurrentMarkSweepThread::makeSurrogateLockerThread(THREAD);
3300     } else {
3301       ConcurrentMarkThread::makeSurrogateLockerThread(THREAD);
3302     }
3303     if (HAS_PENDING_EXCEPTION) {
3304       vm_exit_during_initialization(Handle(THREAD, PENDING_EXCEPTION));
3305     }
3306   }
3307 #endif // SERIALGC
3308 
3309   // Always call even when there are not JVMTI environments yet, since environments
3310   // may be attached late and JVMTI must track phases of VM execution
3311   JvmtiExport::enter_live_phase();
3312 




 945   JavaValue result(T_VOID);
 946   JavaCalls::call_special(&result, thread_oop,
 947                                    klass,
 948                                    vmSymbols::object_initializer_name(),
 949                                    vmSymbols::threadgroup_string_void_signature(),
 950                                    thread_group,
 951                                    string,
 952                                    CHECK_NULL);
 953   return thread_oop();
 954 }
 955 
 956 static void call_initializeSystemClass(TRAPS) {
 957   klassOop k =  SystemDictionary::resolve_or_fail(vmSymbols::java_lang_System(), true, CHECK);
 958   instanceKlassHandle klass (THREAD, k);
 959 
 960   JavaValue result(T_VOID);
 961   JavaCalls::call_static(&result, klass, vmSymbols::initializeSystemClass_name(),
 962                                          vmSymbols::void_method_signature(), CHECK);
 963 }
 964 
















 965 // General purpose hook into Java code, run once when the VM is initialized.
 966 // The Java library method itself may be changed independently from the VM.
 967 static void call_postVMInitHook(TRAPS) {
 968   klassOop k = SystemDictionary::sun_misc_PostVMInitHook_klass();
 969   instanceKlassHandle klass (THREAD, k);
 970   if (klass.not_null()) {
 971     JavaValue result(T_VOID);
 972     JavaCalls::call_static(&result, klass, vmSymbols::run_method_name(),
 973                                            vmSymbols::void_method_signature(),
 974                                            CHECK);
 975   }
 976 }
 977 
 978 static void reset_vm_info_property(TRAPS) {
 979   // the vm info string
 980   ResourceMark rm(THREAD);
 981   const char *vm_info = VM_Version::vm_info_string();
 982 
 983   // java.lang.System class
 984   klassOop k =  SystemDictionary::resolve_or_fail(vmSymbols::java_lang_System(), true, CHECK);


3251 
3252   // Set flag that basic initialization has completed. Used by exceptions and various
3253   // debug stuff, that does not work until all basic classes have been initialized.
3254   set_init_completed();
3255 
3256   HS_DTRACE_PROBE(hotspot, vm__init__end);
3257 
3258   // record VM initialization completion time
3259   Management::record_vm_init_completed();
3260 
3261   // Compute system loader. Note that this has to occur after set_init_completed, since
3262   // valid exceptions may be thrown in the process.
3263   // Note that we do not use CHECK_0 here since we are inside an EXCEPTION_MARK and
3264   // set_init_completed has just been called, causing exceptions not to be shortcut
3265   // anymore. We call vm_exit_during_initialization directly instead.
3266   SystemDictionary::compute_java_system_loader(THREAD);
3267   if (HAS_PENDING_EXCEPTION) {
3268     vm_exit_during_initialization(Handle(THREAD, PENDING_EXCEPTION));
3269   }
3270 






3271 #ifndef SERIALGC
3272   // Support for ConcurrentMarkSweep. This should be cleaned up
3273   // and better encapsulated. The ugly nested if test would go away
3274   // once things are properly refactored. XXX YSR
3275   if (UseConcMarkSweepGC || UseG1GC) {
3276     if (UseConcMarkSweepGC) {
3277       ConcurrentMarkSweepThread::makeSurrogateLockerThread(THREAD);
3278     } else {
3279       ConcurrentMarkThread::makeSurrogateLockerThread(THREAD);
3280     }
3281     if (HAS_PENDING_EXCEPTION) {
3282       vm_exit_during_initialization(Handle(THREAD, PENDING_EXCEPTION));
3283     }
3284   }
3285 #endif // SERIALGC
3286 
3287   // Always call even when there are not JVMTI environments yet, since environments
3288   // may be attached late and JVMTI must track phases of VM execution
3289   JvmtiExport::enter_live_phase();
3290