8221698: Remove redundant includes from popular header files
authoriklam
Sat, 30 Mar 2019 08:26:20 -0700
changeset 54347 235883996bc7
parent 54346 b7ebff3e4e69
child 54348 f062188117ad
8221698: Remove redundant includes from popular header files Summary: Removed histogram.hpp classLoader.hpp utf8.hpp moduleEntry.hpp packageEntry.hpp Reviewed-by: coleenp, stuefe
src/hotspot/share/ci/ciReplay.cpp
src/hotspot/share/classfile/classFileParser.cpp
src/hotspot/share/classfile/javaClasses.cpp
src/hotspot/share/classfile/javaClasses.hpp
src/hotspot/share/classfile/moduleEntry.cpp
src/hotspot/share/classfile/stringTable.cpp
src/hotspot/share/classfile/symbolTable.cpp
src/hotspot/share/classfile/systemDictionary.hpp
src/hotspot/share/classfile/systemDictionaryShared.hpp
src/hotspot/share/classfile/verifier.cpp
src/hotspot/share/classfile/vmSymbols.hpp
src/hotspot/share/memory/oopFactory.cpp
src/hotspot/share/oops/arrayKlass.cpp
src/hotspot/share/oops/instanceKlass.cpp
src/hotspot/share/oops/instanceKlass.hpp
src/hotspot/share/oops/klass.cpp
src/hotspot/share/oops/symbol.cpp
src/hotspot/share/oops/symbol.hpp
src/hotspot/share/prims/jvmtiEnv.cpp
src/hotspot/share/prims/jvmtiEnvBase.cpp
src/hotspot/share/prims/jvmtiExport.cpp
src/hotspot/share/prims/nativeLookup.cpp
src/hotspot/share/prims/unsafe.cpp
src/hotspot/share/runtime/frame.cpp
src/hotspot/share/runtime/interfaceSupport.inline.hpp
src/hotspot/share/runtime/mutex.hpp
src/hotspot/share/services/management.cpp
--- a/src/hotspot/share/ci/ciReplay.cpp	Sat Mar 30 16:32:23 2019 +0800
+++ b/src/hotspot/share/ci/ciReplay.cpp	Sat Mar 30 08:26:20 2019 -0700
@@ -40,6 +40,7 @@
 #include "runtime/handles.inline.hpp"
 #include "utilities/copy.hpp"
 #include "utilities/macros.hpp"
+#include "utilities/utf8.hpp"
 
 #ifndef PRODUCT
 
--- a/src/hotspot/share/classfile/classFileParser.cpp	Sat Mar 30 16:32:23 2019 +0800
+++ b/src/hotspot/share/classfile/classFileParser.cpp	Sat Mar 30 08:26:20 2019 -0700
@@ -32,6 +32,7 @@
 #include "classfile/dictionary.hpp"
 #include "classfile/javaClasses.inline.hpp"
 #include "classfile/moduleEntry.hpp"
+#include "classfile/packageEntry.hpp"
 #include "classfile/symbolTable.hpp"
 #include "classfile/systemDictionary.hpp"
 #include "classfile/verificationType.hpp"
@@ -77,6 +78,8 @@
 #include "utilities/macros.hpp"
 #include "utilities/ostream.hpp"
 #include "utilities/resourceHash.hpp"
+#include "utilities/utf8.hpp"
+
 #if INCLUDE_CDS
 #include "classfile/systemDictionaryShared.hpp"
 #endif
--- a/src/hotspot/share/classfile/javaClasses.cpp	Sat Mar 30 16:32:23 2019 +0800
+++ b/src/hotspot/share/classfile/javaClasses.cpp	Sat Mar 30 08:26:20 2019 -0700
@@ -65,6 +65,7 @@
 #include "runtime/vframe.inline.hpp"
 #include "utilities/align.hpp"
 #include "utilities/preserveException.hpp"
+#include "utilities/utf8.hpp"
 #if INCLUDE_JVMCI
 #include "jvmci/jvmciJavaClasses.hpp"
 #endif
