mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-18 01:54:47 +02:00
8199717: Avoid calculating primordial thread stack bounds on VM startup
Reviewed-by: dholmes, rehn, stuefe
This commit is contained in:
parent
05dd65349b
commit
4d780ef52d
1 changed files with 15 additions and 1 deletions
|
@ -152,6 +152,13 @@ static jlong initial_time_count=0;
|
|||
|
||||
static int clock_tics_per_sec = 100;
|
||||
|
||||
// If the VM might have been created on the primordial thread, we need to resolve the
|
||||
// primordial thread stack bounds and check if the current thread might be the
|
||||
// primordial thread in places. If we know that the primordial thread is never used,
|
||||
// such as when the VM was created by one of the standard java launchers, we can
|
||||
// avoid this
|
||||
static bool suppress_primordial_thread_resolution = false;
|
||||
|
||||
// For diagnostics to print a message once. see run_periodic_checks
|
||||
static sigset_t check_signal_done;
|
||||
static bool check_signals = true;
|
||||
|
@ -917,6 +924,9 @@ void os::free_thread(OSThread* osthread) {
|
|||
|
||||
// Check if current thread is the primordial thread, similar to Solaris thr_main.
|
||||
bool os::is_primordial_thread(void) {
|
||||
if (suppress_primordial_thread_resolution) {
|
||||
return false;
|
||||
}
|
||||
char dummy;
|
||||
// If called before init complete, thread stack bottom will be null.
|
||||
// Can be called if fatal error occurs before initialization.
|
||||
|
@ -4933,7 +4943,11 @@ jint os::init_2(void) {
|
|||
if (Posix::set_minimum_stack_sizes() == JNI_ERR) {
|
||||
return JNI_ERR;
|
||||
}
|
||||
Linux::capture_initial_stack(JavaThread::stack_size_at_create());
|
||||
|
||||
suppress_primordial_thread_resolution = Arguments::created_by_java_launcher();
|
||||
if (!suppress_primordial_thread_resolution) {
|
||||
Linux::capture_initial_stack(JavaThread::stack_size_at_create());
|
||||
}
|
||||
|
||||
#if defined(IA32)
|
||||
workaround_expand_exec_shield_cs_limit();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue