Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
8261672: Reduce inclusion of classLoaderData.hpp
Reviewed-by: lfoltan, coleenp
  • Loading branch information
iklam committed Feb 13, 2021
1 parent 95d7312 commit 235da6a
Show file tree
Hide file tree
Showing 59 changed files with 135 additions and 74 deletions.
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2018, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2018, 2021, 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
Expand All @@ -23,6 +23,7 @@
*/

#include "precompiled.hpp"
#include "classfile/classLoaderData.hpp"
#include "gc/shared/barrierSet.hpp"
#include "gc/shared/barrierSetAssembler.hpp"
#include "gc/shared/barrierSetNMethod.hpp"
Expand Down
1 change: 1 addition & 0 deletions src/hotspot/cpu/ppc/gc/shared/barrierSetAssembler_ppc.cpp
Expand Up @@ -26,6 +26,7 @@
#include "nativeInst_ppc.hpp"
#include "precompiled.hpp"
#include "asm/macroAssembler.inline.hpp"
#include "classfile/classLoaderData.hpp"
#include "gc/shared/barrierSetAssembler.hpp"
#include "gc/shared/barrierSetNMethod.hpp"
#include "interpreter/interp_masm.hpp"
Expand Down
3 changes: 2 additions & 1 deletion src/hotspot/cpu/x86/gc/shared/barrierSetAssembler_x86.cpp
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2018, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2018, 2021, 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
Expand All @@ -23,6 +23,7 @@
*/

#include "precompiled.hpp"
#include "classfile/classLoaderData.hpp"
#include "gc/shared/barrierSet.hpp"
#include "gc/shared/barrierSetAssembler.hpp"
#include "gc/shared/barrierSetNMethod.hpp"
Expand Down
1 change: 0 additions & 1 deletion src/hotspot/os/aix/os_aix.cpp
Expand Up @@ -29,7 +29,6 @@

// no precompiled headers
#include "jvm.h"
#include "classfile/classLoader.hpp"
#include "classfile/vmSymbols.hpp"
#include "code/icBuffer.hpp"
#include "code/vtableStubs.hpp"
Expand Down
1 change: 0 additions & 1 deletion src/hotspot/os/bsd/os_bsd.cpp
Expand Up @@ -24,7 +24,6 @@

// no precompiled headers
#include "jvm.h"
#include "classfile/classLoader.hpp"
#include "classfile/vmSymbols.hpp"
#include "code/icBuffer.hpp"
#include "code/vtableStubs.hpp"
Expand Down
1 change: 0 additions & 1 deletion src/hotspot/os/windows/os_windows.cpp
Expand Up @@ -27,7 +27,6 @@

