8211403: Rename SafepointMechanism::poll(...)
Reviewed-by: mdoerr, dcubed, dholmes
--- a/src/hotspot/cpu/zero/cppInterpreter_zero.cpp Thu Nov 08 10:08:52 2018 +0100
+++ b/src/hotspot/cpu/zero/cppInterpreter_zero.cpp Thu Nov 08 14:32:49 2018 +0100
@@ -381,7 +381,7 @@
// Handle safepoint operations, pending suspend requests,
// and pending asynchronous exceptions.
- if (SafepointMechanism::poll(thread) ||
+ if (SafepointMechanism::should_block(thread) ||
thread->has_special_condition_for_native_trans()) {
JavaThread::check_special_condition_for_native_trans(thread);
CHECK_UNHANDLED_OOPS_ONLY(thread->clear_unhandled_oops());
@@ -513,7 +513,7 @@
intptr_t *locals = stack->sp();
// Drop into the slow path if we need a safepoint check
- if (SafepointMechanism::poll(THREAD)) {
+ if (SafepointMechanism::should_block(THREAD)) {
return normal_entry(method, 0, THREAD);
}
@@ -645,7 +645,7 @@
ZeroStack *stack = thread->zero_stack();
// Drop into the slow path if we need a safepoint check
- if (SafepointMechanism::poll(THREAD)) {
+ if (SafepointMechanism::should_block(THREAD)) {
return normal_entry(method, 0, THREAD);
}
--- a/src/hotspot/share/jvmci/jvmciCodeInstaller.cpp Thu Nov 08 10:08:52 2018 +0100
+++ b/src/hotspot/share/jvmci/jvmciCodeInstaller.cpp Thu Nov 08 14:32:49 2018 +0100
@@ -918,7 +918,7 @@
last_pc_offset = pc_offset;
JavaThread* thread = JavaThread::current();
- if (SafepointMechanism::poll(thread)) {
+ if (SafepointMechanism::should_block(thread)) {
// this is a hacky way to force a safepoint check but nothing else was jumping out at me.
ThreadToNativeFromVM ttnfv(thread);
}
--- a/src/hotspot/share/runtime/interfaceSupport.inline.hpp Thu Nov 08 10:08:52 2018 +0100
+++ b/src/hotspot/share/runtime/interfaceSupport.inline.hpp Thu Nov 08 14:32:49 2018 +0100
@@ -162,7 +162,7 @@
// We never install asynchronous exceptions when coming (back) in
// to the runtime from native code because the runtime is not set
// up to handle exceptions floating around at arbitrary points.
- if (SafepointMechanism::poll(thread) || thread->is_suspend_after_native()) {
+ if (SafepointMechanism::should_block(thread) || thread->is_suspend_after_native()) {
JavaThread::check_safepoint_and_suspend_for_native_trans(thread);
// Clear unhandled oops anywhere where we could block, even if we don't.
--- a/src/hotspot/share/runtime/mutex.cpp Thu Nov 08 10:08:52 2018 +0100
+++ b/src/hotspot/share/runtime/mutex.cpp Thu Nov 08 14:32:49 2018 +0100
@@ -383,7 +383,7 @@
jint rv = Self->rng[0];
for (int k = Delay; --k >= 0;) {
rv = MarsagliaXORV(rv);
- if (SafepointMechanism::poll(Self)) return 0;
+ if (SafepointMechanism::should_block(Self)) return 0;
}
Self->rng[0] = rv;
} else {
--- a/src/hotspot/share/runtime/objectMonitor.cpp Thu Nov 08 10:08:52 2018 +0100
+++ b/src/hotspot/share/runtime/objectMonitor.cpp Thu Nov 08 14:32:49 2018 +0100
@@ -1641,7 +1641,7 @@
// This is in keeping with the "no loitering in runtime" rule.
// We periodically check to see if there's a safepoint pending.
if ((ctr & 0xFF) == 0) {
- if (SafepointMechanism::poll(Self)) {
+ if (SafepointMechanism::should_block(Self)) {
goto Abort; // abrupt spin egress
}
SpinPause();
--- a/src/hotspot/share/runtime/safepointMechanism.hpp Thu Nov 08 10:08:52 2018 +0100
+++ b/src/hotspot/share/runtime/safepointMechanism.hpp Thu Nov 08 14:32:49 2018 +0100
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2018, 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
@@ -73,8 +73,8 @@
#endif
}
- // Call this method to see if this thread has depending poll and appropriate action should be taken
- static inline bool poll(Thread* thread);
+ // Call this method to see if this thread should block for a safepoint.
+ static inline bool should_block(Thread* thread);
// Blocks a thread until safepoint is completed
static inline void block_if_requested(JavaThread* thread);
--- a/src/hotspot/share/runtime/safepointMechanism.inline.hpp Thu Nov 08 10:08:52 2018 +0100
+++ b/src/hotspot/share/runtime/safepointMechanism.inline.hpp Thu Nov 08 14:32:49 2018 +0100
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2018, 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
@@ -47,7 +47,7 @@
}
}
-bool SafepointMechanism::poll(Thread* thread) {
+bool SafepointMechanism::should_block(Thread* thread) {
if (uses_thread_local_poll()) {
return local_poll(thread);
} else {
--- a/src/hotspot/share/runtime/sweeper.cpp Thu Nov 08 10:08:52 2018 +0100
+++ b/src/hotspot/share/runtime/sweeper.cpp Thu Nov 08 14:32:49 2018 +0100
@@ -386,7 +386,7 @@
*/
void NMethodSweeper::handle_safepoint_request() {
JavaThread* thread = JavaThread::current();
- if (SafepointMechanism::poll(thread)) {
+ if (SafepointMechanism::should_block(thread)) {
if (PrintMethodFlushing && Verbose) {
tty->print_cr("### Sweep at %d out of %d, yielding to safepoint", _seen, CodeCache::nmethod_count());
}