8216157: Enable inlining of java_lang_Class::is_primitive
authorredestad
Fri, 04 Jan 2019 16:23:56 +0100
changeset 53143 6b7240a24b56
parent 53142 5c0ec35d0533
child 53144 41779d3b85e1
8216157: Enable inlining of java_lang_Class::is_primitive Reviewed-by: coleenp, eosterlund, jiangli
src/hotspot/share/ci/ciInstance.cpp
src/hotspot/share/ci/ciMethodType.cpp
src/hotspot/share/classfile/javaClasses.cpp
src/hotspot/share/classfile/javaClasses.inline.hpp
src/hotspot/share/prims/jvmtiEnter.xsl
src/hotspot/share/prims/jvmtiExport.cpp
src/hotspot/share/prims/jvmtiRedefineClasses.cpp
src/hotspot/share/prims/jvmtiTrace.cpp
src/hotspot/share/runtime/reflection.cpp
src/hotspot/share/services/heapDumper.cpp
--- a/src/hotspot/share/ci/ciInstance.cpp	Fri Jan 04 14:05:16 2019 +0100
+++ b/src/hotspot/share/ci/ciInstance.cpp	Fri Jan 04 16:23:56 2019 +0100
@@ -23,6 +23,7 @@
  */
 
 #include "precompiled.hpp"
+#include "classfile/javaClasses.inline.hpp"
 #include "ci/ciConstant.hpp"
 #include "ci/ciField.hpp"
 #include "ci/ciInstance.hpp"
--- a/src/hotspot/share/ci/ciMethodType.cpp	Fri Jan 04 14:05:16 2019 +0100
+++ b/src/hotspot/share/ci/ciMethodType.cpp	Fri Jan 04 16:23:56 2019 +0100
@@ -26,7 +26,7 @@
 #include "ci/ciInstance.hpp"
 #include "ci/ciMethodType.hpp"
 #include "ci/ciUtilities.inline.hpp"
