hotspot/src/share/vm/runtime/thread.cpp
changeset 36178 9739f8c767da
parent 35825 7c7652ee137b
child 36186 06763de0d7ad
equal deleted inserted replaced
36177:b2b76aba8e42 36178:9739f8c767da
    65 #include "runtime/init.hpp"
    65 #include "runtime/init.hpp"
    66 #include "runtime/interfaceSupport.hpp"
    66 #include "runtime/interfaceSupport.hpp"
    67 #include "runtime/java.hpp"
    67 #include "runtime/java.hpp"
    68 #include "runtime/javaCalls.hpp"
    68 #include "runtime/javaCalls.hpp"
    69 #include "runtime/jniPeriodicChecker.hpp"
    69 #include "runtime/jniPeriodicChecker.hpp"
       
    70 #include "runtime/logTimer.hpp"
    70 #include "runtime/memprofiler.hpp"
    71 #include "runtime/memprofiler.hpp"
    71 #include "runtime/mutexLocker.hpp"
    72 #include "runtime/mutexLocker.hpp"
    72 #include "runtime/objectMonitor.hpp"
    73 #include "runtime/objectMonitor.hpp"
    73 #include "runtime/orderAccess.inline.hpp"
    74 #include "runtime/orderAccess.inline.hpp"
    74 #include "runtime/osThread.hpp"
    75 #include "runtime/osThread.hpp"
  3339 
  3340 
  3340   // If CompilerThreads ever become non-JavaThreads, add them here
  3341   // If CompilerThreads ever become non-JavaThreads, add them here
  3341 }
  3342 }
  3342 
  3343 
  3343 void Threads::initialize_java_lang_classes(JavaThread* main_thread, TRAPS) {
  3344 void Threads::initialize_java_lang_classes(JavaThread* main_thread, TRAPS) {
  3344   TraceTime timer("Initialize java.lang classes", TraceStartupTime);
  3345   TraceStartupTime timer("Initialize java.lang classes");
  3345 
  3346 
  3346   if (EagerXrunInit && Arguments::init_libraries_at_startup()) {
  3347   if (EagerXrunInit && Arguments::init_libraries_at_startup()) {
  3347     create_vm_init_libraries();
  3348     create_vm_init_libraries();
  3348   }
  3349   }
  3349 
  3350 
  3386   initialize_class(vmSymbols::java_lang_IllegalMonitorStateException(), CHECK);
  3387   initialize_class(vmSymbols::java_lang_IllegalMonitorStateException(), CHECK);
  3387   initialize_class(vmSymbols::java_lang_IllegalArgumentException(), CHECK);
  3388   initialize_class(vmSymbols::java_lang_IllegalArgumentException(), CHECK);
  3388 }
  3389 }
  3389 
  3390 
  3390 void Threads::initialize_jsr292_core_classes(TRAPS) {
  3391 void Threads::initialize_jsr292_core_classes(TRAPS) {
       
  3392   TraceStartupTime timer("Initialize java.lang.invoke classes");
       
  3393 
  3391   initialize_class(vmSymbols::java_lang_invoke_MethodHandle(), CHECK);
  3394   initialize_class(vmSymbols::java_lang_invoke_MethodHandle(), CHECK);
  3392   initialize_class(vmSymbols::java_lang_invoke_MemberName(), CHECK);
  3395   initialize_class(vmSymbols::java_lang_invoke_MemberName(), CHECK);
  3393   initialize_class(vmSymbols::java_lang_invoke_MethodHandleNatives(), CHECK);
  3396   initialize_class(vmSymbols::java_lang_invoke_MethodHandleNatives(), CHECK);
  3394 }
  3397 }
  3395 
  3398 
  3455   }
  3458   }
  3456 
  3459 
  3457   HOTSPOT_VM_INIT_BEGIN();
  3460   HOTSPOT_VM_INIT_BEGIN();
  3458 
  3461 
  3459   // Timing (must come after argument parsing)
  3462   // Timing (must come after argument parsing)
  3460   TraceTime timer("Create VM", TraceStartupTime);
  3463   TraceStartupTime timer("Create VM");
  3461 
  3464 
  3462   // Initialize the os module after parsing the args
  3465   // Initialize the os module after parsing the args
  3463   jint os_init_2_result = os::init_2();
  3466   jint os_init_2_result = os::init_2();
  3464   if (os_init_2_result != JNI_OK) return os_init_2_result;
  3467   if (os_init_2_result != JNI_OK) return os_init_2_result;
  3465 
  3468 
  3540   // Any JVMTI raw monitors entered in onload will transition into
  3543   // Any JVMTI raw monitors entered in onload will transition into
  3541   // real raw monitor. VM is setup enough here for raw monitor enter.
  3544   // real raw monitor. VM is setup enough here for raw monitor enter.
  3542   JvmtiExport::transition_pending_onload_raw_monitors();
  3545   JvmtiExport::transition_pending_onload_raw_monitors();
  3543 
  3546 
  3544   // Create the VMThread
  3547   // Create the VMThread
  3545   { TraceTime timer("Start VMThread", TraceStartupTime);
  3548   { TraceStartupTime timer("Start VMThread");
  3546     VMThread::create();
  3549 
       
  3550   VMThread::create();
  3547     Thread* vmthread = VMThread::vm_thread();
  3551     Thread* vmthread = VMThread::vm_thread();
  3548 
  3552 
  3549     if (!os::create_thread(vmthread, os::vm_thread)) {
  3553     if (!os::create_thread(vmthread, os::vm_thread)) {
  3550       vm_exit_during_initialization("Cannot create VM thread. "
  3554       vm_exit_during_initialization("Cannot create VM thread. "
  3551                                     "Out of system resources.");
  3555                                     "Out of system resources.");