8300682: InstanceKlassMiscStatus is a bad name

Reviewed-by: fparain, dholmes
This commit is contained in:
Coleen Phillimore 2023-01-20 13:20:29 +00:00
parent 26410c180b
commit 4562b402fb
5 changed files with 49 additions and 49 deletions

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2015, 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 2023, 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
@ -160,7 +160,7 @@
nonstatic_field(InstanceKlass, _constants, ConstantPool*) \
nonstatic_field(InstanceKlass, _init_state, InstanceKlass::ClassState) \
nonstatic_field(InstanceKlass, _init_thread, Thread*) \
nonstatic_field(InstanceKlass, _misc_status._flags, u2) \
nonstatic_field(InstanceKlass, _misc_flags._flags, u2) \
nonstatic_field(InstanceKlass, _annotations, Annotations*) \
\
volatile_nonstatic_field(JavaFrameAnchor, _last_Java_sp, intptr_t*) \
@ -653,8 +653,8 @@
/* InstanceKlass _misc_flags */ \
/*********************************/ \
\
declare_constant(InstanceKlassMiscStatus::_misc_has_nonstatic_concrete_methods) \
declare_constant(InstanceKlassMiscStatus::_misc_declares_nonstatic_concrete_methods) \
declare_constant(InstanceKlassFlags::_misc_has_nonstatic_concrete_methods) \
declare_constant(InstanceKlassFlags::_misc_declares_nonstatic_concrete_methods) \
\
declare_constant(JumpData::taken_off_set) \
declare_constant(JumpData::displacement_off_set) \

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2023, 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
@ -29,7 +29,7 @@
#include "oops/annotations.hpp"
#include "oops/constMethod.hpp"
#include "oops/fieldInfo.hpp"
#include "oops/instanceKlassMiscStatus.hpp"
#include "oops/instanceKlassFlags.hpp"
#include "oops/instanceOop.hpp"
#include "runtime/handles.hpp"
#include "utilities/accessFlags.hpp"
@ -223,7 +223,7 @@ class InstanceKlass: public Klass {
volatile u2 _idnum_allocated_count; // JNI/JVMTI: increments with the addition of methods, old ids don't change
// _is_marked_dependent can be set concurrently, thus cannot be part of the
// _misc_status right now.
// _misc_flags right now.
bool _is_marked_dependent; // used for marking during flushing and deoptimization
ClassState _init_state; // state of class
@ -231,7 +231,7 @@ class InstanceKlass: public Klass {
u1 _reference_type; // reference type
// State is set while executing, eventually atomically to not disturb other state
InstanceKlassMiscStatus _misc_status;
InstanceKlassFlags _misc_flags;
Monitor* _init_monitor; // mutual exclusion to _init_state and _init_thread.
Thread* _init_thread; // Pointer to current thread doing initialization (to handle recursive initialization)
@ -315,29 +315,29 @@ class InstanceKlass: public Klass {
static void set_finalization_enabled(bool val) { _finalization_enabled = val; }
// The three BUILTIN class loader types
bool is_shared_boot_class() const { return _misc_status.is_shared_boot_class(); }
bool is_shared_platform_class() const { return _misc_status.is_shared_platform_class(); }
bool is_shared_app_class() const { return _misc_status.is_shared_app_class(); }
bool is_shared_boot_class() const { return _misc_flags.is_shared_boot_class(); }
bool is_shared_platform_class() const { return _misc_flags.is_shared_platform_class(); }
bool is_shared_app_class() const { return _misc_flags.is_shared_app_class(); }
// The UNREGISTERED class loader type
bool is_shared_unregistered_class() const { return _misc_status.is_shared_unregistered_class(); }
bool is_shared_unregistered_class() const { return _misc_flags.is_shared_unregistered_class(); }
// Check if the class can be shared in CDS
bool is_shareable() const;
bool shared_loading_failed() const { return _misc_status.shared_loading_failed(); }
bool shared_loading_failed() const { return _misc_flags.shared_loading_failed(); }
void set_shared_loading_failed() { _misc_status.set_shared_loading_failed(true); }
void set_shared_loading_failed() { _misc_flags.set_shared_loading_failed(true); }
#if INCLUDE_CDS
void set_shared_class_loader_type(s2 loader_type) { _misc_status.set_shared_class_loader_type(loader_type); }
void assign_class_loader_type() { _misc_status.assign_class_loader_type(_class_loader_data); }
void set_shared_class_loader_type(s2 loader_type) { _misc_flags.set_shared_class_loader_type(loader_type); }
void assign_class_loader_type() { _misc_flags.assign_class_loader_type(_class_loader_data); }
#endif
bool has_nonstatic_fields() const { return _misc_status.has_nonstatic_fields(); }
void set_has_nonstatic_fields(bool b) { _misc_status.set_has_nonstatic_fields(b); }
bool has_nonstatic_fields() const { return _misc_flags.has_nonstatic_fields(); }
void set_has_nonstatic_fields(bool b) { _misc_flags.set_has_nonstatic_fields(b); }
bool has_localvariable_table() const { return _misc_status.has_localvariable_table(); }
void set_has_localvariable_table(bool b) { _misc_status.set_has_localvariable_table(b); }
bool has_localvariable_table() const { return _misc_flags.has_localvariable_table(); }
void set_has_localvariable_table(bool b) { _misc_flags.set_has_localvariable_table(b); }
// field sizes
int nonstatic_field_size() const { return _nonstatic_field_size; }
@ -514,7 +514,7 @@ public:
bool is_init_thread(Thread *thread) { return thread == _init_thread; }
ClassState init_state() const { return Atomic::load(&_init_state); }
const char* init_state_name() const;
bool is_rewritten() const { return _misc_status.rewritten(); }
bool is_rewritten() const { return _misc_flags.rewritten(); }
class LockLinkState : public StackObj {
InstanceKlass* _ik;
@ -535,8 +535,8 @@ public:
bool is_sealed() const;
// defineClass specified verification
bool should_verify_class() const { return _misc_status.should_verify_class(); }
void set_should_verify_class(bool value) { _misc_status.set_should_verify_class(value); }
bool should_verify_class() const { return _misc_flags.should_verify_class(); }
void set_should_verify_class(bool value) { _misc_flags.set_should_verify_class(value); }
// marking
bool is_marked_dependent() const { return _is_marked_dependent; }
@ -652,8 +652,8 @@ public:
// signers
objArrayOop signers() const;
bool is_contended() const { return _misc_status.is_contended(); }
void set_is_contended(bool value) { _misc_status.set_is_contended(value); }
bool is_contended() const { return _misc_flags.is_contended(); }
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(); }
@ -682,8 +682,8 @@ public:
_nonstatic_oop_map_size = words;
}
bool has_contended_annotations() const { return _misc_status.has_contended_annotations(); }
void set_has_contended_annotations(bool value) { _misc_status.set_has_contended_annotations(value); }
bool has_contended_annotations() const { return _misc_flags.has_contended_annotations(); }
void set_has_contended_annotations(bool value) { _misc_flags.set_has_contended_annotations(value); }
#if INCLUDE_JVMTI
// Redefinition locking. Class can only be redefined by one thread at a time.
@ -718,11 +718,11 @@ public:
return NULL;
}
bool has_been_redefined() const { return _misc_status.has_been_redefined(); }
void set_has_been_redefined() { _misc_status.set_has_been_redefined(true); }
bool has_been_redefined() const { return _misc_flags.has_been_redefined(); }
void set_has_been_redefined() { _misc_flags.set_has_been_redefined(true); }
bool is_scratch_class() const { return _misc_status.is_scratch_class(); }
void set_is_scratch_class() { _misc_status.set_is_scratch_class(true); }
bool is_scratch_class() const { return _misc_flags.is_scratch_class(); }
void set_is_scratch_class() { _misc_flags.set_is_scratch_class(true); }
bool has_resolved_methods() const {
return _access_flags.has_resolved_methods();
@ -778,11 +778,11 @@ public:
#endif // INCLUDE_JVMTI
bool has_nonstatic_concrete_methods() const { return _misc_status.has_nonstatic_concrete_methods(); }
void set_has_nonstatic_concrete_methods(bool b) { _misc_status.set_has_nonstatic_concrete_methods(b); }
bool has_nonstatic_concrete_methods() const { return _misc_flags.has_nonstatic_concrete_methods(); }
void set_has_nonstatic_concrete_methods(bool b) { _misc_flags.set_has_nonstatic_concrete_methods(b); }
bool declares_nonstatic_concrete_methods() const { return _misc_status.declares_nonstatic_concrete_methods(); }
void set_declares_nonstatic_concrete_methods(bool b) { _misc_status.set_declares_nonstatic_concrete_methods(b); }
bool declares_nonstatic_concrete_methods() const { return _misc_flags.declares_nonstatic_concrete_methods(); }
void set_declares_nonstatic_concrete_methods(bool b) { _misc_flags.set_declares_nonstatic_concrete_methods(b); }
// for adding methods, ConstMethod::UNSET_IDNUM means no more ids available
inline u2 next_method_idnum();
@ -1076,7 +1076,7 @@ public:
private:
// initialization state
void set_init_state(ClassState state);
void set_rewritten() { _misc_status.set_rewritten(true); }
void set_rewritten() { _misc_flags.set_rewritten(true); }
void set_init_thread(Thread *thread) {
assert(thread == nullptr || _init_thread == nullptr, "Only one thread is allowed to own initialization");
_init_thread = thread;

View File

@ -25,12 +25,12 @@
#include "precompiled.hpp"
#include "classfile/classLoader.hpp"
#include "classfile/classLoaderData.inline.hpp"
#include "oops/instanceKlassMiscStatus.hpp"
#include "oops/instanceKlassFlags.hpp"
#include "runtime/safepoint.hpp"
#include "utilities/macros.hpp"
#if INCLUDE_CDS
void InstanceKlassMiscStatus::set_shared_class_loader_type(s2 loader_type) {
void InstanceKlassFlags::set_shared_class_loader_type(s2 loader_type) {
switch (loader_type) {
case ClassLoader::BOOT_LOADER:
_flags |= _misc_is_shared_boot_class;
@ -47,7 +47,7 @@ void InstanceKlassMiscStatus::set_shared_class_loader_type(s2 loader_type) {
}
}
void InstanceKlassMiscStatus::assign_class_loader_type(const ClassLoaderData* cld) {
void InstanceKlassFlags::assign_class_loader_type(const ClassLoaderData* cld) {
if (cld->is_boot_class_loader_data()) {
set_shared_class_loader_type(ClassLoader::BOOT_LOADER);
}
@ -61,7 +61,7 @@ void InstanceKlassMiscStatus::assign_class_loader_type(const ClassLoaderData* cl
#endif // INCLUDE_CDS
#ifdef ASSERT
void InstanceKlassMiscStatus::assert_is_safe(bool set) {
void InstanceKlassFlags::assert_is_safe(bool set) {
// Setting a flag is safe if it's set once or at a safepoint. RedefineClasses can set or
// reset flags at a safepoint.
assert(!set || SafepointSynchronize::is_at_safepoint(), "set once or at safepoint");

View File

@ -22,12 +22,12 @@
*
*/
#ifndef SHARE_OOPS_INSTANCEKLASSMISCSTATUS_HPP
#define SHARE_OOPS_INSTANCEKLASSMISCSTATUS_HPP
#ifndef SHARE_OOPS_INSTANCEKLASSFLAGS_HPP
#define SHARE_OOPS_INSTANCEKLASSFLAGS_HPP
class ClassLoaderData;
class InstanceKlassMiscStatus {
class InstanceKlassFlags {
friend class VMStructs;
friend class JVMCIVMStructs;
@ -63,7 +63,7 @@ class InstanceKlassMiscStatus {
public:
InstanceKlassMiscStatus() : _flags(0) {}
InstanceKlassFlags() : _flags(0) {}
// Create getters and setters for the flag values.
#define IK_FLAGS_GET(name, ignore) \
@ -89,4 +89,4 @@ class InstanceKlassMiscStatus {
void assert_is_safe(bool set) NOT_DEBUG_RETURN;
};
#endif // SHARE_OOPS_INSTANCEKLASSMISCSTATUS_HPP
#endif // SHARE_OOPS_INSTANCEKLASSFLAGS_HPP

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2011, 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2011, 2023, 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
@ -101,7 +101,7 @@ class HotSpotVMConfig extends HotSpotVMConfigAccess {
final int instanceKlassConstantsOffset = getFieldOffset("InstanceKlass::_constants", Integer.class, "ConstantPool*");
final int instanceKlassFieldsOffset = getFieldOffset("InstanceKlass::_fields", Integer.class, "Array<u2>*");
final int instanceKlassAnnotationsOffset = getFieldOffset("InstanceKlass::_annotations", Integer.class, "Annotations*");
final int instanceKlassMiscFlagsOffset = getFieldOffset("InstanceKlass::_misc_status._flags", Integer.class, "u2");
final int instanceKlassMiscFlagsOffset = getFieldOffset("InstanceKlass::_misc_flags._flags", Integer.class, "u2");
final int klassVtableStartOffset = getFieldValue("CompilerToVM::Data::Klass_vtable_start_offset", Integer.class, "int");
final int klassVtableLengthOffset = getFieldValue("CompilerToVM::Data::Klass_vtable_length_offset", Integer.class, "int");
@ -140,8 +140,8 @@ class HotSpotVMConfig extends HotSpotVMConfigAccess {
final int jvmAccEnum = getConstant("JVM_ACC_ENUM", Integer.class);
final int jvmAccInterface = getConstant("JVM_ACC_INTERFACE", Integer.class);
final int jvmMiscFlagsHasDefaultMethods = getConstant("InstanceKlassMiscStatus::_misc_has_nonstatic_concrete_methods", Integer.class);
final int jvmMiscFlagsDeclaresDefaultMethods = getConstant("InstanceKlassMiscStatus::_misc_declares_nonstatic_concrete_methods", Integer.class);
final int jvmMiscFlagsHasDefaultMethods = getConstant("InstanceKlassFlags::_misc_has_nonstatic_concrete_methods", Integer.class);
final int jvmMiscFlagsDeclaresDefaultMethods = getConstant("InstanceKlassFlags::_misc_declares_nonstatic_concrete_methods", Integer.class);
// This is only valid on AMD64.
final int runtimeCallStackSize = getConstant("frame::arg_reg_save_area_bytes", Integer.class, osArch.equals("amd64") ? null : 0);