8073388: Get rid of the depenecy from handles.hpp to oop.inline.hpp
authorstefank
Wed, 18 Feb 2015 09:22:37 +0100
changeset 29199 db7ae483ecb2
parent 29084 1b732f2836ce
child 29200 5e480434bef4
8073388: Get rid of the depenecy from handles.hpp to oop.inline.hpp Reviewed-by: mgerdin, coleenp
hotspot/src/share/vm/ci/ciKlass.hpp
hotspot/src/share/vm/classfile/classLoaderExt.hpp
hotspot/src/share/vm/memory/genRemSet.cpp
hotspot/src/share/vm/runtime/handles.cpp
hotspot/src/share/vm/runtime/handles.hpp
--- a/hotspot/src/share/vm/ci/ciKlass.hpp	Wed Feb 18 08:57:29 2015 +0100
+++ b/hotspot/src/share/vm/ci/ciKlass.hpp	Wed Feb 18 09:22:37 2015 +0100
@@ -26,6 +26,7 @@
 #define SHARE_VM_CI_CIKLASS_HPP
 
 #include "ci/ciType.hpp"
+#include "oops/klass.hpp"
 
 // ciKlass
 //
--- a/hotspot/src/share/vm/classfile/classLoaderExt.hpp	Wed Feb 18 08:57:29 2015 +0100
+++ b/hotspot/src/share/vm/classfile/classLoaderExt.hpp	Wed Feb 18 09:22:37 2015 +0100
@@ -26,6 +26,8 @@
 #define SHARE_VM_CLASSFILE_CLASSLOADEREXT_HPP
 
 #include "classfile/classLoader.hpp"
+#include "oops/instanceKlass.hpp"
+#include "runtime/handles.hpp"
 
 class ClassLoaderExt: public ClassLoader { // AllStatic
 public:
--- a/hotspot/src/share/vm/memory/genRemSet.cpp	Wed Feb 18 08:57:29 2015 +0100
+++ b/hotspot/src/share/vm/memory/genRemSet.cpp	Wed Feb 18 09:22:37 2015 +0100
@@ -26,6 +26,7 @@
 #include "classfile/classLoaderData.hpp"
 #include "memory/cardTableRS.hpp"
 #include "memory/genRemSet.hpp"
+#include "oops/klass.hpp"
 
 // This kind of "BarrierSet" allows a "CollectedHeap" to detect and
 // enumerate ref fields that have been modified (since the last
--- a/hotspot/src/share/vm/runtime/handles.cpp	Wed Feb 18 08:57:29 2015 +0100
+++ b/hotspot/src/share/vm/runtime/handles.cpp	Wed Feb 18 09:22:37 2015 +0100
@@ -214,4 +214,8 @@
   area->_no_handle_mark_nesting = _no_handle_mark_nesting;
 }
 
+bool instanceKlassHandle::is_instanceKlass(const Klass* k) {
+  return k->oop_is_instance();
+}
+
 #endif
--- a/hotspot/src/share/vm/runtime/handles.hpp	Wed Feb 18 08:57:29 2015 +0100
+++ b/hotspot/src/share/vm/runtime/handles.hpp	Wed Feb 18 09:22:37 2015 +0100
@@ -25,7 +25,11 @@
 #ifndef SHARE_VM_RUNTIME_HANDLES_HPP
 #define SHARE_VM_RUNTIME_HANDLES_HPP
 
-#include "oops/klass.hpp"
+#include "oops/oop.hpp"
+#include "oops/oopsHierarchy.hpp"
+
+class InstanceKlass;
+class Klass;
 
 //------------------------------------------------------------------------------------------------------------------------
 // In order to preserve oops during garbage collection, they should be
@@ -201,16 +205,16 @@
   /* Constructors */
   instanceKlassHandle () : KlassHandle() {}
   instanceKlassHandle (const Klass* k) : KlassHandle(k) {
-    assert(k == NULL || k->oop_is_instance(),
-           "illegal type");
+    assert(k == NULL || is_instanceKlass(k), "illegal type");
   }
   instanceKlassHandle (Thread* thread, const Klass* k) : KlassHandle(thread, k) {
-    assert(k == NULL || k->oop_is_instance(),
-           "illegal type");
+    assert(k == NULL || is_instanceKlass(k), "illegal type");
   }
   /* Access to klass part */
   InstanceKlass*       operator () () const { return (InstanceKlass*)obj(); }
   InstanceKlass*       operator -> () const { return (InstanceKlass*)obj(); }
+
+  debug_only(bool is_instanceKlass(const Klass* k));
 };