// no precompiled headers
#include "jvm.h"
#include "classfile/classLoader.hpp"
#include "classfile/vmSymbols.hpp"
#include "code/codeCache.hpp"
#include "code/icBuffer.hpp"
Expand Down
1 change: 0 additions & 1 deletion src/hotspot/os_cpu/aix_ppc/os_aix_ppc.cpp
Expand Up @@ -27,7 +27,6 @@
#include "jvm.h"
#include "assembler_ppc.hpp"
#include "asm/assembler.inline.hpp"
#include "classfile/classLoader.hpp"
#include "classfile/vmSymbols.hpp"
#include "code/codeCache.hpp"
#include "code/icBuffer.hpp"
Expand Down
1 change: 0 additions & 1 deletion src/hotspot/os_cpu/bsd_x86/os_bsd_x86.cpp
Expand Up @@ -25,7 +25,6 @@
// no precompiled headers
#include "jvm.h"
#include "asm/macroAssembler.hpp"
#include "classfile/classLoader.hpp"
#include "classfile/vmSymbols.hpp"
#include "code/codeCache.hpp"
#include "code/icBuffer.hpp"
Expand Down
1 change: 0 additions & 1 deletion src/hotspot/os_cpu/bsd_zero/os_bsd_zero.cpp
Expand Up @@ -31,7 +31,6 @@
// no precompiled headers
#include "jvm.h"
#include "assembler_zero.inline.hpp"
#include "classfile/classLoader.hpp"
#include "classfile/vmSymbols.hpp"
#include "code/icBuffer.hpp"
#include "code/vtableStubs.hpp"
Expand Down
1 change: 0 additions & 1 deletion src/hotspot/os_cpu/linux_aarch64/os_linux_aarch64.cpp
Expand Up @@ -26,7 +26,6 @@
// no precompiled headers
#include "jvm.h"
#include "asm/macroAssembler.hpp"
#include "classfile/classLoader.hpp"
#include "classfile/vmSymbols.hpp"
#include "code/codeCache.hpp"
#include "code/icBuffer.hpp"
Expand Down
1 change: 0 additions & 1 deletion src/hotspot/os_cpu/linux_arm/os_linux_arm.cpp
Expand Up @@ -25,7 +25,6 @@
// no precompiled headers
#include "jvm.h"
#include "assembler_arm.inline.hpp"
#include "classfile/classLoader.hpp"
#include "classfile/vmSymbols.hpp"
#include "code/icBuffer.hpp"
#include "code/vtableStubs.hpp"
Expand Down
1 change: 0 additions & 1 deletion src/hotspot/os_cpu/linux_ppc/os_linux_ppc.cpp
Expand Up @@ -27,7 +27,6 @@
#include "jvm.h"
#include "assembler_ppc.hpp"
#include "asm/assembler.inline.hpp"
#include "classfile/classLoader.hpp"
#include "classfile/vmSymbols.hpp"
#include "code/codeCache.hpp"
#include "code/icBuffer.hpp"
Expand Down
1 change: 0 additions & 1 deletion src/hotspot/os_cpu/linux_s390/os_linux_s390.cpp
Expand Up @@ -28,7 +28,6 @@
// no precompiled headers
#include "jvm.h"
#include "asm/assembler.inline.hpp"
#include "classfile/classLoader.hpp"
#include "classfile/vmSymbols.hpp"
#include "code/icBuffer.hpp"
#include "code/nativeInst.hpp"
Expand Down
1 change: 0 additions & 1 deletion src/hotspot/os_cpu/linux_x86/os_linux_x86.cpp
Expand Up @@ -25,7 +25,6 @@
// no precompiled headers
#include "jvm.h"
#include "asm/macroAssembler.hpp"
#include "classfile/classLoader.hpp"
#include "classfile/vmSymbols.hpp"
#include "code/codeCache.hpp"
#include "code/icBuffer.hpp"
Expand Down
1 change: 0 additions & 1 deletion src/hotspot/os_cpu/linux_zero/os_linux_zero.cpp
Expand Up @@ -26,7 +26,6 @@
// no precompiled headers
#include "jvm.h"
#include "assembler_zero.inline.hpp"
#include "classfile/classLoader.hpp"
#include "classfile/vmSymbols.hpp"
#include "code/icBuffer.hpp"
#include "code/vtableStubs.hpp"
Expand Down
1 change: 0 additions & 1 deletion src/hotspot/os_cpu/windows_aarch64/os_windows_aarch64.cpp
Expand Up @@ -25,7 +25,6 @@
#include "precompiled.hpp"
#include "jvm.h"
#include "asm/macroAssembler.hpp"
#include "classfile/classLoader.hpp"
#include "classfile/vmSymbols.hpp"
#include "code/codeCache.hpp"
#include "code/icBuffer.hpp"
Expand Down
1 change: 0 additions & 1 deletion src/hotspot/os_cpu/windows_x86/os_windows_x86.cpp
Expand Up @@ -25,7 +25,6 @@
// no precompiled headers
#include "jvm.h"
#include "asm/macroAssembler.hpp"
#include "classfile/classLoader.hpp"
#include "classfile/vmSymbols.hpp"
#include "code/icBuffer.hpp"
#include "code/vtableStubs.hpp"
Expand Down
1 change: 1 addition & 0 deletions src/hotspot/share/asm/codeBuffer.cpp
Expand Up @@ -27,6 +27,7 @@
#include "code/oopRecorder.inline.hpp"
#include "compiler/disassembler.hpp"
#include "logging/log.hpp"
#include "oops/klass.inline.hpp"
#include "oops/methodData.hpp"
#include "oops/oop.inline.hpp"
#include "runtime/icache.hpp"
Expand Down
3 changes: 2 additions & 1 deletion src/hotspot/share/ci/ciMethodData.cpp
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2001, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2001, 2021, 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
Expand Down Expand Up @@ -30,6 +30,7 @@
#include "compiler/compiler_globals.hpp"
#include "memory/allocation.inline.hpp"
#include "memory/resourceArea.hpp"
#include "oops/klass.inline.hpp"
#include "runtime/deoptimization.hpp"
#include "utilities/copy.hpp"

