65 66 // Static field offset is an offset into the Heap, should be converted by 67 // based on UseCompressedOop for traversal 68 static HeapWord* start_of_static_fields(oop obj) { 69 return (HeapWord*)(cast_from_oop<intptr_t>(obj) + offset_of_static_fields()); 70 } 71 72 static void init_offset_of_static_fields() { 73 // Cache the offset of the static fields in the Class instance 74 assert(_offset_of_static_fields == 0, "once"); 75 _offset_of_static_fields = InstanceMirrorKlass::cast(SystemDictionary::Class_klass())->size_helper() << LogHeapWordSize; 76 } 77 78 static int offset_of_static_fields() { 79 return _offset_of_static_fields; 80 } 81 82 int compute_static_oop_field_count(oop obj); 83 84 // Given a Klass return the size of the instance 85 int instance_size(KlassHandle k); 86 87 // allocation 88 instanceOop allocate_instance(KlassHandle k, TRAPS); 89 90 // GC specific object visitors 91 // 92 // Mark Sweep 93 int oop_ms_adjust_pointers(oop obj); 94 #if INCLUDE_ALL_GCS 95 // Parallel Scavenge 96 void oop_ps_push_contents( oop obj, PSPromotionManager* pm); 97 // Parallel Compact 98 void oop_pc_follow_contents(oop obj, ParCompactionManager* cm); 99 void oop_pc_update_pointers(oop obj, ParCompactionManager* cm); 100 #endif 101 102 // Oop fields (and metadata) iterators 103 // [nv = true] Use non-virtual calls to do_oop_nv. 104 // [nv = false] Use virtual calls to do_oop. 105 // 106 // The InstanceMirrorKlass iterators also visit the hidden Klass pointer. 107 108 public: | 65 66 // Static field offset is an offset into the Heap, should be converted by 67 // based on UseCompressedOop for traversal 68 static HeapWord* start_of_static_fields(oop obj) { 69 return (HeapWord*)(cast_from_oop<intptr_t>(obj) + offset_of_static_fields()); 70 } 71 72 static void init_offset_of_static_fields() { 73 // Cache the offset of the static fields in the Class instance 74 assert(_offset_of_static_fields == 0, "once"); 75 _offset_of_static_fields = InstanceMirrorKlass::cast(SystemDictionary::Class_klass())->size_helper() << LogHeapWordSize; 76 } 77 78 static int offset_of_static_fields() { 79 return _offset_of_static_fields; 80 } 81 82 int compute_static_oop_field_count(oop obj); 83 84 // Given a Klass return the size of the instance 85 int instance_size(Klass* k); 86 87 // allocation 88 instanceOop allocate_instance(Klass* k, TRAPS); 89 90 // GC specific object visitors 91 // 92 // Mark Sweep 93 int oop_ms_adjust_pointers(oop obj); 94 #if INCLUDE_ALL_GCS 95 // Parallel Scavenge 96 void oop_ps_push_contents( oop obj, PSPromotionManager* pm); 97 // Parallel Compact 98 void oop_pc_follow_contents(oop obj, ParCompactionManager* cm); 99 void oop_pc_update_pointers(oop obj, ParCompactionManager* cm); 100 #endif 101 102 // Oop fields (and metadata) iterators 103 // [nv = true] Use non-virtual calls to do_oop_nv. 104 // [nv = false] Use virtual calls to do_oop. 105 // 106 // The InstanceMirrorKlass iterators also visit the hidden Klass pointer. 107 108 public: |