--- a/src/hotspot/share/classfile/javaClasses.hpp	Sat Mar 30 16:32:23 2019 +0800
+++ b/src/hotspot/share/classfile/javaClasses.hpp	Sat Mar 30 08:26:20 2019 -0700
@@ -29,7 +29,6 @@
 #include "jvmtifiles/jvmti.h"
 #include "oops/oop.hpp"
 #include "runtime/os.hpp"
-#include "utilities/utf8.hpp"
 
 // Interface for manipulating the basic Java classes.
 //
--- a/src/hotspot/share/classfile/moduleEntry.cpp	Sat Mar 30 16:32:23 2019 +0800
+++ b/src/hotspot/share/classfile/moduleEntry.cpp	Sat Mar 30 08:26:20 2019 -0700
@@ -24,6 +24,7 @@
 
 #include "precompiled.hpp"
 #include "jni.h"
+#include "classfile/classLoader.hpp"
 #include "classfile/classLoaderData.inline.hpp"
 #include "classfile/javaClasses.inline.hpp"
 #include "classfile/moduleEntry.hpp"
--- a/src/hotspot/share/classfile/stringTable.cpp	Sat Mar 30 16:32:23 2019 +0800
+++ b/src/hotspot/share/classfile/stringTable.cpp	Sat Mar 30 08:26:20 2019 -0700
@@ -52,6 +52,7 @@
 #include "utilities/concurrentHashTable.inline.hpp"
 #include "utilities/concurrentHashTableTasks.inline.hpp"
 #include "utilities/macros.hpp"
+#include "utilities/utf8.hpp"
 
 // We prefer short chains of avg 2
 const double PREF_AVG_LIST_LEN = 2.0;
--- a/src/hotspot/share/classfile/symbolTable.cpp	Sat Mar 30 16:32:23 2019 +0800
+++ b/src/hotspot/share/classfile/symbolTable.cpp	Sat Mar 30 08:26:20 2019 -0700
@@ -38,6 +38,7 @@
 #include "services/diagnosticCommand.hpp"
 #include "utilities/concurrentHashTable.inline.hpp"
 #include "utilities/concurrentHashTableTasks.inline.hpp"
+#include "utilities/utf8.hpp"
 
 // We used to not resize at all, so let's be conservative
 // and not set it too short before we decide to resize,
--- a/src/hotspot/share/classfile/systemDictionary.hpp	Sat Mar 30 16:32:23 2019 +0800
+++ b/src/hotspot/share/classfile/systemDictionary.hpp	Sat Mar 30 08:26:20 2019 -0700
@@ -25,7 +25,7 @@
 #ifndef SHARE_CLASSFILE_SYSTEMDICTIONARY_HPP
 #define SHARE_CLASSFILE_SYSTEMDICTIONARY_HPP
 
-#include "classfile/classLoader.hpp"
+#include "classfile/classLoaderData.hpp"
 #include "jvmci/systemDictionary_jvmci.hpp"
 #include "oops/objArrayOop.hpp"
 #include "oops/symbol.hpp"
--- a/src/hotspot/share/classfile/systemDictionaryShared.hpp	Sat Mar 30 16:32:23 2019 +0800
+++ b/src/hotspot/share/classfile/systemDictionaryShared.hpp	Sat Mar 30 08:26:20 2019 -0700
@@ -27,6 +27,7 @@
 
 #include "oops/klass.hpp"
 #include "classfile/dictionary.hpp"
+#include "classfile/packageEntry.hpp"
 #include "classfile/systemDictionary.hpp"
 #include "memory/filemap.hpp"
 
--- a/src/hotspot/share/classfile/verifier.cpp	Sat Mar 30 16:32:23 2019 +0800
+++ b/src/hotspot/share/classfile/verifier.cpp	Sat Mar 30 08:26:20 2019 -0700
@@ -25,6 +25,7 @@
 #include "precompiled.hpp"
 #include "jvm.h"
 #include "classfile/classFileStream.hpp"
+#include "classfile/classLoader.hpp"
 #include "classfile/javaClasses.hpp"
 #include "classfile/stackMapTable.hpp"
 #include "classfile/stackMapFrame.hpp"