Expand Down
3 changes: 2 additions & 1 deletion src/hotspot/share/classfile/javaAssertions.hpp
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 2021, 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
Expand Down Expand Up @@ -27,6 +27,7 @@

#include "oops/objArrayOop.hpp"
#include "oops/typeArrayOop.hpp"
#include "runtime/handles.hpp"
#include "utilities/exceptions.hpp"
#include "utilities/ostream.hpp"

Expand Down
3 changes: 2 additions & 1 deletion src/hotspot/share/classfile/loaderConstraints.cpp
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 2021, 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
Expand Down Expand Up @@ -29,6 +29,7 @@
#include "classfile/loaderConstraints.hpp"
#include "logging/log.hpp"
#include "memory/resourceArea.hpp"
#include "oops/klass.inline.hpp"
#include "oops/oop.inline.hpp"
#include "runtime/handles.inline.hpp"
#include "runtime/safepoint.hpp"
Expand Down
7 changes: 6 additions & 1 deletion src/hotspot/share/classfile/moduleEntry.cpp
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2016, 2021, 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
Expand Down Expand Up @@ -368,6 +368,11 @@ ModuleEntryTable::~ModuleEntryTable() {
assert(new_entry_free_list() == NULL, "entry present on ModuleEntryTable's free list");
}

void ModuleEntry::set_loader_data(ClassLoaderData* cld) {
assert(!cld->has_class_mirror_holder(), "Unexpected has_class_mirror_holder cld");
_loader_data = cld;
}

#if INCLUDE_CDS_JAVA_HEAP
typedef ResourceHashtable<
const ModuleEntry*,
Expand Down
10 changes: 3 additions & 7 deletions src/hotspot/share/classfile/moduleEntry.hpp
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2016, 2021, 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
Expand All @@ -26,7 +26,6 @@
#define SHARE_CLASSFILE_MODULEENTRY_HPP

#include "jni.h"
#include "classfile/classLoaderData.hpp"
#include "oops/oopHandle.hpp"
#include "oops/symbol.hpp"
#include "runtime/mutexLocker.hpp"
Expand All @@ -46,6 +45,7 @@
#define JAVA_BASE_NAME_LEN 9

template <class T> class Array;
class ClassLoaderData;
class MetaspaceClosure;
class ModuleClosure;

