src/hotspot/share/runtime/thread.cpp
changeset 50557 83e2deb73612
parent 50456 cb75455ada5a
child 50626 9fdfe5ca0e5e
equal deleted inserted replaced
50556:e5a40146791b 50557:83e2deb73612
  1125                            vmSymbols::void_method_signature(),
  1125                            vmSymbols::void_method_signature(),
  1126                            CHECK);
  1126                            CHECK);
  1127   }
  1127   }
  1128 }
  1128 }
  1129 
  1129 
  1130 static void reset_vm_info_property(TRAPS) {
       
  1131   // the vm info string
       
  1132   ResourceMark rm(THREAD);
       
  1133   const char *vm_info = VM_Version::vm_info_string();
       
  1134 
       
  1135   // update the native system property first
       
  1136   Arguments::PropertyList_update_value(Arguments::system_properties(), "java.vm.info", vm_info);
       
  1137 
       
  1138   // java.lang.System class
       
  1139   Klass* klass =  SystemDictionary::resolve_or_fail(vmSymbols::java_lang_System(), true, CHECK);
       
  1140 
       
  1141   // setProperty arguments
       
  1142   Handle key_str    = java_lang_String::create_from_str("java.vm.info", CHECK);
       
  1143   Handle value_str  = java_lang_String::create_from_str(vm_info, CHECK);
       
  1144 
       
  1145   // return value
       
  1146   JavaValue r(T_OBJECT);
       
  1147 
       
  1148   // public static String setProperty(String key, String value);
       
  1149   JavaCalls::call_static(&r,
       
  1150                          klass,
       
  1151                          vmSymbols::setProperty_name(),
       
  1152                          vmSymbols::string_string_string_signature(),
       
  1153                          key_str,
       
  1154                          value_str,
       
  1155                          CHECK);
       
  1156 }
       
  1157 
       
  1158 
       
  1159 void JavaThread::allocate_threadObj(Handle thread_group, const char* thread_name,
  1130 void JavaThread::allocate_threadObj(Handle thread_group, const char* thread_name,
  1160                                     bool daemon, TRAPS) {
  1131                                     bool daemon, TRAPS) {
  1161   assert(thread_group.not_null(), "thread group should be specified");
  1132   assert(thread_group.not_null(), "thread group should be specified");
  1162   assert(threadObj() == NULL, "should only create Java thread object once");
  1133   assert(threadObj() == NULL, "should only create Java thread object once");
  1163 
  1134 
  3769     // Make sure we're starting with a clean slate.
  3740     // Make sure we're starting with a clean slate.
  3770     VM_Verify verify_op;
  3741     VM_Verify verify_op;
  3771     VMThread::execute(&verify_op);
  3742     VMThread::execute(&verify_op);
  3772   }
  3743   }
  3773 
  3744 
  3774   Thread* THREAD = Thread::current();
       
  3775 
       
  3776   // Always call even when there are not JVMTI environments yet, since environments
       
  3777   // may be attached late and JVMTI must track phases of VM execution
       
  3778   JvmtiExport::enter_early_start_phase();
       
  3779 
       
  3780   // Notify JVMTI agents that VM has started (JNI is up) - nop if no agents.
       
  3781   JvmtiExport::post_early_vm_start();
       
  3782 
       
  3783   initialize_java_lang_classes(main_thread, CHECK_JNI_ERR);
       
  3784 
       
  3785   // We need this to update the java.vm.info property in case any flags used
  3745   // We need this to update the java.vm.info property in case any flags used
  3786   // to initially define it have been changed. This is needed for both CDS and
  3746   // to initially define it have been changed. This is needed for both CDS and
  3787   // AOT, since UseSharedSpaces and UseAOT may be changed after java.vm.info
  3747   // AOT, since UseSharedSpaces and UseAOT may be changed after java.vm.info
  3788   // is initially computed. See Abstract_VM_Version::vm_info_string().
  3748   // is initially computed. See Abstract_VM_Version::vm_info_string().
  3789   reset_vm_info_property(CHECK_JNI_ERR);
  3749   // This update must happen before we initialize the java classes, but
       
  3750   // after any initialization logic that might modify the flags.
       
  3751   Arguments::update_vm_info_property(VM_Version::vm_info_string());
       
  3752 
       
  3753   Thread* THREAD = Thread::current();
       
  3754 
       
  3755   // Always call even when there are not JVMTI environments yet, since environments
       
  3756   // may be attached late and JVMTI must track phases of VM execution
       
  3757   JvmtiExport::enter_early_start_phase();
       
  3758 
       
  3759   // Notify JVMTI agents that VM has started (JNI is up) - nop if no agents.
       
  3760   JvmtiExport::post_early_vm_start();
       
  3761 
       
  3762   initialize_java_lang_classes(main_thread, CHECK_JNI_ERR);
  3790 
  3763 
  3791   quicken_jni_functions();
  3764   quicken_jni_functions();
  3792 
  3765 
  3793   // No more stub generation allowed after that point.
  3766   // No more stub generation allowed after that point.
  3794   StubCodeDesc::freeze();
  3767   StubCodeDesc::freeze();