--- a/src/hotspot/share/classfile/vmSymbols.hpp	Sat Mar 30 16:32:23 2019 +0800
+++ b/src/hotspot/share/classfile/vmSymbols.hpp	Sat Mar 30 08:26:20 2019 -0700
@@ -25,7 +25,6 @@
 #ifndef SHARE_CLASSFILE_VMSYMBOLS_HPP
 #define SHARE_CLASSFILE_VMSYMBOLS_HPP
 
-#include "classfile/moduleEntry.hpp"
 #include "jfr/support/jfrIntrinsics.hpp"
 #include "jvmci/vmSymbols_jvmci.hpp"
 #include "memory/iterator.hpp"
@@ -52,7 +51,7 @@
 
 #define VM_SYMBOLS_DO(template, do_alias)                                                         \
   /* commonly used class, package, module names */                                                \
-  template(java_base,                                 JAVA_BASE_NAME)                             \
+  template(java_base,                                 "java.base")                                \
   template(java_lang_System,                          "java/lang/System")                         \
   template(java_lang_Object,                          "java/lang/Object")                         \
   template(java_lang_Class,                           "java/lang/Class")                          \
--- a/src/hotspot/share/memory/oopFactory.cpp	Sat Mar 30 16:32:23 2019 +0800
+++ b/src/hotspot/share/memory/oopFactory.cpp	Sat Mar 30 08:26:20 2019 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2019, 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
@@ -37,6 +37,7 @@
 #include "oops/oop.inline.hpp"
 #include "oops/typeArrayOop.inline.hpp"
 #include "runtime/handles.inline.hpp"
+#include "utilities/utf8.hpp"
 
 
 typeArrayOop oopFactory::new_charArray(const char* utf8_str, TRAPS) {
--- a/src/hotspot/share/oops/arrayKlass.cpp	Sat Mar 30 16:32:23 2019 +0800
+++ b/src/hotspot/share/oops/arrayKlass.cpp	Sat Mar 30 08:26:20 2019 -0700
@@ -24,6 +24,7 @@
 
 #include "precompiled.hpp"
 #include "classfile/javaClasses.hpp"
+#include "classfile/moduleEntry.hpp"
 #include "classfile/systemDictionary.hpp"
 #include "classfile/vmSymbols.hpp"
 #include "gc/shared/collectedHeap.inline.hpp"
--- a/src/hotspot/share/oops/instanceKlass.cpp	Sat Mar 30 16:32:23 2019 +0800
+++ b/src/hotspot/share/oops/instanceKlass.cpp	Sat Mar 30 08:26:20 2019 -0700
@@ -2438,6 +2438,23 @@
   return (old_state != is_in_error_state());
 }
 
