1
1
/*
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.
3
3
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4
4
*
5
5
* This code is free software; you can redistribute it and/or modify it
29
29
#include " oops/annotations.hpp"
30
30
#include " oops/constMethod.hpp"
31
31
#include " oops/fieldInfo.hpp"
32
- #include " oops/instanceKlassMiscStatus .hpp"
32
+ #include " oops/instanceKlassFlags .hpp"
33
33
#include " oops/instanceOop.hpp"
34
34
#include " runtime/handles.hpp"
35
35
#include " utilities/accessFlags.hpp"
@@ -223,15 +223,15 @@ class InstanceKlass: public Klass {
223
223
volatile u2 _idnum_allocated_count; // JNI/JVMTI: increments with the addition of methods, old ids don't change
224
224
225
225
// _is_marked_dependent can be set concurrently, thus cannot be part of the
226
- // _misc_status right now.
226
+ // _misc_flags right now.
227
227
bool _is_marked_dependent; // used for marking during flushing and deoptimization
228
228
229
229
ClassState _init_state; // state of class
230
230
231
231
u1 _reference_type; // reference type
232
232
233
233
// State is set while executing, eventually atomically to not disturb other state
234
- InstanceKlassMiscStatus _misc_status ;
234
+ InstanceKlassFlags _misc_flags ;
235
235
236
236
Monitor* _init_monitor; // mutual exclusion to _init_state and _init_thread.
237
237
Thread* _init_thread; // Pointer to current thread doing initialization (to handle recursive initialization)
@@ -315,29 +315,29 @@ class InstanceKlass: public Klass {
315
315
static void set_finalization_enabled (bool val) { _finalization_enabled = val; }
316
316
317
317
// 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 (); }
321
321
// 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 (); }
323
323
324
324
// Check if the class can be shared in CDS
325
325
bool is_shareable () const ;
326
326
327
- bool shared_loading_failed () const { return _misc_status .shared_loading_failed (); }
327
+ bool shared_loading_failed () const { return _misc_flags .shared_loading_failed (); }
328
328
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 ); }
330
330
331
331
#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); }
334
334
#endif
335
335
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); }
338
338
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); }
341
341
342
342
// field sizes
343
343
int nonstatic_field_size () const { return _nonstatic_field_size; }
@@ -514,7 +514,7 @@ class InstanceKlass: public Klass {
514
514
bool is_init_thread (Thread *thread) { return thread == _init_thread; }
515
515
ClassState init_state () const { return Atomic::load (&_init_state); }
516
516
const char * init_state_name () const ;
517
- bool is_rewritten () const { return _misc_status .rewritten (); }
517
+ bool is_rewritten () const { return _misc_flags .rewritten (); }
518
518
519
519
class LockLinkState : public StackObj {
520
520
InstanceKlass* _ik;
@@ -535,8 +535,8 @@ class InstanceKlass: public Klass {
535
535
bool is_sealed () const ;
536
536
537
537
// 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); }
540
540
541
541
// marking
542
542
bool is_marked_dependent () const { return _is_marked_dependent; }
@@ -652,8 +652,8 @@ class InstanceKlass: public Klass {
652
652
// signers
653
653
objArrayOop signers () const ;
654
654
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); }
657
657
658
658
// source file name
659
659
Symbol* source_file_name () const { return _constants->source_file_name (); }
@@ -682,8 +682,8 @@ class InstanceKlass: public Klass {
682
682
_nonstatic_oop_map_size = words;
683
683
}
684
684
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); }
687
687
688
688
#if INCLUDE_JVMTI
689
689
// Redefinition locking. Class can only be redefined by one thread at a time.
@@ -718,11 +718,11 @@ class InstanceKlass: public Klass {
718
718
return NULL ;
719
719
}
720
720
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 ); }
723
723
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 ); }
726
726
727
727
bool has_resolved_methods () const {
728
728
return _access_flags.has_resolved_methods ();
@@ -778,11 +778,11 @@ class InstanceKlass: public Klass {
778
778
779
779
#endif // INCLUDE_JVMTI
780
780
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); }
783
783
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); }
786
786
787
787
// for adding methods, ConstMethod::UNSET_IDNUM means no more ids available
788
788
inline u2 next_method_idnum ();
@@ -1076,7 +1076,7 @@ class InstanceKlass: public Klass {
1076
1076
private:
1077
1077
// initialization state
1078
1078
void set_init_state (ClassState state);
1079
- void set_rewritten () { _misc_status .set_rewritten (true ); }
1079
+ void set_rewritten () { _misc_flags .set_rewritten (true ); }
1080
1080
void set_init_thread (Thread *thread) {
1081
1081
assert (thread == nullptr || _init_thread == nullptr , " Only one thread is allowed to own initialization" );
1082
1082
_init_thread = thread;
0 commit comments