58 // [number of implementors ]
59 // [implementors ] klassOop[2]
60 // [fields ]
61 // [constants ]
62 // [class loader ]
63 // [protection domain ]
64 // [signers ]
65 // [source file name ]
66 // [inner classes ]
67 // [static field size ]
68 // [nonstatic field size ]
69 // [static oop fields size ]
70 // [nonstatic oop maps size ]
71 // [has finalize method ]
72 // [deoptimization mark bit ]
73 // [initialization state ]
74 // [initializing thread ]
75 // [Java vtable length ]
76 // [oop map cache (stack maps) ]
77 // [EMBEDDED Java vtable ] size in words = vtable_len
78 // [EMBEDDED static oop fields ] size in words = static_oop_fields_size
79 // [ static non-oop fields ] size in words = static_field_size - static_oop_fields_size
80 // [EMBEDDED nonstatic oop-map blocks] size in words = nonstatic_oop_map_size
81 //
82 // The embedded nonstatic oop-map blocks are short pairs (offset, length) indicating
83 // where oops are located in instances of this klass.
84
85
86 // forward declaration for class -- see below for definition
87 class SuperTypeClosure;
88 class JNIid;
89 class jniIdMapBase;
90 class BreakpointInfo;
91 class fieldDescriptor;
92 class DepChange;
93 class nmethodBucket;
94 class PreviousVersionNode;
95 class JvmtiCachedClassFieldMap;
96
97 // This is used in iterators below.
98 class FieldClosure: public StackObj {
99 public:
213 objArrayOop _methods_default_annotations;
214
215 //
216 // End of the oop block.
217 //
218
219 // Name of source file containing this klass, NULL if not specified.
220 Symbol* _source_file_name;
221 // the source debug extension for this klass, NULL if not specified.
222 Symbol* _source_debug_extension;
223 // Generic signature, or null if none.
224 Symbol* _generic_signature;
225 // Array name derived from this class which needs unreferencing
226 // if this class is unloaded.
227 Symbol* _array_name;
228
229 // Number of heapOopSize words used by non-static fields in this klass
230 // (including inherited fields but after header_size()).
231 int _nonstatic_field_size;
232 int _static_field_size; // number words used by static fields (oop and non-oop) in this klass
233 int _static_oop_field_size;// number of static oop fields in this klass
234 int _nonstatic_oop_map_size;// size in words of nonstatic oop map blocks
235 bool _is_marked_dependent; // used for marking during flushing and deoptimization
236 bool _rewritten; // methods rewritten.
237 bool _has_nonstatic_fields; // for sizing with UseCompressedOops
238 bool _should_verify_class; // allow caching of preverification
239 u2 _minor_version; // minor version number of class file
240 u2 _major_version; // major version number of class file
241 ClassState _init_state; // state of class
242 Thread* _init_thread; // Pointer to current thread doing initialization (to handle recusive initialization)
243 int _vtable_len; // length of Java vtable (in words)
244 int _itable_len; // length of Java itable (in words)
245 ReferenceType _reference_type; // reference type
246 OopMapCache* volatile _oop_map_cache; // OopMapCache for all methods in the klass (allocated lazily)
247 JNIid* _jni_ids; // First JNI identifier for static fields in this class
248 jmethodID* _methods_jmethod_ids; // jmethodIDs corresponding to method_idnum, or NULL if none
249 int* _methods_cached_itable_indices; // itable_index cache for JNI invoke corresponding to methods idnum, or NULL
250 nmethodBucket* _dependencies; // list of dependent nmethods
251 nmethod* _osr_nmethods_head; // Head of list of on-stack replacement nmethods for this class
252 BreakpointInfo* _breakpoints; // bpt lists, managed by methodOop
253 int _nof_implementors; // No of implementors of this interface (zero if not an interface)
264
265 // embedded Java vtable follows here
266 // embedded Java itables follows here
267 // embedded static fields follows here
268 // embedded nonstatic oop-map blocks follows here
269
270 friend class instanceKlassKlass;
271 friend class SystemDictionary;
272
273 public:
274 bool has_nonstatic_fields() const { return _has_nonstatic_fields; }
275 void set_has_nonstatic_fields(bool b) { _has_nonstatic_fields = b; }
276
277 // field sizes
278 int nonstatic_field_size() const { return _nonstatic_field_size; }
279 void set_nonstatic_field_size(int size) { _nonstatic_field_size = size; }
280
281 int static_field_size() const { return _static_field_size; }
282 void set_static_field_size(int size) { _static_field_size = size; }
283
284 int static_oop_field_size() const { return _static_oop_field_size; }
285 void set_static_oop_field_size(int size) { _static_oop_field_size = size; }
286
287 // Java vtable
288 int vtable_length() const { return _vtable_len; }
289 void set_vtable_length(int len) { _vtable_len = len; }
290
291 // Java itable
292 int itable_length() const { return _itable_len; }
293 void set_itable_length(int len) { _itable_len = len; }
294
295 // array klasses
296 klassOop array_klasses() const { return _array_klasses; }
297 void set_array_klasses(klassOop k) { oop_store_without_check((oop*) &_array_klasses, (oop) k); }
298
299 // methods
300 objArrayOop methods() const { return _methods; }
301 void set_methods(objArrayOop a) { oop_store_without_check((oop*) &_methods, (oop) a); }
302 methodOop method_with_idnum(int idnum);
303
304 // method ordering
305 typeArrayOop method_ordering() const { return _method_ordering; }
643 objArrayOop compute_secondary_supers(int num_extra_slots, TRAPS);
644 bool compute_is_subtype_of(klassOop k);
645 bool can_be_primary_super_slow() const;
646 klassOop java_super() const { return super(); }
647 int oop_size(oop obj) const { return size_helper(); }
648 int klass_oop_size() const { return object_size(); }
649 bool oop_is_instance_slow() const { return true; }
650
651 // Iterators
652 void do_local_static_fields(FieldClosure* cl);
653 void do_nonstatic_fields(FieldClosure* cl); // including inherited fields
654 void do_local_static_fields(void f(fieldDescriptor*, TRAPS), TRAPS);
655
656 void methods_do(void f(methodOop method));
657 void array_klasses_do(void f(klassOop k));
658 void with_array_klasses_do(void f(klassOop k));
659 bool super_types_do(SuperTypeClosure* blk);
660
661 // Casting from klassOop
662 static instanceKlass* cast(klassOop k) {
663 Klass* kp = k->klass_part();
664 assert(kp->null_vtbl() || kp->oop_is_instance_slow(), "cast to instanceKlass");
665 return (instanceKlass*) kp;
666 }
667
668 // Sizing (in words)
669 static int header_size() { return align_object_offset(oopDesc::header_size() + sizeof(instanceKlass)/HeapWordSize); }
670 int object_size() const { return object_size(align_object_offset(vtable_length()) + align_object_offset(itable_length()) + static_field_size() + nonstatic_oop_map_size()); }
671 static int vtable_start_offset() { return header_size(); }
672 static int vtable_length_offset() { return oopDesc::header_size() + offset_of(instanceKlass, _vtable_len) / HeapWordSize; }
673 static int object_size(int extra) { return align_object_size(header_size() + extra); }
674
675 intptr_t* start_of_vtable() const { return ((intptr_t*)as_klassOop()) + vtable_start_offset(); }
676 intptr_t* start_of_itable() const { return start_of_vtable() + align_object_offset(vtable_length()); }
677 int itable_offset_in_words() const { return start_of_itable() - (intptr_t*)as_klassOop(); }
678
679 // Static field offset is an offset into the Heap, should be converted by
680 // based on UseCompressedOop for traversal
681 HeapWord* start_of_static_fields() const {
682 return (HeapWord*)(start_of_itable() + align_object_offset(itable_length()));
683 }
684
685 intptr_t* end_of_itable() const { return start_of_itable() + itable_length(); }
686
687 int offset_of_static_fields() const {
688 return (intptr_t)start_of_static_fields() - (intptr_t)as_klassOop();
689 }
690
691 OopMapBlock* start_of_nonstatic_oop_maps() const {
692 return (OopMapBlock*) (start_of_static_fields() + static_field_size());
693 }
694
695 // Allocation profiling support
696 juint alloc_size() const { return _alloc_count * size_helper(); }
697 void set_alloc_size(juint n) {}
698
699 // Use this to return the size of an instance in heap words:
700 int size_helper() const {
701 return layout_helper_to_size_helper(layout_helper());
702 }
703
704 // This bit is initialized in classFileParser.cpp.
705 // It is false under any of the following conditions:
706 // - the class is abstract (including any interface)
707 // - the class has a finalizer (if !RegisterFinalizersAtInit)
708 // - the class size is larger than FastAllocateSizeLimit
709 // - the class is java/lang/Class, which cannot be allocated directly
710 bool can_be_fastpath_allocated() const {
711 return !layout_helper_needs_slow_path(layout_helper());
712 }
713
714 // Java vtable/itable
715 klassVtable* vtable() const; // return new klassVtable wrapper
716 inline methodOop method_at_vtable(int index);
717 klassItable* itable() const; // return new klassItable wrapper
718 methodOop method_at_itable(klassOop holder, int index, TRAPS);
719
720 // Garbage collection
721 void oop_follow_contents(oop obj);
722 void follow_static_fields();
723 void adjust_static_fields();
724 int oop_adjust_pointers(oop obj);
725 bool object_is_parsable() const { return _init_state != unparsable_by_gc; }
726 // Value of _init_state must be zero (unparsable_by_gc) when klass field is set.
727
728 void follow_weak_klass_links(
729 BoolObjectClosure* is_alive, OopClosure* keep_alive);
730 void release_C_heap_structures();
731
732 // Parallel Scavenge and Parallel Old
733 PARALLEL_GC_DECLS
734
735 #ifndef SERIALGC
736 // Parallel Scavenge
737 void push_static_fields(PSPromotionManager* pm);
738
739 // Parallel Old
740 void follow_static_fields(ParCompactionManager* cm);
741 void copy_static_fields(ParCompactionManager* cm);
742 void update_static_fields();
743 #endif // SERIALGC
744
745 // Naming
746 const char* signature_name() const;
747
748 // Iterators
749 int oop_oop_iterate(oop obj, OopClosure* blk) {
750 return oop_oop_iterate_v(obj, blk);
751 }
752
753 int oop_oop_iterate_m(oop obj, OopClosure* blk, MemRegion mr) {
754 return oop_oop_iterate_v_m(obj, blk, mr);
755 }
756
757 #define InstanceKlass_OOP_OOP_ITERATE_DECL(OopClosureType, nv_suffix) \
758 int oop_oop_iterate##nv_suffix(oop obj, OopClosureType* blk); \
759 int oop_oop_iterate##nv_suffix##_m(oop obj, OopClosureType* blk, \
760 MemRegion mr);
761
762 ALL_OOP_OOP_ITERATE_CLOSURES_1(InstanceKlass_OOP_OOP_ITERATE_DECL)
763 ALL_OOP_OOP_ITERATE_CLOSURES_2(InstanceKlass_OOP_OOP_ITERATE_DECL)
764
765 #ifndef SERIALGC
766 #define InstanceKlass_OOP_OOP_ITERATE_BACKWARDS_DECL(OopClosureType, nv_suffix) \
767 int oop_oop_iterate_backwards##nv_suffix(oop obj, OopClosureType* blk);
768
769 ALL_OOP_OOP_ITERATE_CLOSURES_1(InstanceKlass_OOP_OOP_ITERATE_BACKWARDS_DECL)
770 ALL_OOP_OOP_ITERATE_CLOSURES_2(InstanceKlass_OOP_OOP_ITERATE_BACKWARDS_DECL)
771 #endif // !SERIALGC
772
773 void iterate_static_fields(OopClosure* closure);
774 void iterate_static_fields(OopClosure* closure, MemRegion mr);
775
776 private:
777 // initialization state
778 #ifdef ASSERT
779 void set_init_state(ClassState state);
780 #else
781 void set_init_state(ClassState state) { _init_state = state; }
782 #endif
783 void set_rewritten() { _rewritten = true; }
784 void set_init_thread(Thread *thread) { _init_thread = thread; }
785
786 u2 idnum_allocated_count() const { return _idnum_allocated_count; }
787 // The RedefineClasses() API can cause new method idnums to be needed
788 // which will cause the caches to grow. Safety requires different
789 // cache management logic if the caches can grow instead of just
790 // going from NULL to non-NULL.
791 bool idnum_can_increment() const { return has_been_redefined(); }
792 jmethodID* methods_jmethod_ids_acquire() const
793 { return (jmethodID*)OrderAccess::load_ptr_acquire(&_methods_jmethod_ids); }
794 void release_set_methods_jmethod_ids(jmethodID* jmeths)
795 { OrderAccess::release_store_ptr(&_methods_jmethod_ids, jmeths); }
909 class JNIid: public CHeapObj {
910 friend class VMStructs;
911 private:
912 klassOop _holder;
913 JNIid* _next;
914 int _offset;
915 #ifdef ASSERT
916 bool _is_static_field_id;
917 #endif
918
919 public:
920 // Accessors
921 klassOop holder() const { return _holder; }
922 int offset() const { return _offset; }
923 JNIid* next() { return _next; }
924 // Constructor
925 JNIid(klassOop holder, int offset, JNIid* next);
926 // Identifier lookup
927 JNIid* find(int offset);
928
929 // Garbage collection support
930 oop* holder_addr() { return (oop*)&_holder; }
931 void oops_do(OopClosure* f);
932 static void deallocate(JNIid* id);
933 // Debugging
934 #ifdef ASSERT
935 bool is_static_field_id() const { return _is_static_field_id; }
936 void set_is_static_field_id() { _is_static_field_id = true; }
937 #endif
938 void verify(klassOop holder);
939 };
940
941
942 // If breakpoints are more numerous than just JVMTI breakpoints,
943 // consider compressing this data structure.
944 // It is currently a simple linked list defined in methodOop.hpp.
945
946 class BreakpointInfo;
947
948
|
58 // [number of implementors ]
59 // [implementors ] klassOop[2]
60 // [fields ]
61 // [constants ]
62 // [class loader ]
63 // [protection domain ]
64 // [signers ]
65 // [source file name ]
66 // [inner classes ]
67 // [static field size ]
68 // [nonstatic field size ]
69 // [static oop fields size ]
70 // [nonstatic oop maps size ]
71 // [has finalize method ]
72 // [deoptimization mark bit ]
73 // [initialization state ]
74 // [initializing thread ]
75 // [Java vtable length ]
76 // [oop map cache (stack maps) ]
77 // [EMBEDDED Java vtable ] size in words = vtable_len
78 // [EMBEDDED nonstatic oop-map blocks] size in words = nonstatic_oop_map_size
79 //
80 // The embedded nonstatic oop-map blocks are short pairs (offset, length) indicating
81 // where oops are located in instances of this klass.
82
83
84 // forward declaration for class -- see below for definition
85 class SuperTypeClosure;
86 class JNIid;
87 class jniIdMapBase;
88 class BreakpointInfo;
89 class fieldDescriptor;
90 class DepChange;
91 class nmethodBucket;
92 class PreviousVersionNode;
93 class JvmtiCachedClassFieldMap;
94
95 // This is used in iterators below.
96 class FieldClosure: public StackObj {
97 public:
211 objArrayOop _methods_default_annotations;
212
213 //
214 // End of the oop block.
215 //
216
217 // Name of source file containing this klass, NULL if not specified.
218 Symbol* _source_file_name;
219 // the source debug extension for this klass, NULL if not specified.
220 Symbol* _source_debug_extension;
221 // Generic signature, or null if none.
222 Symbol* _generic_signature;
223 // Array name derived from this class which needs unreferencing
224 // if this class is unloaded.
225 Symbol* _array_name;
226
227 // Number of heapOopSize words used by non-static fields in this klass
228 // (including inherited fields but after header_size()).
229 int _nonstatic_field_size;
230 int _static_field_size; // number words used by static fields (oop and non-oop) in this klass
231 int _static_oop_field_count;// number of static oop fields in this klass
232 int _nonstatic_oop_map_size;// size in words of nonstatic oop map blocks
233 bool _is_marked_dependent; // used for marking during flushing and deoptimization
234 bool _rewritten; // methods rewritten.
235 bool _has_nonstatic_fields; // for sizing with UseCompressedOops
236 bool _should_verify_class; // allow caching of preverification
237 u2 _minor_version; // minor version number of class file
238 u2 _major_version; // major version number of class file
239 ClassState _init_state; // state of class
240 Thread* _init_thread; // Pointer to current thread doing initialization (to handle recusive initialization)
241 int _vtable_len; // length of Java vtable (in words)
242 int _itable_len; // length of Java itable (in words)
243 ReferenceType _reference_type; // reference type
244 OopMapCache* volatile _oop_map_cache; // OopMapCache for all methods in the klass (allocated lazily)
245 JNIid* _jni_ids; // First JNI identifier for static fields in this class
246 jmethodID* _methods_jmethod_ids; // jmethodIDs corresponding to method_idnum, or NULL if none
247 int* _methods_cached_itable_indices; // itable_index cache for JNI invoke corresponding to methods idnum, or NULL
248 nmethodBucket* _dependencies; // list of dependent nmethods
249 nmethod* _osr_nmethods_head; // Head of list of on-stack replacement nmethods for this class
250 BreakpointInfo* _breakpoints; // bpt lists, managed by methodOop
251 int _nof_implementors; // No of implementors of this interface (zero if not an interface)
262
263 // embedded Java vtable follows here
264 // embedded Java itables follows here
265 // embedded static fields follows here
266 // embedded nonstatic oop-map blocks follows here
267
268 friend class instanceKlassKlass;
269 friend class SystemDictionary;
270
271 public:
272 bool has_nonstatic_fields() const { return _has_nonstatic_fields; }
273 void set_has_nonstatic_fields(bool b) { _has_nonstatic_fields = b; }
274
275 // field sizes
276 int nonstatic_field_size() const { return _nonstatic_field_size; }
277 void set_nonstatic_field_size(int size) { _nonstatic_field_size = size; }
278
279 int static_field_size() const { return _static_field_size; }
280 void set_static_field_size(int size) { _static_field_size = size; }
281
282 int static_oop_field_count() const { return _static_oop_field_count; }
283 void set_static_oop_field_count(int size) { _static_oop_field_count = size; }
284
285 // Java vtable
286 int vtable_length() const { return _vtable_len; }
287 void set_vtable_length(int len) { _vtable_len = len; }
288
289 // Java itable
290 int itable_length() const { return _itable_len; }
291 void set_itable_length(int len) { _itable_len = len; }
292
293 // array klasses
294 klassOop array_klasses() const { return _array_klasses; }
295 void set_array_klasses(klassOop k) { oop_store_without_check((oop*) &_array_klasses, (oop) k); }
296
297 // methods
298 objArrayOop methods() const { return _methods; }
299 void set_methods(objArrayOop a) { oop_store_without_check((oop*) &_methods, (oop) a); }
300 methodOop method_with_idnum(int idnum);
301
302 // method ordering
303 typeArrayOop method_ordering() const { return _method_ordering; }
641 objArrayOop compute_secondary_supers(int num_extra_slots, TRAPS);
642 bool compute_is_subtype_of(klassOop k);
643 bool can_be_primary_super_slow() const;
644 klassOop java_super() const { return super(); }
645 int oop_size(oop obj) const { return size_helper(); }
646 int klass_oop_size() const { return object_size(); }
647 bool oop_is_instance_slow() const { return true; }
648
649 // Iterators
650 void do_local_static_fields(FieldClosure* cl);
651 void do_nonstatic_fields(FieldClosure* cl); // including inherited fields
652 void do_local_static_fields(void f(fieldDescriptor*, TRAPS), TRAPS);
653
654 void methods_do(void f(methodOop method));
655 void array_klasses_do(void f(klassOop k));
656 void with_array_klasses_do(void f(klassOop k));
657 bool super_types_do(SuperTypeClosure* blk);
658
659 // Casting from klassOop
660 static instanceKlass* cast(klassOop k) {
661 assert(k->is_klass(), "must be");
662 Klass* kp = k->klass_part();
663 assert(kp->null_vtbl() || kp->oop_is_instance_slow(), "cast to instanceKlass");
664 return (instanceKlass*) kp;
665 }
666
667 // Sizing (in words)
668 static int header_size() { return align_object_offset(oopDesc::header_size() + sizeof(instanceKlass)/HeapWordSize); }
669 int object_size() const { return object_size(align_object_offset(vtable_length()) + align_object_offset(itable_length()) + nonstatic_oop_map_size()); }
670 static int vtable_start_offset() { return header_size(); }
671 static int vtable_length_offset() { return oopDesc::header_size() + offset_of(instanceKlass, _vtable_len) / HeapWordSize; }
672 static int object_size(int extra) { return align_object_size(header_size() + extra); }
673
674 intptr_t* start_of_vtable() const { return ((intptr_t*)as_klassOop()) + vtable_start_offset(); }
675 intptr_t* start_of_itable() const { return start_of_vtable() + align_object_offset(vtable_length()); }
676 int itable_offset_in_words() const { return start_of_itable() - (intptr_t*)as_klassOop(); }
677
678 intptr_t* end_of_itable() const { return start_of_itable() + itable_length(); }
679
680 address static_field_addr(int offset);
681
682 OopMapBlock* start_of_nonstatic_oop_maps() const {
683 return (OopMapBlock*)(start_of_itable() + align_object_offset(itable_length()));
684 }
685
686 // Allocation profiling support
687 juint alloc_size() const { return _alloc_count * size_helper(); }
688 void set_alloc_size(juint n) {}
689
690 // Use this to return the size of an instance in heap words:
691 int size_helper() const {
692 return layout_helper_to_size_helper(layout_helper());
693 }
694
695 // This bit is initialized in classFileParser.cpp.
696 // It is false under any of the following conditions:
697 // - the class is abstract (including any interface)
698 // - the class has a finalizer (if !RegisterFinalizersAtInit)
699 // - the class size is larger than FastAllocateSizeLimit
700 // - the class is java/lang/Class, which cannot be allocated directly
701 bool can_be_fastpath_allocated() const {
702 return !layout_helper_needs_slow_path(layout_helper());
703 }
704
705 // Java vtable/itable
706 klassVtable* vtable() const; // return new klassVtable wrapper
707 inline methodOop method_at_vtable(int index);
708 klassItable* itable() const; // return new klassItable wrapper
709 methodOop method_at_itable(klassOop holder, int index, TRAPS);
710
711 // Garbage collection
712 void oop_follow_contents(oop obj);
713 int oop_adjust_pointers(oop obj);
714 bool object_is_parsable() const { return _init_state != unparsable_by_gc; }
715 // Value of _init_state must be zero (unparsable_by_gc) when klass field is set.
716
717 void follow_weak_klass_links(
718 BoolObjectClosure* is_alive, OopClosure* keep_alive);
719 void release_C_heap_structures();
720
721 // Parallel Scavenge and Parallel Old
722 PARALLEL_GC_DECLS
723
724 // Naming
725 const char* signature_name() const;
726
727 // Iterators
728 int oop_oop_iterate(oop obj, OopClosure* blk) {
729 return oop_oop_iterate_v(obj, blk);
730 }
731
732 int oop_oop_iterate_m(oop obj, OopClosure* blk, MemRegion mr) {
733 return oop_oop_iterate_v_m(obj, blk, mr);
734 }
735
736 #define InstanceKlass_OOP_OOP_ITERATE_DECL(OopClosureType, nv_suffix) \
737 int oop_oop_iterate##nv_suffix(oop obj, OopClosureType* blk); \
738 int oop_oop_iterate##nv_suffix##_m(oop obj, OopClosureType* blk, \
739 MemRegion mr);
740
741 ALL_OOP_OOP_ITERATE_CLOSURES_1(InstanceKlass_OOP_OOP_ITERATE_DECL)
742 ALL_OOP_OOP_ITERATE_CLOSURES_2(InstanceKlass_OOP_OOP_ITERATE_DECL)
743
744 #ifndef SERIALGC
745 #define InstanceKlass_OOP_OOP_ITERATE_BACKWARDS_DECL(OopClosureType, nv_suffix) \
746 int oop_oop_iterate_backwards##nv_suffix(oop obj, OopClosureType* blk);
747
748 ALL_OOP_OOP_ITERATE_CLOSURES_1(InstanceKlass_OOP_OOP_ITERATE_BACKWARDS_DECL)
749 ALL_OOP_OOP_ITERATE_CLOSURES_2(InstanceKlass_OOP_OOP_ITERATE_BACKWARDS_DECL)
750 #endif // !SERIALGC
751
752 private:
753 // initialization state
754 #ifdef ASSERT
755 void set_init_state(ClassState state);
756 #else
757 void set_init_state(ClassState state) { _init_state = state; }
758 #endif
759 void set_rewritten() { _rewritten = true; }
760 void set_init_thread(Thread *thread) { _init_thread = thread; }
761
762 u2 idnum_allocated_count() const { return _idnum_allocated_count; }
763 // The RedefineClasses() API can cause new method idnums to be needed
764 // which will cause the caches to grow. Safety requires different
765 // cache management logic if the caches can grow instead of just
766 // going from NULL to non-NULL.
767 bool idnum_can_increment() const { return has_been_redefined(); }
768 jmethodID* methods_jmethod_ids_acquire() const
769 { return (jmethodID*)OrderAccess::load_ptr_acquire(&_methods_jmethod_ids); }
770 void release_set_methods_jmethod_ids(jmethodID* jmeths)
771 { OrderAccess::release_store_ptr(&_methods_jmethod_ids, jmeths); }
885 class JNIid: public CHeapObj {
886 friend class VMStructs;
887 private:
888 klassOop _holder;
889 JNIid* _next;
890 int _offset;
891 #ifdef ASSERT
892 bool _is_static_field_id;
893 #endif
894
895 public:
896 // Accessors
897 klassOop holder() const { return _holder; }
898 int offset() const { return _offset; }
899 JNIid* next() { return _next; }
900 // Constructor
901 JNIid(klassOop holder, int offset, JNIid* next);
902 // Identifier lookup
903 JNIid* find(int offset);
904
905 bool find_local_field(fieldDescriptor* fd) {
906 return instanceKlass::cast(holder())->find_local_field_from_offset(offset(), true, fd);
907 }
908
909 // Garbage collection support
910 oop* holder_addr() { return (oop*)&_holder; }
911 void oops_do(OopClosure* f);
912 static void deallocate(JNIid* id);
913 // Debugging
914 #ifdef ASSERT
915 bool is_static_field_id() const { return _is_static_field_id; }
916 void set_is_static_field_id() { _is_static_field_id = true; }
917 #endif
918 void verify(klassOop holder);
919 };
920
921
922 // If breakpoints are more numerous than just JVMTI breakpoints,
923 // consider compressing this data structure.
924 // It is currently a simple linked list defined in methodOop.hpp.
925
926 class BreakpointInfo;
927
928
|