Skip to content

Commit 4562b40

Browse files
committed
8300682: InstanceKlassMiscStatus is a bad name
Reviewed-by: fparain, dholmes
1 parent 26410c1 commit 4562b40

File tree

5 files changed

+49
-49
lines changed

5 files changed

+49
-49
lines changed

src/hotspot/share/jvmci/vmStructs_jvmci.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2015, 2022, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2015, 2023, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -160,7 +160,7 @@
160160
nonstatic_field(InstanceKlass, _constants, ConstantPool*) \
161161
nonstatic_field(InstanceKlass, _init_state, InstanceKlass::ClassState) \
162162
nonstatic_field(InstanceKlass, _init_thread, Thread*) \
163-
nonstatic_field(InstanceKlass, _misc_status._flags, u2) \
163+
nonstatic_field(InstanceKlass, _misc_flags._flags, u2) \
164164
nonstatic_field(InstanceKlass, _annotations, Annotations*) \
165165
\
166166
volatile_nonstatic_field(JavaFrameAnchor, _last_Java_sp, intptr_t*) \
@@ -653,8 +653,8 @@
653653
/* InstanceKlass _misc_flags */ \
654654
/*********************************/ \
655655
\
656-
declare_constant(InstanceKlassMiscStatus::_misc_has_nonstatic_concrete_methods) \
657-
declare_constant(InstanceKlassMiscStatus::_misc_declares_nonstatic_concrete_methods) \
656+
declare_constant(InstanceKlassFlags::_misc_has_nonstatic_concrete_methods) \
657+
declare_constant(InstanceKlassFlags::_misc_declares_nonstatic_concrete_methods) \
658658
\
659659
declare_constant(JumpData::taken_off_set) \
660660
declare_constant(JumpData::displacement_off_set) \

src/hotspot/share/oops/instanceKlass.hpp

