changeset 53641:61b3b58a1d1d

8214181: safepoint header cleanup Reviewed-by: kbarrett, dholmes, coleenp
author rehn
date Fri, 23 Nov 2018 11:07:54 +0100
parents bbfa1b3aaf7e
children c9325aa887da
files src/hotspot/share/gc/g1/g1HeapVerifier.cpp src/hotspot/share/memory/iterator.cpp src/hotspot/share/runtime/safepoint.hpp src/hotspot/share/runtime/thread.hpp src/hotspot/share/runtime/thread.inline.hpp src/hotspot/share/services/threadService.hpp src/hotspot/share/utilities/hashtable.cpp
diffstat 7 files changed, 34 insertions(+), 19 deletions(-) [+]
line wrap: on
line diff
--- a/src/hotspot/share/gc/g1/g1HeapVerifier.cpp	Fri Nov 23 10:43:18 2018 +0100
+++ b/src/hotspot/share/gc/g1/g1HeapVerifier.cpp	Fri Nov 23 11:07:54 2018 +0100
@@ -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"
--- a/src/hotspot/share/memory/iterator.cpp	Fri Nov 23 10:43:18 2018 +0100
+++ b/src/hotspot/share/memory/iterator.cpp	Fri Nov 23 11:07:54 2018 +0100
@@ -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"
--- a/src/hotspot/share/runtime/safepoint.hpp	Fri Nov 23 10:43:18 2018 +0100
+++ b/src/hotspot/share/runtime/safepoint.hpp	Fri Nov 23 11:07:54 2018 +0100
@@ -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)
--- a/src/hotspot/share/runtime/thread.hpp	Fri Nov 23 10:43:18 2018 +0100
+++ b/src/hotspot/share/runtime/thread.hpp	Fri Nov 23 11:07:54 2018 +0100
@@ -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 @@
  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 @@
   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 @@
   // 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--;
--- a/src/hotspot/share/runtime/thread.inline.hpp	Fri Nov 23 10:43:18 2018 +0100
+++ b/src/hotspot/share/runtime/thread.inline.hpp	Fri Nov 23 11:07:54 2018 +0100
@@ -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 @@
 }
 #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();
--- a/src/hotspot/share/services/threadService.hpp	Fri Nov 23 10:43:18 2018 +0100
+++ b/src/hotspot/share/services/threadService.hpp	Fri Nov 23 11:07:54 2018 +0100
@@ -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"
--- a/src/hotspot/share/utilities/hashtable.cpp	Fri Nov 23 10:43:18 2018 +0100
+++ b/src/hotspot/share/utilities/hashtable.cpp	Fri Nov 23 11:07:54 2018 +0100
@@ -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"