118
119 inline void oopDesc::set_klass_gap(int v) {
120 if (UseCompressedKlassPointers) {
121 *(int*)(((intptr_t)this) + klass_gap_offset_in_bytes()) = v;
122 }
123 }
124
125 inline void oopDesc::set_klass_to_list_ptr(oop k) {
126 // This is only to be used during GC, for from-space objects, so no
127 // barrier is needed.
128 if (UseCompressedKlassPointers) {
129 _metadata._compressed_klass = encode_heap_oop(k); // may be null (parnew overflow handling)
130 } else {
131 _metadata._klass = (Klass*)(address)k;
132 }
133 }
134
135 inline oop oopDesc::list_ptr_from_klass() {
136 // This is only to be used during GC, for from-space objects.
137 if (UseCompressedKlassPointers) {
138 return (oop)decode_heap_oop((oop)(address)_metadata._compressed_klass);
139 } else {
140 // Special case for GC
141 return (oop)(address)_metadata._klass;
142 }
143 }
144
145 inline void oopDesc::init_mark() { set_mark(markOopDesc::prototype_for_object(this)); }
146
147 inline bool oopDesc::is_a(Klass* k) const { return klass()->is_subtype_of(k); }
148
149 inline bool oopDesc::is_instance() const { return klass()->oop_is_instance(); }
150 inline bool oopDesc::is_instanceMirror() const { return klass()->oop_is_instanceMirror(); }
151 inline bool oopDesc::is_instanceRef() const { return klass()->oop_is_instanceRef(); }
152 inline bool oopDesc::is_array() const { return klass()->oop_is_array(); }
153 inline bool oopDesc::is_objArray() const { return klass()->oop_is_objArray(); }
154 inline bool oopDesc::is_typeArray() const { return klass()->oop_is_typeArray(); }
155
156 inline void* oopDesc::field_base(int offset) const { return (void*)&((char*)this)[offset]; }
157
158 template <class T> inline T* oopDesc::obj_field_addr(int offset) const { return (T*)field_base(offset); }
|
118
119 inline void oopDesc::set_klass_gap(int v) {
120 if (UseCompressedKlassPointers) {
121 *(int*)(((intptr_t)this) + klass_gap_offset_in_bytes()) = v;
122 }
123 }
124
125 inline void oopDesc::set_klass_to_list_ptr(oop k) {
126 // This is only to be used during GC, for from-space objects, so no
127 // barrier is needed.
128 if (UseCompressedKlassPointers) {
129 _metadata._compressed_klass = encode_heap_oop(k); // may be null (parnew overflow handling)
130 } else {
131 _metadata._klass = (Klass*)(address)k;
132 }
133 }
134
135 inline oop oopDesc::list_ptr_from_klass() {
136 // This is only to be used during GC, for from-space objects.
137 if (UseCompressedKlassPointers) {
138 return decode_heap_oop(_metadata._compressed_klass);
139 } else {
140 // Special case for GC
141 return (oop)(address)_metadata._klass;
142 }
143 }
144
145 inline void oopDesc::init_mark() { set_mark(markOopDesc::prototype_for_object(this)); }
146
147 inline bool oopDesc::is_a(Klass* k) const { return klass()->is_subtype_of(k); }
148
149 inline bool oopDesc::is_instance() const { return klass()->oop_is_instance(); }
150 inline bool oopDesc::is_instanceMirror() const { return klass()->oop_is_instanceMirror(); }
151 inline bool oopDesc::is_instanceRef() const { return klass()->oop_is_instanceRef(); }
152 inline bool oopDesc::is_array() const { return klass()->oop_is_array(); }
153 inline bool oopDesc::is_objArray() const { return klass()->oop_is_objArray(); }
154 inline bool oopDesc::is_typeArray() const { return klass()->oop_is_typeArray(); }
155
156 inline void* oopDesc::field_base(int offset) const { return (void*)&((char*)this)[offset]; }
157
158 template <class T> inline T* oopDesc::obj_field_addr(int offset) const { return (T*)field_base(offset); }
|