+32-32
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 1997, 2022, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 1997, 2023, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -29,7 +29,7 @@
2929
#include "oops/annotations.hpp"
3030
#include "oops/constMethod.hpp"
3131
#include "oops/fieldInfo.hpp"
32-
#include "oops/instanceKlassMiscStatus.hpp"
32+
#include "oops/instanceKlassFlags.hpp"
3333
#include "oops/instanceOop.hpp"
3434
#include "runtime/handles.hpp"
3535
#include "utilities/accessFlags.hpp"
@@ -223,15 +223,15 @@ class InstanceKlass: public Klass {
223223
volatile u2 _idnum_allocated_count; // JNI/JVMTI: increments with the addition of methods, old ids don't change
224224

225225
// _is_marked_dependent can be set concurrently, thus cannot be part of the
226-
// _misc_status right now.
226+
// _misc_flags right now.
227227
bool _is_marked_dependent; // used for marking during flushing and deoptimization
228228

229229
ClassState _init_state; // state of class
230230

231231
u1 _reference_type; // reference type
232232

233233
// State is set while executing, eventually atomically to not disturb other state
234-
InstanceKlassMiscStatus _misc_status;
234+
InstanceKlassFlags _misc_flags;
235235

236236
Monitor* _init_monitor; // mutual exclusion to _init_state and _init_thread.
237237
Thread* _init_thread; // Pointer to current thread doing initialization (to handle recursive initialization)
@@ -315,29 +315,29 @@ class InstanceKlass: public Klass {
315315
static void set_finalization_enabled(bool val) { _finalization_enabled = val; }
316316

317317
// The three BUILTIN class loader types
318-
bool is_shared_boot_class() const { return _misc_status.is_shared_boot_class(); }
319-
bool is_shared_platform_class() const { return _misc_status.is_shared_platform_class(); }
320-
bool is_shared_app_class() const { return _misc_status.is_shared_app_class(); }
318+
bool is_shared_boot_class() const { return _misc_flags.is_shared_boot_class(); }
319+
bool is_shared_platform_class() const { return _misc_flags.is_shared_platform_class(); }
320+
bool is_shared_app_class() const { return _misc_flags.is_shared_app_class(); }
321321
// The UNREGISTERED class loader type
322-
bool is_shared_unregistered_class() const { return _misc_status.is_shared_unregistered_class(); }
322+
bool is_shared_unregistered_class() const { return _misc_flags.is_shared_unregistered_class(); }
323323

324324
// Check if the class can be shared in CDS
325325
bool is_shareable() const;
326326

327-
bool shared_loading_failed() const { return _misc_status.shared_loading_failed(); }
327+
bool shared_loading_failed() const { return _misc_flags.shared_loading_failed(); }
328328

329-
void set_shared_loading_failed() { _misc_status.set_shared_loading_failed(true); }
329+
void set_shared_loading_failed() { _misc_flags.set_shared_loading_failed(true); }
330330

331331
#if INCLUDE_CDS
332-
void set_shared_class_loader_type(s2 loader_type) { _misc_status.set_shared_class_loader_type(loader_type); }
333-
void assign_class_loader_type() { _misc_status.assign_class_loader_type(_class_loader_data); }
332+
void set_shared_class_loader_type(s2 loader_type) { _misc_flags.set_shared_class_loader_type(loader_type); }
333+
void assign_class_loader_type() { _misc_flags.assign_class_loader_type(_class_loader_data); }
334334
#endif
335335

336-
bool has_nonstatic_fields() const { return _misc_status.has_nonstatic_fields(); }
337-
void set_has_nonstatic_fields(bool b) { _misc_status.set_has_nonstatic_fields(b); }
336+
bool has_nonstatic_fields() const { return _misc_flags.has_nonstatic_fields(); }
337+
void set_has_nonstatic_fields(bool b) { _misc_flags.set_has_nonstatic_fields(b); }
338338

339-
bool has_localvariable_table() const { return _misc_status.has_localvariable_table(); }
340-
void set_has_localvariable_table(bool b) { _misc_status.set_has_localvariable_table(b); }
339+
bool has_localvariable_table() const { return _misc_flags.has_localvariable_table(); }
340+
void set_has_localvariable_table(bool b) { _misc_flags.set_has_localvariable_table(b); }
341341

342342
// field sizes
343343
int nonstatic_field_size() const { return _nonstatic_field_size; }
@@ -514,7 +514,7 @@ class InstanceKlass: public Klass {
514514
bool is_init_thread(Thread *thread) { return thread == _init_thread; }
515515
ClassState init_state() const { return Atomic::load(&_init_state); }
516516
const char* init_state_name() const;
517-
bool is_rewritten() const { return _misc_status.rewritten(); }
517+
bool is_rewritten() const { return _misc_flags.rewritten(); }
518518

519519
class LockLinkState : public StackObj {
520520
InstanceKlass* _ik;
@@ -535,8 +535,8 @@ class InstanceKlass: public Klass {
535535
bool is_sealed() const;
536536

537537
// defineClass specified verification
538-
bool should_verify_class() const { return _misc_status.should_verify_class(); }
539-
void set_should_verify_class(bool value) { _misc_status.set_should_verify_class(value); }
538+
bool should_verify_class() const { return _misc_flags.should_verify_class(); }
539+
void set_should_verify_class(bool value) { _misc_flags.set_should_verify_class(value); }
540540

541541
// marking
542542
bool is_marked_dependent() const { return _is_marked_dependent; }
@@ -652,8 +652,8 @@ class InstanceKlass: public Klass {
652652
// signers
653653
objArrayOop signers() const;
654654

655-
bool is_contended() const { return _misc_status.is_contended(); }
656-
void set_is_contended(bool value) { _misc_status.set_is_contended(value); }
655+
bool is_contended() const { return _misc_flags.is_contended(); }
656+
void set_is_contended(bool value) { _misc_flags.set_is_contended(value); }
657657

658658
// source file name
659659
Symbol* source_file_name() const { return _constants->source_file_name(); }
@@ -682,8 +682,8 @@ class InstanceKlass: public Klass {
682682
_nonstatic_oop_map_size = words;
683683
}
684684

685-
bool has_contended_annotations() const { return _misc_status.has_contended_annotations(); }
686-
void set_has_contended_annotations(bool value) { _misc_status.set_has_contended_annotations(value); }
685+
bool has_contended_annotations() const { return _misc_flags.has_contended_annotations(); }
686+
void set_has_contended_annotations(bool value) { _misc_flags.set_has_contended_annotations(value); }
687687

688688
#if INCLUDE_JVMTI
689689
// Redefinition locking. Class can only be redefined by one thread at a time.
@@ -718,11 +718,11 @@ class InstanceKlass: public Klass {
718718
return NULL;
719719
}
720720

721-
bool has_been_redefined() const { return _misc_status.has_been_redefined(); }
722-
void set_has_been_redefined() { _misc_status.set_has_been_redefined(true); }
721+
bool has_been_redefined() const { return _misc_flags.has_been_redefined(); }
722+
void set_has_been_redefined() { _misc_flags.set_has_been_redefined(true); }
723723

724-
bool is_scratch_class() const { return _misc_status.is_scratch_class(); }
725-
void set_is_scratch_class() { _misc_status.set_is_scratch_class(true); }
724+
bool is_scratch_class() const { return _misc_flags.is_scratch_class(); }
725+
void set_is_scratch_class() { _misc_flags.set_is_scratch_class(true); }
726726

727727
bool has_resolved_methods() const {
728728
return _access_flags.has_resolved_methods();
@@ -778,11 +778,11 @@ class InstanceKlass: public Klass {
778778

779779
#endif // INCLUDE_JVMTI
780780

781-
bool has_nonstatic_concrete_methods() const { return _misc_status.has_nonstatic_concrete_methods(); }
782-
void set_has_nonstatic_concrete_methods(bool b) { _misc_status.set_has_nonstatic_concrete_methods(b); }
781+
bool has_nonstatic_concrete_methods() const { return _misc_flags.has_nonstatic_concrete_methods(); }
782+
void set_has_nonstatic_concrete_methods(bool b) { _misc_flags.set_has_nonstatic_concrete_methods(b); }
783783

784-
bool declares_nonstatic_concrete_methods() const { return _misc_status.declares_nonstatic_concrete_methods(); }
785-
void set_declares_nonstatic_concrete_methods(bool b) { _misc_status.set_declares_nonstatic_concrete_methods(b); }
784+
bool declares_nonstatic_concrete_methods() const { return _misc_flags.declares_nonstatic_concrete_methods(); }
785+
void set_declares_nonstatic_concrete_methods(bool b) { _misc_flags.set_declares_nonstatic_concrete_methods(b); }
786786

787787
// for adding methods, ConstMethod::UNSET_IDNUM means no more ids available
788788
inline u2 next_method_idnum();
@@ -1076,7 +1076,7 @@ class InstanceKlass: public Klass {
10761076
private:
10771077
// initialization state
10781078
void set_init_state(ClassState state);
1079-
void set_rewritten() { _misc_status.set_rewritten(true); }
1079+
void set_rewritten() { _misc_flags.set_rewritten(true); }
10801080
void set_init_thread(Thread *thread) {
10811081
assert(thread == nullptr || _init_thread == nullptr, "Only one thread is allowed to own initialization");
10821082
_init_thread = thread;

src/hotspot/share/oops/instanceKlassMiscStatus.cpp renamed to src/hotspot/share/oops/instanceKlassFlags.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,12 @@
2525
#include "precompiled.hpp"
2626
#include "classfile/classLoader.hpp"
2727
#include "classfile/classLoaderData.inline.hpp"
28-
#include "oops/instanceKlassMiscStatus.hpp"
28+
#include "oops/instanceKlassFlags.hpp"
2929
#include "runtime/safepoint.hpp"
3030
#include "utilities/macros.hpp"
3131

3232
#if INCLUDE_CDS
33-
void InstanceKlassMiscStatus::set_shared_class_loader_type(s2 loader_type) {
33+
void InstanceKlassFlags::set_shared_class_loader_type(s2 loader_type) {
3434
switch (loader_type) {
3535
case ClassLoader::BOOT_LOADER:
3636
_flags |= _misc_is_shared_boot_class;
@@ -47,7 +47,7 @@ void InstanceKlassMiscStatus::set_shared_class_loader_type(s2 loader_type) {
4747
}
4848
}
4949

50-
void InstanceKlassMiscStatus::assign_class_loader_type(const ClassLoaderData* cld) {
50+
void InstanceKlassFlags::assign_class_loader_type(const ClassLoaderData* cld) {
5151
if (cld->is_boot_class_loader_data()) {
5252
set_shared_class_loader_type(ClassLoader::BOOT_LOADER);
5353
}
@@ -61,7 +61,7 @@ void InstanceKlassMiscStatus::assign_class_loader_type(const ClassLoaderData* cl
6161
#endif // INCLUDE_CDS
6262

6363
#ifdef ASSERT
64-
void InstanceKlassMiscStatus::assert_is_safe(bool set) {
64+
void InstanceKlassFlags::assert_is_safe(bool set) {
6565
// Setting a flag is safe if it's set once or at a safepoint. RedefineClasses can set or
6666
// reset flags at a safepoint.
6767
assert(!set || SafepointSynchronize::is_at_safepoint(), "set once or at safepoint");

src/hotspot/share/oops/instanceKlassMiscStatus.hpp renamed to src/hotspot/share/oops/instanceKlassFlags.hpp

+5-5
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,12 @@
2222
*
2323
*/
2424

25-
#ifndef SHARE_OOPS_INSTANCEKLASSMISCSTATUS_HPP
26-
#define SHARE_OOPS_INSTANCEKLASSMISCSTATUS_HPP
25+
#ifndef SHARE_OOPS_INSTANCEKLASSFLAGS_HPP
26+
#define SHARE_OOPS_INSTANCEKLASSFLAGS_HPP
2727

2828
class ClassLoaderData;
2929

30-
class InstanceKlassMiscStatus {
30+
class InstanceKlassFlags {
3131
friend class VMStructs;
3232
friend class JVMCIVMStructs;
3333

@@ -63,7 +63,7 @@ class InstanceKlassMiscStatus {
6363

6464
public:
6565

66-
InstanceKlassMiscStatus() : _flags(0) {}
66+
InstanceKlassFlags() : _flags(0) {}
6767

6868
// Create getters and setters for the flag values.
6969
#define IK_FLAGS_GET(name, ignore) \
@@ -89,4 +89,4 @@ class InstanceKlassMiscStatus {
8989
void assert_is_safe(bool set) NOT_DEBUG_RETURN;
9090
};
9191

92-
#endif // SHARE_OOPS_INSTANCEKLASSMISCSTATUS_HPP
92+
#endif // SHARE_OOPS_INSTANCEKLASSFLAGS_HPP

src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotVMConfig.java

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2011, 2022, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2011, 2023, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -101,7 +101,7 @@ String getHostArchitectureName() {
101101
final int instanceKlassConstantsOffset = getFieldOffset("InstanceKlass::_constants", Integer.class, "ConstantPool*");
102102
final int instanceKlassFieldsOffset = getFieldOffset("InstanceKlass::_fields", Integer.class, "Array<u2>*");
103103
final int instanceKlassAnnotationsOffset = getFieldOffset("InstanceKlass::_annotations", Integer.class, "Annotations*");
104-
final int instanceKlassMiscFlagsOffset = getFieldOffset("InstanceKlass::_misc_status._flags", Integer.class, "u2");
104+
final int instanceKlassMiscFlagsOffset = getFieldOffset("InstanceKlass::_misc_flags._flags", Integer.class, "u2");
105105
final int klassVtableStartOffset = getFieldValue("CompilerToVM::Data::Klass_vtable_start_offset", Integer.class, "int");
106106
final int klassVtableLengthOffset = getFieldValue("CompilerToVM::Data::Klass_vtable_length_offset", Integer.class, "int");
107107

@@ -140,8 +140,8 @@ String getHostArchitectureName() {
140140
final int jvmAccEnum = getConstant("JVM_ACC_ENUM", Integer.class);
141141
final int jvmAccInterface = getConstant("JVM_ACC_INTERFACE", Integer.class);
142142

143-
final int jvmMiscFlagsHasDefaultMethods = getConstant("InstanceKlassMiscStatus::_misc_has_nonstatic_concrete_methods", Integer.class);
144-
final int jvmMiscFlagsDeclaresDefaultMethods = getConstant("InstanceKlassMiscStatus::_misc_declares_nonstatic_concrete_methods", Integer.class);
143+
final int jvmMiscFlagsHasDefaultMethods = getConstant("InstanceKlassFlags::_misc_has_nonstatic_concrete_methods", Integer.class);
144+
final int jvmMiscFlagsDeclaresDefaultMethods = getConstant("InstanceKlassFlags::_misc_declares_nonstatic_concrete_methods", Integer.class);
145145

146146
// This is only valid on AMD64.
147147
final int runtimeCallStackSize = getConstant("frame::arg_reg_save_area_bytes", Integer.class, osArch.equals("amd64") ? null : 0);

0 commit comments

Comments
 (0)