8310494: Do not include constantPool.hpp from instanceKlass.hpp

Reviewed-by: stefank, coleenp
This commit is contained in:
Ioi Lam 2023-06-23 19:42:57 +00:00
parent 0314292cb2
commit bfcca5eff9
5 changed files with 48 additions and 25 deletions

View File

@ -28,7 +28,9 @@
#include "classfile/vmClasses.hpp"
#include "oops/instanceKlass.hpp"
#include "oops/oopsHierarchy.hpp"
#include "oops/symbol.hpp"
#include "runtime/handles.hpp"
#include "runtime/os.hpp"
#include "utilities/macros.hpp"
#include "utilities/vmEnums.hpp"

View File

@ -2846,6 +2846,31 @@ void InstanceKlass::release_C_heap_structures(bool release_sub_metadata) {
}
}
// The constant pool is on stack if any of the methods are executing or
// referenced by handles.
bool InstanceKlass::on_stack() const {
return _constants->on_stack();
}
Symbol* InstanceKlass::source_file_name() const { return _constants->source_file_name(); }
u2 InstanceKlass::source_file_name_index() const { return _constants->source_file_name_index(); }
void InstanceKlass::set_source_file_name_index(u2 sourcefile_index) { _constants->set_source_file_name_index(sourcefile_index); }
// minor and major version numbers of class file
u2 InstanceKlass::minor_version() const { return _constants->minor_version(); }
void InstanceKlass::set_minor_version(u2 minor_version) { _constants->set_minor_version(minor_version); }
u2 InstanceKlass::major_version() const { return _constants->major_version(); }
void InstanceKlass::set_major_version(u2 major_version) { _constants->set_major_version(major_version); }
InstanceKlass* InstanceKlass::get_klass_version(int version) {
for (InstanceKlass* ik = this; ik != nullptr; ik = ik->previous_versions()) {
if (ik->constants()->version() == version) {
return ik;
}
}
return nullptr;
}
void InstanceKlass::set_source_debug_extension(const char* array, int length) {
if (array == nullptr) {
_source_debug_extension = nullptr;
@ -2864,6 +2889,10 @@ void InstanceKlass::set_source_debug_extension(const char* array, int length) {
}
}
Symbol* InstanceKlass::generic_signature() const { return _constants->generic_signature(); }
u2 InstanceKlass::generic_signature_index() const { return _constants->generic_signature_index(); }
void InstanceKlass::set_generic_signature_index(u2 sig_index) { _constants->set_generic_signature_index(sig_index); }
const char* InstanceKlass::signature_name() const {
// Get the internal name as a c string

View File

@ -28,20 +28,23 @@
#include "memory/referenceType.hpp"
#include "oops/annotations.hpp"
#include "oops/constMethod.hpp"
#include "oops/constantPool.hpp"
#include "oops/fieldInfo.hpp"
#include "oops/instanceKlassFlags.hpp"
#include "oops/instanceOop.hpp"
#include "runtime/handles.hpp"
#include "runtime/javaThread.hpp"
#include "utilities/accessFlags.hpp"
#include "utilities/align.hpp"
#include "utilities/growableArray.hpp"
#include "utilities/macros.hpp"
#if INCLUDE_JFR
#include "jfr/support/jfrKlassExtension.hpp"
#endif
class ConstantPool;
class DeoptimizationScope;
class klassItable;
class Monitor;
class RecordComponent;
// An InstanceKlass is the VM level representation of a Java class.
@ -645,15 +648,15 @@ public:
void set_is_contended(bool value) { _misc_flags.set_is_contended(value); }
// source file name
Symbol* source_file_name() const { return _constants->source_file_name(); }
u2 source_file_name_index() const { return _constants->source_file_name_index(); }
void set_source_file_name_index(u2 sourcefile_index) { _constants->set_source_file_name_index(sourcefile_index); }
Symbol* source_file_name() const;
u2 source_file_name_index() const;
void set_source_file_name_index(u2 sourcefile_index);
// minor and major version numbers of class file
u2 minor_version() const { return _constants->minor_version(); }
void set_minor_version(u2 minor_version) { _constants->set_minor_version(minor_version); }
u2 major_version() const { return _constants->major_version(); }
void set_major_version(u2 major_version) { _constants->set_major_version(major_version); }
u2 minor_version() const;
void set_minor_version(u2 minor_version);
u2 major_version() const;
void set_major_version(u2 major_version);
// source debug extension
const char* source_debug_extension() const { return _source_debug_extension; }
@ -690,14 +693,7 @@ public:
InstanceKlass* previous_versions() const { return nullptr; }
#endif
InstanceKlass* get_klass_version(int version) {
for (InstanceKlass* ik = this; ik != nullptr; ik = ik->previous_versions()) {
if (ik->constants()->version() == version) {
return ik;
}
}
return nullptr;
}
InstanceKlass* get_klass_version(int version);
bool has_been_redefined() const { return _misc_flags.has_been_redefined(); }
void set_has_been_redefined() { _misc_flags.set_has_been_redefined(true); }
@ -773,9 +769,9 @@ public:
void set_initial_method_idnum(u2 value) { _idnum_allocated_count = value; }
// generics support
Symbol* generic_signature() const { return _constants->generic_signature(); }
u2 generic_signature_index() const { return _constants->generic_signature_index(); }
void set_generic_signature_index(u2 sig_index) { _constants->set_generic_signature_index(sig_index); }
Symbol* generic_signature() const;
u2 generic_signature_index() const;
void set_generic_signature_index(u2 sig_index);
u2 enclosing_method_data(int offset) const;
u2 enclosing_method_class_index() const {
@ -995,9 +991,7 @@ public:
void static deallocate_record_components(ClassLoaderData* loader_data,
Array<RecordComponent*>* record_component);
// The constant pool is on stack if any of the methods are executing or
// referenced by handles.
bool on_stack() const { return _constants->on_stack(); }
virtual bool on_stack() const;
// callbacks for actions during class unloading
static void unload_class(InstanceKlass* ik);

View File

@ -27,10 +27,7 @@
#include "oops/instanceKlass.hpp"
#include "classfile/javaClasses.hpp"
#include "classfile/vmSymbols.hpp"
#include "memory/memRegion.hpp"
#include "memory/resourceArea.hpp"
#include "oops/fieldInfo.inline.hpp"
#include "oops/klass.inline.hpp"
#include "oops/oop.inline.hpp"

View File

@ -25,6 +25,7 @@
#include "precompiled.hpp"
#include "memory/allocation.inline.hpp"
#include "oops/instanceKlass.hpp"
#include "oops/symbol.hpp"
#include "runtime/javaThread.hpp"
#include "runtime/mutexLocker.hpp"
#include "runtime/osThread.hpp"