Expand Down Expand Up @@ -112,11 +112,7 @@ class ModuleEntry : public HashtableEntry<Symbol*, mtModule> {
void set_shared_protection_domain(ClassLoaderData *loader_data, Handle pd);

ClassLoaderData* loader_data() const { return _loader_data; }

void set_loader_data(ClassLoaderData* cld) {
assert(!cld->has_class_mirror_holder(), "Unexpected has_class_mirror_holder cld");
_loader_data = cld;
}
void set_loader_data(ClassLoaderData* cld);

Symbol* version() const { return _version; }
void set_version(Symbol* version);
Expand Down
1 change: 1 addition & 0 deletions src/hotspot/share/classfile/packageEntry.cpp
Expand Up @@ -23,6 +23,7 @@
*/

#include "precompiled.hpp"
#include "classfile/classLoaderData.hpp"
#include "classfile/moduleEntry.hpp"
#include "classfile/packageEntry.hpp"
#include "classfile/vmSymbols.hpp"
Expand Down
1 change: 1 addition & 0 deletions src/hotspot/share/classfile/resolutionErrors.cpp
Expand Up @@ -27,6 +27,7 @@
#include "memory/allocation.hpp"
#include "memory/resourceArea.hpp"
#include "oops/instanceKlass.hpp"
#include "oops/klass.inline.hpp"
#include "oops/oop.inline.hpp"
#include "runtime/handles.inline.hpp"
#include "runtime/safepoint.hpp"
Expand Down
1 change: 1 addition & 0 deletions src/hotspot/share/classfile/symbolTable.cpp
Expand Up @@ -24,6 +24,7 @@

#include "precompiled.hpp"
#include "classfile/altHashing.hpp"
#include "classfile/classLoaderData.hpp"
#include "classfile/compactHashtable.hpp"
#include "classfile/javaClasses.hpp"
#include "classfile/symbolTable.hpp"
Expand Down
1 change: 1 addition & 0 deletions src/hotspot/share/classfile/systemDictionaryShared.hpp
Expand Up @@ -25,6 +25,7 @@
#ifndef SHARE_CLASSFILE_SYSTEMDICTIONARYSHARED_HPP
#define SHARE_CLASSFILE_SYSTEMDICTIONARYSHARED_HPP

#include "classfile/classLoaderData.hpp"
#include "classfile/packageEntry.hpp"
#include "classfile/systemDictionary.hpp"
#include "memory/filemap.hpp"
Expand Down
1 change: 1 addition & 0 deletions src/hotspot/share/code/compiledIC.cpp
Expand Up @@ -35,6 +35,7 @@
#include "memory/oopFactory.hpp"
#include "memory/resourceArea.hpp"
#include "memory/universe.hpp"
#include "oops/klass.inline.hpp"
#include "oops/method.inline.hpp"
#include "oops/oop.inline.hpp"
#include "oops/symbol.hpp"
Expand Down
2 changes: 2 additions & 0 deletions src/hotspot/share/code/compiledMethod.cpp
Expand Up @@ -36,6 +36,8 @@
#include "logging/log.hpp"
#include "logging/logTag.hpp"
#include "memory/resourceArea.hpp"
#include "oops/compiledICHolder.inline.hpp"
#include "oops/klass.inline.hpp"
#include "oops/methodData.hpp"
#include "oops/method.inline.hpp"
#include "prims/methodHandles.hpp"
Expand Down
1 change: 1 addition & 0 deletions src/hotspot/share/code/nmethod.cpp
Expand Up @@ -46,6 +46,7 @@
#include "memory/resourceArea.hpp"
#include "memory/universe.hpp"
#include "oops/access.inline.hpp"
#include "oops/klass.inline.hpp"
#include "oops/method.inline.hpp"
#include "oops/methodData.hpp"
#include "oops/oop.inline.hpp"
Expand Down
1 change: 1 addition & 0 deletions src/hotspot/share/compiler/compileTask.cpp
Expand Up @@ -31,6 +31,7 @@
#include "logging/log.hpp"
#include "logging/logStream.hpp"
#include "memory/resourceArea.hpp"
#include "oops/klass.inline.hpp"
#include "runtime/handles.inline.hpp"
#include "runtime/jniHandles.hpp"

Expand Down
3 changes: 2 additions & 1 deletion src/hotspot/share/gc/g1/g1FullGCMarker.inline.hpp
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2017, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2017, 2021, 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
Expand All @@ -25,6 +25,7 @@
#ifndef SHARE_GC_G1_G1FULLGCMARKER_INLINE_HPP
#define SHARE_GC_G1_G1FULLGCMARKER_INLINE_HPP

#include "classfile/classLoaderData.hpp"
#include "classfile/javaClasses.inline.hpp"
#include "gc/g1/g1Allocator.inline.hpp"
#include "gc/g1/g1ConcurrentMarkBitMap.inline.hpp"
Expand Down
3 changes: 2 additions & 1 deletion src/hotspot/share/gc/parallel/psCompactionManager.inline.hpp