@@ -253,8 +253,7 @@ class InstanceKlass: public Klass {
253253 _misc_is_shared_boot_class = 1 << 10 , // defining class loader is boot class loader
254254 _misc_is_shared_platform_class = 1 << 11 , // defining class loader is platform class loader
255255 _misc_is_shared_app_class = 1 << 12 , // defining class loader is app class loader
256- _misc_has_resolved_methods = 1 << 13 , // resolved methods table entries added for this class
257- _misc_has_contended_annotations = 1 << 14 // has @Contended annotation
256+ _misc_has_contended_annotations = 1 << 13 // has @Contended annotation
258257 };
259258 u2 shared_loader_type_bits () const {
260259 return _misc_is_shared_boot_class|_misc_is_shared_platform_class|_misc_is_shared_app_class;
@@ -366,10 +365,6 @@ class InstanceKlass: public Klass {
366365 _misc_flags |= _misc_shared_loading_failed;
367366 }
368367
369- void clear_shared_loading_failed () {
370- _misc_flags &= ~_misc_shared_loading_failed;
371- }
372-
373368 void set_shared_class_loader_type (s2 loader_type);
374369
375370 void assign_class_loader_type ();
@@ -378,10 +373,9 @@ class InstanceKlass: public Klass {
378373 return (_misc_flags & _misc_has_nonstatic_fields) != 0 ;
379374 }
380375 void set_has_nonstatic_fields (bool b) {
376+ assert (!has_nonstatic_fields (), " set once" );
381377 if (b) {
382378 _misc_flags |= _misc_has_nonstatic_fields;
383- } else {
384- _misc_flags &= ~_misc_has_nonstatic_fields;
385379 }
386380 }
387381
@@ -563,10 +557,9 @@ class InstanceKlass: public Klass {
563557 return (_misc_flags & _misc_should_verify_class) != 0 ;
564558 }
565559 void set_should_verify_class (bool value) {
560+ assert (!should_verify_class (), " set once" );
566561 if (value) {
567562 _misc_flags |= _misc_should_verify_class;
568- } else {
569- _misc_flags &= ~_misc_should_verify_class;
570563 }
571564 }
572565
@@ -695,10 +688,9 @@ class InstanceKlass: public Klass {
695688 return (_misc_flags & _misc_is_contended) != 0 ;
696689 }
697690 void set_is_contended (bool value) {
691+ assert (!is_contended (), " set once" );
698692 if (value) {
699693 _misc_flags |= _misc_is_contended;
700- } else {
701- _misc_flags &= ~_misc_is_contended;
702694 }
703695 }
704696
@@ -733,10 +725,9 @@ class InstanceKlass: public Klass {
733725 return ((_misc_flags & _misc_has_contended_annotations) != 0 );
734726 }
735727 void set_has_contended_annotations (bool value) {
728+ assert (!has_contended_annotations (), " set once" );
736729 if (value) {
737730 _misc_flags |= _misc_has_contended_annotations;
738- } else {
739- _misc_flags &= ~_misc_has_contended_annotations;
740731 }
741732 }
742733
@@ -789,11 +780,11 @@ class InstanceKlass: public Klass {
789780 }
790781
791782 bool has_resolved_methods () const {
792- return (_misc_flags & _misc_has_resolved_methods) != 0 ;
783+ return _access_flags. has_resolved_methods () ;
793784 }
794785
795786 void set_has_resolved_methods () {
796- _misc_flags |= _misc_has_resolved_methods ;
787+ _access_flags. set_has_resolved_methods () ;
797788 }
798789private:
799790
@@ -862,21 +853,19 @@ class InstanceKlass: public Klass {
862853 return (_misc_flags & _misc_has_nonstatic_concrete_methods) != 0 ;
863854 }
864855 void set_has_nonstatic_concrete_methods (bool b) {
856+ assert (!has_nonstatic_concrete_methods (), " set once" );
865857 if (b) {
866858 _misc_flags |= _misc_has_nonstatic_concrete_methods;
867- } else {
868- _misc_flags &= ~_misc_has_nonstatic_concrete_methods;
869859 }
870860 }
871861
872862 bool declares_nonstatic_concrete_methods () const {
873863 return (_misc_flags & _misc_declares_nonstatic_concrete_methods) != 0 ;
874864 }
875865 void set_declares_nonstatic_concrete_methods (bool b) {
866+ assert (!declares_nonstatic_concrete_methods (), " set once" );
876867 if (b) {
877868 _misc_flags |= _misc_declares_nonstatic_concrete_methods;
878- } else {
879- _misc_flags &= ~_misc_declares_nonstatic_concrete_methods;
880869 }
881870 }
882871
0 commit comments