Skip to content
Permalink
Browse files
8218145: block_if_requested is not proper inlined due to size
Backport-of: f1fbd69
  • Loading branch information
Dmitry Chuyko authored and Alexander Scherbatiy committed Jul 8, 2021
1 parent 02c0cf6 commit 2beb7e7a5834c45850e1bde8d98ed0839726db20
@@ -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);
}
@@ -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();
static void initialize_serialize_page();
@@ -55,28 +55,11 @@ bool SafepointMechanism::poll(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) {

1 comment on commit 2beb7e7

@openjdk-notifier

This comment has been minimized.

Copy link

@openjdk-notifier openjdk-notifier bot commented on 2beb7e7 Jul 8, 2021

Please sign in to comment.