160 static inline narrowOop encode_heap_oop_not_null(oop v); |
156 static inline narrowOop encode_heap_oop_not_null(oop v); |
161 static inline narrowOop encode_heap_oop(oop v); |
157 static inline narrowOop encode_heap_oop(oop v); |
162 |
158 |
163 // Load an oop out of the Java heap as is without decoding. |
159 // Load an oop out of the Java heap as is without decoding. |
164 // Called by GC to check for null before decoding. |
160 // Called by GC to check for null before decoding. |
165 static inline narrowOop load_heap_oop(narrowOop* p) { return *p; } |
161 static inline narrowOop load_heap_oop(narrowOop* p); |
166 static inline oop load_heap_oop(oop* p) { return *p; } |
162 static inline oop load_heap_oop(oop* p); |
167 |
163 |
168 // Load an oop out of Java heap and decode it to an uncompressed oop. |
164 // Load an oop out of Java heap and decode it to an uncompressed oop. |
169 static inline oop load_decode_heap_oop_not_null(narrowOop* p); |
165 static inline oop load_decode_heap_oop_not_null(narrowOop* p); |
170 static inline oop load_decode_heap_oop_not_null(oop* p) { return *p; } |
166 static inline oop load_decode_heap_oop_not_null(oop* p); |
171 static inline oop load_decode_heap_oop(narrowOop* p); |
167 static inline oop load_decode_heap_oop(narrowOop* p); |
172 static inline oop load_decode_heap_oop(oop* p) { return *p; } |
168 static inline oop load_decode_heap_oop(oop* p); |
173 |
169 |
174 // Store already encoded heap oop into the heap. |
170 // Store already encoded heap oop into the heap. |
175 static inline void store_heap_oop(narrowOop* p, narrowOop v) { *p = v; } |
171 static inline void store_heap_oop(narrowOop* p, narrowOop v); |
176 static inline void store_heap_oop(oop* p, oop v) { *p = v; } |
172 static inline void store_heap_oop(oop* p, oop v); |
177 |
173 |
178 // Encode oop if UseCompressedOops and store into the heap. |
174 // Encode oop if UseCompressedOops and store into the heap. |
179 static inline void encode_store_heap_oop_not_null(narrowOop* p, oop v); |
175 static inline void encode_store_heap_oop_not_null(narrowOop* p, oop v); |
180 static inline void encode_store_heap_oop_not_null(oop* p, oop v) { *p = v; } |
176 static inline void encode_store_heap_oop_not_null(oop* p, oop v); |
181 static inline void encode_store_heap_oop(narrowOop* p, oop v); |
177 static inline void encode_store_heap_oop(narrowOop* p, oop v); |
182 static inline void encode_store_heap_oop(oop* p, oop v) { *p = v; } |
178 static inline void encode_store_heap_oop(oop* p, oop v); |
183 |
|
184 static inline void release_store_heap_oop(volatile narrowOop* p, narrowOop v); |
|
185 static inline void release_store_heap_oop(volatile oop* p, oop v); |
|
186 |
|
187 static inline void release_encode_store_heap_oop_not_null(volatile narrowOop* p, oop v); |
|
188 static inline void release_encode_store_heap_oop_not_null(volatile oop* p, oop v); |
|
189 static inline void release_encode_store_heap_oop(volatile narrowOop* p, oop v); |
|
190 static inline void release_encode_store_heap_oop(volatile oop* p, oop v); |
|
191 |
|
192 static inline oop atomic_exchange_oop(oop exchange_value, volatile HeapWord *dest); |
|
193 static inline oop atomic_compare_exchange_oop(oop exchange_value, |
|
194 volatile HeapWord *dest, |
|
195 oop compare_value, |
|
196 bool prebarrier = false); |
|
197 |
179 |
198 // Access to fields in a instanceOop through these methods. |
180 // Access to fields in a instanceOop through these methods. |
199 inline oop obj_field(int offset) const; |
181 oop obj_field(int offset) const; |
200 inline void obj_field_put(int offset, oop value); |
182 void obj_field_put(int offset, oop value); |
201 inline void obj_field_put_raw(int offset, oop value); |
183 void obj_field_put_raw(int offset, oop value); |
202 inline void obj_field_put_volatile(int offset, oop value); |
184 void obj_field_put_volatile(int offset, oop value); |
203 |
185 |
204 inline Metadata* metadata_field(int offset) const; |
186 Metadata* metadata_field(int offset) const; |
205 inline void metadata_field_put(int offset, Metadata* value); |
187 void metadata_field_put(int offset, Metadata* value); |
206 |
188 |
207 inline Metadata* metadata_field_acquire(int offset) const; |
189 Metadata* metadata_field_acquire(int offset) const; |
208 inline void release_metadata_field_put(int offset, Metadata* value); |
190 void release_metadata_field_put(int offset, Metadata* value); |
209 |
191 |
210 inline jbyte byte_field(int offset) const; |
192 jbyte byte_field(int offset) const; |
211 inline void byte_field_put(int offset, jbyte contents); |
193 void byte_field_put(int offset, jbyte contents); |
212 |
194 |
213 inline jchar char_field(int offset) const; |
195 jchar char_field(int offset) const; |
214 inline void char_field_put(int offset, jchar contents); |
196 void char_field_put(int offset, jchar contents); |
215 |
197 |
216 inline jboolean bool_field(int offset) const; |
198 jboolean bool_field(int offset) const; |
217 inline void bool_field_put(int offset, jboolean contents); |
199 void bool_field_put(int offset, jboolean contents); |
218 |
200 |
219 inline jint int_field(int offset) const; |
201 jint int_field(int offset) const; |
220 inline void int_field_put(int offset, jint contents); |
202 void int_field_put(int offset, jint contents); |
221 |
203 |
222 inline jshort short_field(int offset) const; |
204 jshort short_field(int offset) const; |
223 inline void short_field_put(int offset, jshort contents); |
205 void short_field_put(int offset, jshort contents); |
224 |
206 |
225 inline jlong long_field(int offset) const; |
207 jlong long_field(int offset) const; |
226 inline void long_field_put(int offset, jlong contents); |
208 void long_field_put(int offset, jlong contents); |
227 |
209 |
228 inline jfloat float_field(int offset) const; |
210 jfloat float_field(int offset) const; |
229 inline void float_field_put(int offset, jfloat contents); |
211 void float_field_put(int offset, jfloat contents); |
230 |
212 |
231 inline jdouble double_field(int offset) const; |
213 jdouble double_field(int offset) const; |
232 inline void double_field_put(int offset, jdouble contents); |
214 void double_field_put(int offset, jdouble contents); |
233 |
215 |
234 inline address address_field(int offset) const; |
216 address address_field(int offset) const; |
235 inline void address_field_put(int offset, address contents); |
217 void address_field_put(int offset, address contents); |
236 |
218 |
237 inline oop obj_field_acquire(int offset) const; |
219 oop obj_field_acquire(int offset) const; |
238 inline void release_obj_field_put(int offset, oop value); |
220 void release_obj_field_put(int offset, oop value); |
239 |
221 |
240 inline jbyte byte_field_acquire(int offset) const; |
222 jbyte byte_field_acquire(int offset) const; |
241 inline void release_byte_field_put(int offset, jbyte contents); |
223 void release_byte_field_put(int offset, jbyte contents); |
242 |
224 |
243 inline jchar char_field_acquire(int offset) const; |
225 jchar char_field_acquire(int offset) const; |
244 inline void release_char_field_put(int offset, jchar contents); |
226 void release_char_field_put(int offset, jchar contents); |
245 |
227 |
246 inline jboolean bool_field_acquire(int offset) const; |
228 jboolean bool_field_acquire(int offset) const; |
247 inline void release_bool_field_put(int offset, jboolean contents); |
229 void release_bool_field_put(int offset, jboolean contents); |
248 |
230 |
249 inline jint int_field_acquire(int offset) const; |
231 jint int_field_acquire(int offset) const; |
250 inline void release_int_field_put(int offset, jint contents); |
232 void release_int_field_put(int offset, jint contents); |
251 |
233 |
252 inline jshort short_field_acquire(int offset) const; |
234 jshort short_field_acquire(int offset) const; |
253 inline void release_short_field_put(int offset, jshort contents); |
235 void release_short_field_put(int offset, jshort contents); |
254 |
236 |
255 inline jlong long_field_acquire(int offset) const; |
237 jlong long_field_acquire(int offset) const; |
256 inline void release_long_field_put(int offset, jlong contents); |
238 void release_long_field_put(int offset, jlong contents); |
257 |
239 |
258 inline jfloat float_field_acquire(int offset) const; |
240 jfloat float_field_acquire(int offset) const; |
259 inline void release_float_field_put(int offset, jfloat contents); |
241 void release_float_field_put(int offset, jfloat contents); |
260 |
242 |
261 inline jdouble double_field_acquire(int offset) const; |
243 jdouble double_field_acquire(int offset) const; |
262 inline void release_double_field_put(int offset, jdouble contents); |
244 void release_double_field_put(int offset, jdouble contents); |
263 |
245 |
264 inline address address_field_acquire(int offset) const; |
246 address address_field_acquire(int offset) const; |
265 inline void release_address_field_put(int offset, address contents); |
247 void release_address_field_put(int offset, address contents); |
266 |
248 |
267 // printing functions for VM debugging |
249 // printing functions for VM debugging |
268 void print_on(outputStream* st) const; // First level print |
250 void print_on(outputStream* st) const; // First level print |
269 void print_value_on(outputStream* st) const; // Second level print. |
251 void print_value_on(outputStream* st) const; // Second level print. |
270 void print_address_on(outputStream* st) const; // Address printing |
252 void print_address_on(outputStream* st) const; // Address printing |