-#include "classfile/javaClasses.hpp"
+#include "classfile/javaClasses.inline.hpp"
 
 ciType* ciMethodType::class_to_citype(oop klass_oop) const {
   if (java_lang_Class::is_primitive(klass_oop)) {
--- a/src/hotspot/share/classfile/javaClasses.cpp	Fri Jan 04 14:05:16 2019 +0100
+++ b/src/hotspot/share/classfile/javaClasses.cpp	Fri Jan 04 16:23:56 2019 +0100
@@ -1462,23 +1462,6 @@
 }
 
 
-bool java_lang_Class::is_primitive(oop java_class) {
-  // should assert:
-  //assert(java_lang_Class::is_instance(java_class), "must be a Class object");
-  bool is_primitive = (java_class->metadata_field(_klass_offset) == NULL);
-
-#ifdef ASSERT
-  if (is_primitive) {
-    Klass* k = ((Klass*)java_class->metadata_field(_array_klass_offset));
-    assert(k == NULL || is_java_primitive(ArrayKlass::cast(k)->element_type()),
-        "Should be either the T_VOID primitive or a java primitive");
-  }
-#endif
-
-  return is_primitive;
-}
-
-
 BasicType java_lang_Class::primitive_type(oop java_class) {
   assert(java_lang_Class::is_primitive(java_class), "just checking");
   Klass* ak = ((Klass*)java_class->metadata_field(_array_klass_offset));
--- a/src/hotspot/share/classfile/javaClasses.inline.hpp	Fri Jan 04 14:05:16 2019 +0100
+++ b/src/hotspot/share/classfile/javaClasses.inline.hpp	Fri Jan 04 16:23:56 2019 +0100
@@ -174,6 +174,22 @@
   return obj != NULL && obj->klass() == SystemDictionary::Class_klass();
 }
 
+inline bool java_lang_Class::is_primitive(oop java_class) {
+  // should assert:
+  //assert(java_lang_Class::is_instance(java_class), "must be a Class object");
+  bool is_primitive = (java_class->metadata_field(_klass_offset) == NULL);
+
+#ifdef ASSERT
+  if (is_primitive) {
+    Klass* k = ((Klass*)java_class->metadata_field(_array_klass_offset));
+    assert(k == NULL || is_java_primitive(ArrayKlass::cast(k)->element_type()),
+        "Should be either the T_VOID primitive or a java primitive");
+  }
+#endif
+
+  return is_primitive;
+}
+
 inline bool java_lang_invoke_DirectMethodHandle::is_instance(oop obj) {
   return obj != NULL && is_subclass(obj->klass());
 }
--- a/src/hotspot/share/prims/jvmtiEnter.xsl	Fri Jan 04 14:05:16 2019 +0100
+++ b/src/hotspot/share/prims/jvmtiEnter.xsl	Fri Jan 04 16:23:56 2019 +0100
@@ -37,6 +37,7 @@
   <xsl:call-template name="sourceHeader"/>
   <xsl:text>
 # include "precompiled.hpp"
+# include "classfile/javaClasses.inline.hpp"
 # include "memory/resourceArea.hpp"
 # include "utilities/macros.hpp"
 #if INCLUDE_JVMTI
--- a/src/hotspot/share/prims/jvmtiExport.cpp	Fri Jan 04 14:05:16 2019 +0100
+++ b/src/hotspot/share/prims/jvmtiExport.cpp	Fri Jan 04 16:23:56 2019 +0100
@@ -23,6 +23,7 @@
  */
 
 #include "precompiled.hpp"
+#include "classfile/javaClasses.inline.hpp"
 #include "classfile/systemDictionary.hpp"
 #include "code/nmethod.hpp"
 #include "code/pcDesc.hpp"
--- a/src/hotspot/share/prims/jvmtiRedefineClasses.cpp	Fri Jan 04 14:05:16 2019 +0100
+++ b/src/hotspot/share/prims/jvmtiRedefineClasses.cpp	Fri Jan 04 16:23:56 2019 +0100
@@ -26,6 +26,7 @@
 #include "aot/aotLoader.hpp"
 #include "classfile/classLoaderDataGraph.hpp"
 #include "classfile/classFileStream.hpp"
+#include "classfile/javaClasses.inline.hpp"
 #include "classfile/metadataOnStackMark.hpp"
 #include "classfile/systemDictionary.hpp"
 #include "classfile/verifier.hpp"
--- a/src/hotspot/share/prims/jvmtiTrace.cpp	Fri Jan 04 14:05:16 2019 +0100
+++ b/src/hotspot/share/prims/jvmtiTrace.cpp	Fri Jan 04 16:23:56 2019 +0100
@@ -23,6 +23,7 @@
  */
 
 #include "precompiled.hpp"
+#include "classfile/javaClasses.inline.hpp"
 #include "jvmtifiles/jvmtiEnv.hpp"
 #include "logging/log.hpp"
 #include "logging/logConfiguration.hpp"
--- a/src/hotspot/share/runtime/reflection.cpp	Fri Jan 04 14:05:16 2019 +0100
+++ b/src/hotspot/share/runtime/reflection.cpp	Fri Jan 04 16:23:56 2019 +0100
@@ -24,7 +24,7 @@
 
 #include "precompiled.hpp"
 #include "jvm.h"
-#include "classfile/javaClasses.hpp"
+#include "classfile/javaClasses.inline.hpp"
 #include "classfile/moduleEntry.hpp"
 #include "classfile/packageEntry.hpp"
 #include "classfile/stringTable.hpp"
--- a/src/hotspot/share/services/heapDumper.cpp	Fri Jan 04 14:05:16 2019 +0100
+++ b/src/hotspot/share/services/heapDumper.cpp	Fri Jan 04 16:23:56 2019 +0100
@@ -26,6 +26,7 @@
 #include "jvm.h"
 #include "classfile/classLoaderData.inline.hpp"
 #include "classfile/classLoaderDataGraph.hpp"
+#include "classfile/javaClasses.inline.hpp"
 #include "classfile/symbolTable.hpp"
 #include "classfile/systemDictionary.hpp"
 #include "classfile/vmSymbols.hpp"