From 11a37c829c12d064874416a7b242596cf23972e5 Mon Sep 17 00:00:00 2001 From: Coleen Phillimore Date: Wed, 5 Mar 2025 19:28:39 +0000 Subject: [PATCH] 8351165: Remove unused includes from vmStructs Reviewed-by: kbarrett --- .../share/classfile/compactHashtable.hpp | 3 +-- src/hotspot/share/classfile/stringTable.hpp | 1 - src/hotspot/share/classfile/symbolTable.hpp | 3 +-- .../share/classfile/systemDictionary.hpp | 1 - src/hotspot/share/memory/arena.hpp | 1 - src/hotspot/share/memory/resourceArea.hpp | 2 -- src/hotspot/share/runtime/sharedRuntime.hpp | 4 +-- src/hotspot/share/runtime/vmStructs.cpp | 27 ++----------------- .../serviceability/sa/ClhsdbPrintStatics.java | 4 +-- 9 files changed, 7 insertions(+), 39 deletions(-) diff --git a/src/hotspot/share/classfile/compactHashtable.hpp b/src/hotspot/share/classfile/compactHashtable.hpp index 161f21eac99..2985f0f9a1a 100644 --- a/src/hotspot/share/classfile/compactHashtable.hpp +++ b/src/hotspot/share/classfile/compactHashtable.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2025, 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 @@ -241,7 +241,6 @@ template < bool (*EQUALS)(V value, K key, int len) > class CompactHashtable : public SimpleCompactHashtable { - friend class VMStructs; V decode(u4 offset) const { return DECODE(_base_address, offset); diff --git a/src/hotspot/share/classfile/stringTable.hpp b/src/hotspot/share/classfile/stringTable.hpp index 0d58e09f208..15539009f66 100644 --- a/src/hotspot/share/classfile/stringTable.hpp +++ b/src/hotspot/share/classfile/stringTable.hpp @@ -40,7 +40,6 @@ class SerializeClosure; class StringTableConfig; class StringTable : AllStatic { - friend class VMStructs; friend class StringTableConfig; static volatile bool _has_work; diff --git a/src/hotspot/share/classfile/symbolTable.hpp b/src/hotspot/share/classfile/symbolTable.hpp index ee2cfe19d8e..cc861812dc3 100644 --- a/src/hotspot/share/classfile/symbolTable.hpp +++ b/src/hotspot/share/classfile/symbolTable.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2025, 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 @@ -47,7 +47,6 @@ class constantPoolHandle; class SymbolClosure; class SymbolTable : public AllStatic { - friend class VMStructs; friend class Symbol; friend class ClassFileParser; friend class SymbolTableConfig; diff --git a/src/hotspot/share/classfile/systemDictionary.hpp b/src/hotspot/share/classfile/systemDictionary.hpp index 7432166ba4e..1ba5d70af9e 100644 --- a/src/hotspot/share/classfile/systemDictionary.hpp +++ b/src/hotspot/share/classfile/systemDictionary.hpp @@ -79,7 +79,6 @@ class SystemDictionary : AllStatic { friend class AOTLinkedClassBulkLoader; friend class BootstrapInfo; friend class vmClasses; - friend class VMStructs; public: diff --git a/src/hotspot/share/memory/arena.hpp b/src/hotspot/share/memory/arena.hpp index dfa12209f40..01b1ae382db 100644 --- a/src/hotspot/share/memory/arena.hpp +++ b/src/hotspot/share/memory/arena.hpp @@ -129,7 +129,6 @@ private: protected: friend class HandleMark; friend class NoHandleMark; - friend class VMStructs; Chunk* _first; // First chunk Chunk* _chunk; // current chunk diff --git a/src/hotspot/share/memory/resourceArea.hpp b/src/hotspot/share/memory/resourceArea.hpp index 85ad6590d69..557a3c0a24e 100644 --- a/src/hotspot/share/memory/resourceArea.hpp +++ b/src/hotspot/share/memory/resourceArea.hpp @@ -43,8 +43,6 @@ //------------------------------ResourceArea----------------------------------- // A ResourceArea is an Arena that supports safe usage of ResourceMark. class ResourceArea: public Arena { - friend class VMStructs; - #ifdef ASSERT int _nesting; // current # of nested ResourceMarks void verify_has_resource_mark(); diff --git a/src/hotspot/share/runtime/sharedRuntime.hpp b/src/hotspot/share/runtime/sharedRuntime.hpp index 854d4dcf1ad..94cbc460cad 100644 --- a/src/hotspot/share/runtime/sharedRuntime.hpp +++ b/src/hotspot/share/runtime/sharedRuntime.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2025, 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 @@ -54,8 +54,6 @@ enum class SharedStubId :int { #undef SHARED_STUB_ID_ENUM_DECLARE class SharedRuntime: AllStatic { - friend class VMStructs; - private: // Declare shared stub fields #define SHARED_STUB_FIELD_DECLARE(name, type) \ diff --git a/src/hotspot/share/runtime/vmStructs.cpp b/src/hotspot/share/runtime/vmStructs.cpp index 53bdfe522d0..3daec6d8d06 100644 --- a/src/hotspot/share/runtime/vmStructs.cpp +++ b/src/hotspot/share/runtime/vmStructs.cpp @@ -23,18 +23,9 @@ */ #include "cds/filemap.hpp" -#include "ci/ciField.hpp" -#include "ci/ciInstance.hpp" -#include "ci/ciMethodData.hpp" -#include "ci/ciObjArrayKlass.hpp" -#include "ci/ciSymbol.hpp" #include "classfile/classLoaderDataGraph.hpp" -#include "classfile/dictionary.hpp" #include "classfile/javaClasses.hpp" #include "classfile/javaThreadStatus.hpp" -#include "classfile/stringTable.hpp" -#include "classfile/symbolTable.hpp" -#include "classfile/systemDictionary.hpp" #include "classfile/vmClasses.hpp" #include "classfile/vmSymbols.hpp" #include "code/codeBlob.hpp" @@ -103,10 +94,8 @@ #include "runtime/osThread.hpp" #include "runtime/perfMemory.hpp" #include "runtime/serviceThread.hpp" -#include "runtime/sharedRuntime.hpp" #include "runtime/stubRoutines.hpp" #include "runtime/synchronizer.hpp" -#include "runtime/threadSMR.hpp" #include "runtime/vframeArray.hpp" #include "runtime/vmStructs.hpp" #include "runtime/vm_version.hpp" @@ -411,7 +400,7 @@ volatile_static_field(PerfMemory, _initialized, int) \ \ /********************/ \ - /* SystemDictionary */ \ + /* VM Classes */ \ /********************/ \ \ static_field(vmClasses, VM_CLASS_AT(Object_klass), InstanceKlass*) \ @@ -635,7 +624,6 @@ nonstatic_field(JavaThread, _monitor_owner_id, int64_t) \ volatile_nonstatic_field(JavaThread, _terminated, JavaThread::TerminatedTypes) \ nonstatic_field(Thread, _osthread, OSThread*) \ - nonstatic_field(Thread, _resource_area, ResourceArea*) \ \ /************/ \ /* OSThread */ \ @@ -1009,17 +997,14 @@ declare_type(PerfData, CHeapObj) \ \ /********************/ \ - /* SystemDictionary */ \ + /* VM Classes */ \ /********************/ \ \ - declare_toplevel_type(SystemDictionary) \ declare_toplevel_type(vmClasses) \ declare_toplevel_type(vmSymbols) \ \ declare_toplevel_type(GrowableArrayBase) \ declare_toplevel_type(GrowableArray) \ - declare_toplevel_type(Arena) \ - declare_type(ResourceArea, Arena) \ \ /***********************************************************/ \ /* Thread hierarchy (needed for run-time type information) */ \ @@ -1090,8 +1075,6 @@ /* CodeBlob hierarchy (needed for run-time type information) */ \ /*************************************************************/ \ \ - declare_toplevel_type(SharedRuntime) \ - \ declare_toplevel_type(CodeBlob) \ declare_type(RuntimeBlob, CodeBlob) \ declare_type(BufferBlob, RuntimeBlob) \ @@ -1163,12 +1146,6 @@ declare_toplevel_type(BasicLock) \ declare_toplevel_type(BasicObjectLock) \ \ - /*********************/ \ - /* Adapter Blob Entries */ \ - /*********************/ \ - declare_toplevel_type(AdapterHandlerEntry) \ - declare_toplevel_type(AdapterHandlerEntry*) \ - \ /********************/ \ /* -XX flags */ \ /********************/ \ diff --git a/test/hotspot/jtreg/serviceability/sa/ClhsdbPrintStatics.java b/test/hotspot/jtreg/serviceability/sa/ClhsdbPrintStatics.java index d53e5e47f26..abbcb552876 100644 --- a/test/hotspot/jtreg/serviceability/sa/ClhsdbPrintStatics.java +++ b/test/hotspot/jtreg/serviceability/sa/ClhsdbPrintStatics.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2025, 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 @@ -49,7 +49,7 @@ public class ClhsdbPrintStatics { System.out.println("Started LingeredApp with pid " + theApp.getPid()); List cmds = List.of( - "printstatics", "printstatics SystemDictionary", + "printstatics", "printstatics Threads", "printstatics Universe", "printstatics JvmtiExport");