+void InstanceKlass::set_class_loader_type(s2 loader_type) {
+  switch (loader_type) {
+  case ClassLoader::BOOT_LOADER:
+    _misc_flags |= _misc_is_shared_boot_class;
+    break;
+  case ClassLoader::PLATFORM_LOADER:
+    _misc_flags |= _misc_is_shared_platform_class;
+    break;
+  case ClassLoader::APP_LOADER:
+    _misc_flags |= _misc_is_shared_app_class;
+    break;
+  default:
+    ShouldNotReachHere();
+    break;
+  }
+}
+
 #if INCLUDE_JVMTI
 static void clear_all_breakpoints(Method* m) {
   m->clear_all_breakpoints();
--- a/src/hotspot/share/oops/instanceKlass.hpp	Sat Mar 30 16:32:23 2019 +0800
+++ b/src/hotspot/share/oops/instanceKlass.hpp	Sat Mar 30 08:26:20 2019 -0700
@@ -25,10 +25,7 @@
 #ifndef SHARE_OOPS_INSTANCEKLASS_HPP
 #define SHARE_OOPS_INSTANCEKLASS_HPP
 
-#include "classfile/classLoader.hpp"
 #include "classfile/classLoaderData.hpp"
-#include "classfile/moduleEntry.hpp"
-#include "classfile/packageEntry.hpp"
 #include "memory/referenceType.hpp"
 #include "oops/annotations.hpp"
 #include "oops/constMethod.hpp"
@@ -63,6 +60,7 @@
 class BreakpointInfo;
 #endif
 class ClassFileParser;
+class ClassFileStream;
 class KlassDepChange;
 class DependencyContext;
 class fieldDescriptor;
@@ -70,9 +68,10 @@
 class JNIid;
 class JvmtiCachedClassFieldMap;
 class nmethodBucket;
-class SuperTypeClosure;
 class OopMapCache;
 class InterpreterOopMap;
+class PackageEntry;
+class ModuleEntry;
 
 // This is used in iterators below.
 class FieldClosure: public StackObj {
@@ -349,22 +348,7 @@
     _misc_flags &= ~loader_type_bits();
   }
 
-  void set_class_loader_type(s2 loader_type) {
-    switch (loader_type) {
-    case ClassLoader::BOOT_LOADER:
-      _misc_flags |= _misc_is_shared_boot_class;
-       break;
-    case ClassLoader::PLATFORM_LOADER:
-      _misc_flags |= _misc_is_shared_platform_class;
-      break;
-    case ClassLoader::APP_LOADER:
-      _misc_flags |= _misc_is_shared_app_class;
-      break;
-    default:
-      ShouldNotReachHere();
-      break;
-    }
-  }
+  void set_class_loader_type(s2 loader_type);
 
   bool has_nonstatic_fields() const        {
     return (_misc_flags & _misc_has_nonstatic_fields) != 0;
@@ -1025,7 +1009,6 @@
   void methods_do(void f(Method* method));
   void array_klasses_do(void f(Klass* k));
   void array_klasses_do(void f(Klass* k, TRAPS), TRAPS);
-  bool super_types_do(SuperTypeClosure* blk);
 
   static InstanceKlass* cast(Klass* k) {
     return const_cast<InstanceKlass*>(cast(const_cast<const Klass*>(k)));
--- a/src/hotspot/share/oops/klass.cpp	Sat Mar 30 16:32:23 2019 +0800
+++ b/src/hotspot/share/oops/klass.cpp	Sat Mar 30 08:26:20 2019 -0700
@@ -27,6 +27,7 @@
 #include "classfile/classLoaderDataGraph.inline.hpp"
 #include "classfile/dictionary.hpp"
 #include "classfile/javaClasses.hpp"
+#include "classfile/moduleEntry.hpp"
 #include "classfile/systemDictionary.hpp"
 #include "classfile/vmSymbols.hpp"
 #include "gc/shared/collectedHeap.inline.hpp"
--- a/src/hotspot/share/oops/symbol.cpp	Sat Mar 30 16:32:23 2019 +0800
+++ b/src/hotspot/share/oops/symbol.cpp	Sat Mar 30 08:26:20 2019 -0700
@@ -34,6 +34,7 @@
 #include "oops/symbol.hpp"
 #include "runtime/atomic.hpp"
 #include "runtime/os.hpp"
+#include "utilities/utf8.hpp"
 
 uint32_t Symbol::pack_length_and_refcount(int length, int refcount) {
   STATIC_ASSERT(max_symbol_length == ((1 << 16) - 1));
--- a/src/hotspot/share/oops/symbol.hpp	Sat Mar 30 16:32:23 2019 +0800
+++ b/src/hotspot/share/oops/symbol.hpp	Sat Mar 30 08:26:20 2019 -0700
@@ -28,7 +28,6 @@
 #include "memory/allocation.hpp"
 #include "utilities/exceptions.hpp"
 #include "utilities/macros.hpp"
-#include "utilities/utf8.hpp"
 
 // A Symbol is a canonicalized string.
 // All Symbols reside in global SymbolTable and are reference counted.
--- a/src/hotspot/share/prims/jvmtiEnv.cpp	Sat Mar 30 16:32:23 2019 +0800
+++ b/src/hotspot/share/prims/jvmtiEnv.cpp	Sat Mar 30 08:26:20 2019 -0700
@@ -74,6 +74,7 @@
 #include "services/threadService.hpp"
 #include "utilities/exceptions.hpp"
 #include "utilities/preserveException.hpp"
+#include "utilities/utf8.hpp"
 
 
 #define FIXLATER 0 // REMOVE this when completed.
--- a/src/hotspot/share/prims/jvmtiEnvBase.cpp	Sat Mar 30 16:32:23 2019 +0800
+++ b/src/hotspot/share/prims/jvmtiEnvBase.cpp	Sat Mar 30 08:26:20 2019 -0700
@@ -24,6 +24,7 @@
 
 #include "precompiled.hpp"
 #include "classfile/classLoaderDataGraph.hpp"
+#include "classfile/moduleEntry.hpp"
 #include "classfile/systemDictionary.hpp"
 #include "jvmtifiles/jvmtiEnv.hpp"
 #include "memory/resourceArea.hpp"
--- a/src/hotspot/share/prims/jvmtiExport.cpp	Sat Mar 30 16:32:23 2019 +0800
+++ b/src/hotspot/share/prims/jvmtiExport.cpp	Sat Mar 30 08:26:20 2019 -0700
@@ -24,6 +24,7 @@
 
 #include "precompiled.hpp"
 #include "classfile/javaClasses.inline.hpp"
+#include "classfile/moduleEntry.hpp"
 #include "classfile/systemDictionary.hpp"
 #include "code/nmethod.hpp"
 #include "code/pcDesc.hpp"
--- a/src/hotspot/share/prims/nativeLookup.cpp	Sat Mar 30 16:32:23 2019 +0800
+++ b/src/hotspot/share/prims/nativeLookup.cpp	Sat Mar 30 08:26:20 2019 -0700
@@ -43,6 +43,7 @@
 #include "runtime/sharedRuntime.hpp"
 #include "runtime/signature.hpp"
 #include "utilities/macros.hpp"
+#include "utilities/utf8.hpp"
 #if INCLUDE_JFR
 #include "jfr/jfr.hpp"
 #endif
--- a/src/hotspot/share/prims/unsafe.cpp	Sat Mar 30 16:32:23 2019 +0800
+++ b/src/hotspot/share/prims/unsafe.cpp	Sat Mar 30 08:26:20 2019 -0700
@@ -26,6 +26,7 @@
 #include "jni.h"
 #include "jvm.h"
 #include "classfile/classFileStream.hpp"
+#include "classfile/classLoader.hpp"
 #include "classfile/vmSymbols.hpp"
 #include "jfr/jfrEvents.hpp"
 #include "memory/allocation.inline.hpp"
--- a/src/hotspot/share/runtime/frame.cpp	Sat Mar 30 16:32:23 2019 +0800
+++ b/src/hotspot/share/runtime/frame.cpp	Sat Mar 30 08:26:20 2019 -0700
@@ -23,6 +23,7 @@
  */
 
 #include "precompiled.hpp"
+#include "classfile/moduleEntry.hpp"
 #include "code/codeCache.hpp"
 #include "code/vmreg.inline.hpp"
 #include "compiler/abstractCompiler.hpp"
--- a/src/hotspot/share/runtime/interfaceSupport.inline.hpp	Sat Mar 30 16:32:23 2019 +0800
+++ b/src/hotspot/share/runtime/interfaceSupport.inline.hpp	Sat Mar 30 08:26:20 2019 -0700
@@ -34,6 +34,7 @@
 #include "runtime/thread.hpp"
 #include "runtime/vmOperations.hpp"
 #include "utilities/globalDefinitions.hpp"
+#include "utilities/histogram.hpp"
 #include "utilities/macros.hpp"
 #include "utilities/preserveException.hpp"
 
--- a/src/hotspot/share/runtime/mutex.hpp	Sat Mar 30 16:32:23 2019 +0800
+++ b/src/hotspot/share/runtime/mutex.hpp	Sat Mar 30 08:26:20 2019 -0700
@@ -27,8 +27,6 @@
 
 #include "memory/allocation.hpp"
 #include "runtime/os.hpp"
-#include "utilities/histogram.hpp"
-
 
 // A Mutex/Monitor is a simple wrapper around a native lock plus condition
 // variable that supports lock ownership tracking, lock ranking for deadlock
--- a/src/hotspot/share/services/management.cpp	Sat Mar 30 16:32:23 2019 +0800
+++ b/src/hotspot/share/services/management.cpp	Sat Mar 30 08:26:20 2019 -0700
@@ -24,6 +24,7 @@
 
 #include "precompiled.hpp"
 #include "jmm.h"
+#include "classfile/classLoader.hpp"
 #include "classfile/systemDictionary.hpp"
 #include "compiler/compileBroker.hpp"
 #include "memory/allocation.inline.hpp"