mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 07:14:30 +02:00
8218151: Simplify JavaThread::thread_state definition
Reviewed-by: stefank, dholmes, kbarrett
This commit is contained in:
parent
8f65fa9303
commit
5ce7eb34e4
2 changed files with 12 additions and 9 deletions
|
@ -1280,15 +1280,8 @@ class JavaThread: public Thread {
|
||||||
address last_Java_pc(void) { return _anchor.last_Java_pc(); }
|
address last_Java_pc(void) { return _anchor.last_Java_pc(); }
|
||||||
|
|
||||||
// Safepoint support
|
// Safepoint support
|
||||||
#if !(defined(PPC64) || defined(AARCH64))
|
|
||||||
JavaThreadState thread_state() const { return _thread_state; }
|
|
||||||
void set_thread_state(JavaThreadState s) { _thread_state = s; }
|
|
||||||
#else
|
|
||||||
// Use membars when accessing volatile _thread_state. See
|
|
||||||
// Threads::create_vm() for size checks.
|
|
||||||
inline JavaThreadState thread_state() const;
|
inline JavaThreadState thread_state() const;
|
||||||
inline void set_thread_state(JavaThreadState s);
|
inline void set_thread_state(JavaThreadState s);
|
||||||
#endif
|
|
||||||
inline ThreadSafepointState* safepoint_state() const;
|
inline ThreadSafepointState* safepoint_state() const;
|
||||||
inline void set_safepoint_state(ThreadSafepointState* state);
|
inline void set_safepoint_state(ThreadSafepointState* state);
|
||||||
inline bool is_at_poll_safepoint();
|
inline bool is_at_poll_safepoint();
|
||||||
|
|
|
@ -121,15 +121,25 @@ inline void JavaThread::set_pending_async_exception(oop e) {
|
||||||
set_has_async_exception();
|
set_has_async_exception();
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(PPC64) || defined (AARCH64)
|
|
||||||
inline JavaThreadState JavaThread::thread_state() const {
|
inline JavaThreadState JavaThread::thread_state() const {
|
||||||
|
#if defined(PPC64) || defined (AARCH64)
|
||||||
|
// Use membars when accessing volatile _thread_state. See
|
||||||
|
// Threads::create_vm() for size checks.
|
||||||
return (JavaThreadState) OrderAccess::load_acquire((volatile jint*)&_thread_state);
|
return (JavaThreadState) OrderAccess::load_acquire((volatile jint*)&_thread_state);
|
||||||
|
#else
|
||||||
|
return _thread_state;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void JavaThread::set_thread_state(JavaThreadState s) {
|
inline void JavaThread::set_thread_state(JavaThreadState s) {
|
||||||
|
#if defined(PPC64) || defined (AARCH64)
|
||||||
|
// Use membars when accessing volatile _thread_state. See
|
||||||
|
// Threads::create_vm() for size checks.
|
||||||
OrderAccess::release_store((volatile jint*)&_thread_state, (jint)s);
|
OrderAccess::release_store((volatile jint*)&_thread_state, (jint)s);
|
||||||
}
|
#else
|
||||||
|
_thread_state = s;
|
||||||
#endif
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
ThreadSafepointState* JavaThread::safepoint_state() const {
|
ThreadSafepointState* JavaThread::safepoint_state() const {
|
||||||
return _safepoint_state;
|
return _safepoint_state;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue