src/share/vm/runtime/thread.cpp

Print this page




3459       os::start_thread(vmthread);
3460       while (vmthread->active_handles() == NULL) {
3461         Notify_lock->wait();
3462       }
3463     }
3464   }
3465 
3466   assert (Universe::is_fully_initialized(), "not initialized");
3467   if (VerifyDuringStartup) {
3468     // Make sure we're starting with a clean slate.
3469     VM_Verify verify_op;
3470     VMThread::execute(&verify_op);
3471   }
3472 
3473   EXCEPTION_MARK;
3474 
3475   // At this point, the Universe is initialized, but we have not executed
3476   // any byte code.  Now is a good time (the only time) to dump out the
3477   // internal state of the JVM for sharing.
3478   if (DumpSharedSpaces) {










3479     MetaspaceShared::preload_and_dump(CHECK_0);
3480     ShouldNotReachHere();
3481   }
3482 
3483   // Always call even when there are not JVMTI environments yet, since environments
3484   // may be attached late and JVMTI must track phases of VM execution
3485   JvmtiExport::enter_start_phase();
3486 
3487   // Notify JVMTI agents that VM has started (JNI is up) - nop if no agents.
3488   JvmtiExport::post_vm_start();
3489 
3490   {
3491     TraceTime timer("Initialize java.lang classes", TraceStartupTime);
3492 
3493     if (EagerXrunInit && Arguments::init_libraries_at_startup()) {
3494       create_vm_init_libraries();
3495     }
3496 
3497     initialize_class(vmSymbols::java_lang_String(), CHECK_0);
3498 




3459       os::start_thread(vmthread);
3460       while (vmthread->active_handles() == NULL) {
3461         Notify_lock->wait();
3462       }
3463     }
3464   }
3465 
3466   assert (Universe::is_fully_initialized(), "not initialized");
3467   if (VerifyDuringStartup) {
3468     // Make sure we're starting with a clean slate.
3469     VM_Verify verify_op;
3470     VMThread::execute(&verify_op);
3471   }
3472 
3473   EXCEPTION_MARK;
3474 
3475   // At this point, the Universe is initialized, but we have not executed
3476   // any byte code.  Now is a good time (the only time) to dump out the
3477   // internal state of the JVM for sharing.
3478   if (DumpSharedSpaces) {
3479     // To be able to load and dump the internal state we need the young
3480     // generation to be large enough to avoid triggering a GC. By default
3481     // the minimal young size will be enough, but if specifying
3482     // ObjectAlignmentInBytes > 8 we need to ensure that it is at least 4M.
3483     if (ObjectAlignmentInBytes > 8 && NewSize < 4*M) {
3484       vm_exit_during_initialization(err_msg("Incompatible NewSize (" SIZE_FORMAT
3485             "K) for use with ObjectAlignmentInBytes=" SIZE_FORMAT " and -Xshare:dump,"
3486             " it needs to be at least " SIZE_FORMAT"K.",
3487             NewSize/K, ObjectAlignmentInBytes, 4*M/K));
3488     }
3489     MetaspaceShared::preload_and_dump(CHECK_0);
3490     ShouldNotReachHere();
3491   }
3492 
3493   // Always call even when there are not JVMTI environments yet, since environments
3494   // may be attached late and JVMTI must track phases of VM execution
3495   JvmtiExport::enter_start_phase();
3496 
3497   // Notify JVMTI agents that VM has started (JNI is up) - nop if no agents.
3498   JvmtiExport::post_vm_start();
3499 
3500   {
3501     TraceTime timer("Initialize java.lang classes", TraceStartupTime);
3502 
3503     if (EagerXrunInit && Arguments::init_libraries_at_startup()) {
3504       create_vm_init_libraries();
3505     }
3506 
3507     initialize_class(vmSymbols::java_lang_String(), CHECK_0);
3508