8218145: block_if_requested is not proper inlined due to size

Reviewed-by: kbarrett, coleenp, gziemski
This commit is contained in:
Robbin Ehn 2019-02-04 21:42:47 +01:00
parent 9b0b058ee7
commit f1fbd69478
3 changed files with 15 additions and 22 deletions

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -83,6 +83,16 @@ void SafepointMechanism::default_initialize() {
}
}
void SafepointMechanism::block_if_requested_slow(JavaThread *thread) {
// local poll already checked, if used.
if (global_poll()) {
SafepointSynchronize::block(thread);
}
if (uses_thread_local_poll() && thread->has_handshake()) {
thread->handshake_process_by_self();
}
}
void SafepointMechanism::initialize_header(JavaThread* thread) {
disarm_local_poll(thread);
}

View File

@ -49,7 +49,7 @@ class SafepointMechanism : public AllStatic {
static inline bool local_poll(Thread* thread);
static inline bool global_poll();
static inline void block_if_requested_local_poll(JavaThread *thread);
static void block_if_requested_slow(JavaThread *thread);
static void default_initialize();

View File

@ -55,28 +55,11 @@ bool SafepointMechanism::should_block(Thread* thread) {
}
}
void SafepointMechanism::block_if_requested_local_poll(JavaThread *thread) {
bool armed = local_poll_armed(thread); // load acquire, polling page -> op / global state
if(armed) {
// We could be armed for either a handshake operation or a safepoint
if (global_poll()) {
SafepointSynchronize::block(thread);
}
if (thread->has_handshake()) {
thread->handshake_process_by_self();
}
}
}
void SafepointMechanism::block_if_requested(JavaThread *thread) {
if (uses_thread_local_poll()) {
block_if_requested_local_poll(thread);
} else {
// If we don't have per thread poll this could a handshake or a safepoint
if (global_poll()) {
SafepointSynchronize::block(thread);
}
if (uses_thread_local_poll() && !SafepointMechanism::local_poll_armed(thread)) {
return;
}
block_if_requested_slow(thread);
}
void SafepointMechanism::arm_local_poll(JavaThread* thread) {