mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 15:24:43 +02:00
8211403: Rename SafepointMechanism::poll(...)
Reviewed-by: mdoerr, dcubed, dholmes
This commit is contained in:
parent
b2541f90e6
commit
e35e0ab165
8 changed files with 13 additions and 13 deletions
|
@ -381,7 +381,7 @@ int CppInterpreter::native_entry(Method* method, intptr_t UNUSED, TRAPS) {
|
||||||
|
|
||||||
// Handle safepoint operations, pending suspend requests,
|
// Handle safepoint operations, pending suspend requests,
|
||||||
// and pending asynchronous exceptions.
|
// and pending asynchronous exceptions.
|
||||||
if (SafepointMechanism::poll(thread) ||
|
if (SafepointMechanism::should_block(thread) ||
|
||||||
thread->has_special_condition_for_native_trans()) {
|
thread->has_special_condition_for_native_trans()) {
|
||||||
JavaThread::check_special_condition_for_native_trans(thread);
|
JavaThread::check_special_condition_for_native_trans(thread);
|
||||||
CHECK_UNHANDLED_OOPS_ONLY(thread->clear_unhandled_oops());
|
CHECK_UNHANDLED_OOPS_ONLY(thread->clear_unhandled_oops());
|
||||||
|
@ -513,7 +513,7 @@ int CppInterpreter::accessor_entry(Method* method, intptr_t UNUSED, TRAPS) {
|
||||||
intptr_t *locals = stack->sp();
|
intptr_t *locals = stack->sp();
|
||||||
|
|
||||||
// Drop into the slow path if we need a safepoint check
|
// 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);
|
return normal_entry(method, 0, THREAD);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -645,7 +645,7 @@ int CppInterpreter::empty_entry(Method* method, intptr_t UNUSED, TRAPS) {
|
||||||
ZeroStack *stack = thread->zero_stack();
|
ZeroStack *stack = thread->zero_stack();
|
||||||
|
|
||||||
// Drop into the slow path if we need a safepoint check
|
// 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);
|
return normal_entry(method, 0, THREAD);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -918,7 +918,7 @@ JVMCIEnv::CodeInstallResult CodeInstaller::initialize_buffer(CodeBuffer& buffer,
|
||||||
last_pc_offset = pc_offset;
|
last_pc_offset = pc_offset;
|
||||||
|
|
||||||
JavaThread* thread = JavaThread::current();
|
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.
|
// this is a hacky way to force a safepoint check but nothing else was jumping out at me.
|
||||||
ThreadToNativeFromVM ttnfv(thread);
|
ThreadToNativeFromVM ttnfv(thread);
|
||||||
}
|
}
|
||||||
|
|
|
@ -162,7 +162,7 @@ class ThreadStateTransition : public StackObj {
|
||||||
// We never install asynchronous exceptions when coming (back) in
|
// We never install asynchronous exceptions when coming (back) in
|
||||||
// to the runtime from native code because the runtime is not set
|
// to the runtime from native code because the runtime is not set
|
||||||
// up to handle exceptions floating around at arbitrary points.
|
// 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);
|
JavaThread::check_safepoint_and_suspend_for_native_trans(thread);
|
||||||
|
|
||||||
// Clear unhandled oops anywhere where we could block, even if we don't.
|
// Clear unhandled oops anywhere where we could block, even if we don't.
|
||||||
|
|
|
@ -383,7 +383,7 @@ int Monitor::TrySpin(Thread * const Self) {
|
||||||
jint rv = Self->rng[0];
|
jint rv = Self->rng[0];
|
||||||
for (int k = Delay; --k >= 0;) {
|
for (int k = Delay; --k >= 0;) {
|
||||||
rv = MarsagliaXORV(rv);
|
rv = MarsagliaXORV(rv);
|
||||||
if (SafepointMechanism::poll(Self)) return 0;
|
if (SafepointMechanism::should_block(Self)) return 0;
|
||||||
}
|
}
|
||||||
Self->rng[0] = rv;
|
Self->rng[0] = rv;
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -1641,7 +1641,7 @@ int ObjectMonitor::TrySpin(Thread * Self) {
|
||||||
// This is in keeping with the "no loitering in runtime" rule.
|
// This is in keeping with the "no loitering in runtime" rule.
|
||||||
// We periodically check to see if there's a safepoint pending.
|
// We periodically check to see if there's a safepoint pending.
|
||||||
if ((ctr & 0xFF) == 0) {
|
if ((ctr & 0xFF) == 0) {
|
||||||
if (SafepointMechanism::poll(Self)) {
|
if (SafepointMechanism::should_block(Self)) {
|
||||||
goto Abort; // abrupt spin egress
|
goto Abort; // abrupt spin egress
|
||||||
}
|
}
|
||||||
SpinPause();
|
SpinPause();
|
||||||
|
|
|
@ -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.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
@ -73,8 +73,8 @@ public:
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
// Call this method to see if this thread has depending poll and appropriate action should be taken
|
// Call this method to see if this thread should block for a safepoint.
|
||||||
static inline bool poll(Thread* thread);
|
static inline bool should_block(Thread* thread);
|
||||||
|
|
||||||
// Blocks a thread until safepoint is completed
|
// Blocks a thread until safepoint is completed
|
||||||
static inline void block_if_requested(JavaThread* thread);
|
static inline void block_if_requested(JavaThread* thread);
|
||||||
|
|
|
@ -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.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
@ -47,7 +47,7 @@ bool SafepointMechanism::local_poll(Thread* thread) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool SafepointMechanism::poll(Thread* thread) {
|
bool SafepointMechanism::should_block(Thread* thread) {
|
||||||
if (uses_thread_local_poll()) {
|
if (uses_thread_local_poll()) {
|
||||||
return local_poll(thread);
|
return local_poll(thread);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -386,7 +386,7 @@ void NMethodSweeper::force_sweep() {
|
||||||
*/
|
*/
|
||||||
void NMethodSweeper::handle_safepoint_request() {
|
void NMethodSweeper::handle_safepoint_request() {
|
||||||
JavaThread* thread = JavaThread::current();
|
JavaThread* thread = JavaThread::current();
|
||||||
if (SafepointMechanism::poll(thread)) {
|
if (SafepointMechanism::should_block(thread)) {
|
||||||
if (PrintMethodFlushing && Verbose) {
|
if (PrintMethodFlushing && Verbose) {
|
||||||
tty->print_cr("### Sweep at %d out of %d, yielding to safepoint", _seen, CodeCache::nmethod_count());
|
tty->print_cr("### Sweep at %d out of %d, yielding to safepoint", _seen, CodeCache::nmethod_count());
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue