8214181: safepoint header cleanup

Reviewed-by: kbarrett, dholmes, coleenp
This commit is contained in:
Robbin Ehn 2018-11-23 11:07:54 +01:00
parent 72235f33c7
commit 751aa57f16
7 changed files with 34 additions and 19 deletions

View File

@ -23,6 +23,7 @@
*/
#include "precompiled.hpp"
#include "code/nmethod.hpp"
#include "gc/g1/g1Allocator.inline.hpp"
#include "gc/g1/g1CollectedHeap.inline.hpp"
#include "gc/g1/g1ConcurrentMarkThread.hpp"

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 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
@ -23,6 +23,7 @@
*/
#include "precompiled.hpp"
#include "code/nmethod.hpp"
#include "memory/iterator.inline.hpp"
#include "memory/universe.hpp"
#include "oops/oop.inline.hpp"

View File

@ -25,13 +25,10 @@
#ifndef SHARE_VM_RUNTIME_SAFEPOINT_HPP
#define SHARE_VM_RUNTIME_SAFEPOINT_HPP
#include "asm/assembler.hpp"
#include "code/nmethod.hpp"
#include "memory/allocation.hpp"
#include "runtime/atomic.hpp"
#include "runtime/extendedPC.hpp"
#include "runtime/mutexLocker.hpp"
#include "runtime/os.hpp"
#include "utilities/globalDefinitions.hpp"
#include "utilities/ostream.hpp"
//
@ -50,8 +47,7 @@
class ThreadSafepointState;
class SnippetCache;
class nmethod;
class JavaThread;
//
// Implements roll-forward to safepoint (safepoint synchronization)

View File

@ -26,6 +26,7 @@
#define SHARE_VM_RUNTIME_THREAD_HPP
#include "jni.h"
#include "code/compiledMethod.hpp"
#include "gc/shared/gcThreadLocalData.hpp"
#include "gc/shared/threadLocalAllocBuffer.hpp"
#include "memory/allocation.hpp"
@ -40,7 +41,6 @@
#include "runtime/os.hpp"
#include "runtime/osThread.hpp"
#include "runtime/park.hpp"
#include "runtime/safepoint.hpp"
#include "runtime/stubRoutines.hpp"
#include "runtime/threadHeapSampler.hpp"
#include "runtime/threadLocalStorage.hpp"
@ -994,7 +994,7 @@ class JavaThread: public Thread {
public: // Expose _thread_state for SafeFetchInt()
volatile JavaThreadState _thread_state;
private:
ThreadSafepointState *_safepoint_state; // Holds information about a thread during a safepoint
ThreadSafepointState* _safepoint_state; // Holds information about a thread during a safepoint
address _saved_exception_pc; // Saved pc of instruction where last implicit exception happened
// JavaThread termination support
@ -1226,9 +1226,9 @@ class JavaThread: public Thread {
inline JavaThreadState thread_state() const;
inline void set_thread_state(JavaThreadState s);
#endif
ThreadSafepointState *safepoint_state() const { return _safepoint_state; }
void set_safepoint_state(ThreadSafepointState *state) { _safepoint_state = state; }
bool is_at_poll_safepoint() { return _safepoint_state->is_at_poll_safepoint(); }
inline ThreadSafepointState* safepoint_state() const;
inline void set_safepoint_state(ThreadSafepointState* state);
inline bool is_at_poll_safepoint();
// JavaThread termination and lifecycle support:
void smr_delete();
@ -1751,13 +1751,7 @@ class JavaThread: public Thread {
// JNI critical regions. These can nest.
bool in_critical() { return _jni_active_critical > 0; }
bool in_last_critical() { return _jni_active_critical == 1; }
void enter_critical() {
assert(Thread::current() == this ||
(Thread::current()->is_VM_thread() &&
SafepointSynchronize::is_synchronizing()),
"this must be current thread or synchronizing");
_jni_active_critical++;
}
inline void enter_critical();
void exit_critical() {
assert(Thread::current() == this, "this must be current thread");
_jni_active_critical--;

View File

@ -29,6 +29,7 @@
#include "runtime/globals.hpp"
#include "runtime/orderAccess.hpp"
#include "runtime/os.inline.hpp"
#include "runtime/safepoint.hpp"
#include "runtime/thread.hpp"
inline void Thread::set_suspend_flag(SuspendFlags f) {
@ -130,6 +131,26 @@ inline void JavaThread::set_thread_state(JavaThreadState s) {
}
#endif
ThreadSafepointState* JavaThread::safepoint_state() const {
return _safepoint_state;
}
void JavaThread::set_safepoint_state(ThreadSafepointState *state) {
_safepoint_state = state;
}
bool JavaThread::is_at_poll_safepoint() {
return _safepoint_state->is_at_poll_safepoint();
}
void JavaThread::enter_critical() {
assert(Thread::current() == this ||
(Thread::current()->is_VM_thread() &&
SafepointSynchronize::is_synchronizing()),
"this must be current thread or synchronizing");
_jni_active_critical++;
}
inline void JavaThread::set_done_attaching_via_jni() {
_jni_attach_state = _attached_via_jni;
OrderAccess::fence();

View File

@ -31,6 +31,7 @@
#include "runtime/jniHandles.hpp"
#include "runtime/objectMonitor.hpp"
#include "runtime/perfData.hpp"
#include "runtime/safepoint.hpp"
#include "runtime/thread.hpp"
#include "runtime/threadSMR.hpp"
#include "services/management.hpp"

View File

@ -31,6 +31,7 @@
#include "classfile/placeholders.hpp"
#include "classfile/protectionDomainCache.hpp"
#include "classfile/stringTable.hpp"
#include "code/nmethod.hpp"
#include "logging/log.hpp"
#include "memory/allocation.inline.hpp"
#include "memory/resourceArea.hpp"