346 inline jdouble oopDesc::double_field(int offset) const { return HeapAccess<>::load_at(as_oop(), offset); } 347 inline void oopDesc::double_field_put(int offset, jdouble value) { HeapAccess<>::store_at(as_oop(), offset, value); } 348 349 bool oopDesc::is_locked() const { 350 return mark()->is_locked(); 351 } 352 353 bool oopDesc::is_unlocked() const { 354 return mark()->is_unlocked(); 355 } 356 357 bool oopDesc::has_bias_pattern() const { 358 return mark()->has_bias_pattern(); 359 } 360 361 // Used only for markSweep, scavenging 362 bool oopDesc::is_gc_marked() const { 363 return mark()->is_marked(); 364 } 365 366 bool oopDesc::is_scavengable() const { 367 return Universe::heap()->is_scavengable(oop(const_cast<oopDesc*>(this))); 368 } 369 370 // Used by scavengers 371 bool oopDesc::is_forwarded() const { 372 // The extra heap check is needed since the obj might be locked, in which case the 373 // mark would point to a stack location and have the sentinel bit cleared 374 return mark()->is_marked(); 375 } 376 377 // Used by scavengers 378 void oopDesc::forward_to(oop p) { 379 assert(check_obj_alignment(p), 380 "forwarding to something not aligned"); 381 assert(Universe::heap()->is_in_reserved(p), 382 "forwarding to something not in heap"); 383 assert(!is_archive_object(oop(this)) && 384 !is_archive_object(p), 385 "forwarding archive object"); 386 markOop m = markOopDesc::encode_pointer_as_mark(p); 387 assert(m->decode_pointer() == p, "encoding must be reversable"); 388 set_mark(m); 389 } | 346 inline jdouble oopDesc::double_field(int offset) const { return HeapAccess<>::load_at(as_oop(), offset); } 347 inline void oopDesc::double_field_put(int offset, jdouble value) { HeapAccess<>::store_at(as_oop(), offset, value); } 348 349 bool oopDesc::is_locked() const { 350 return mark()->is_locked(); 351 } 352 353 bool oopDesc::is_unlocked() const { 354 return mark()->is_unlocked(); 355 } 356 357 bool oopDesc::has_bias_pattern() const { 358 return mark()->has_bias_pattern(); 359 } 360 361 // Used only for markSweep, scavenging 362 bool oopDesc::is_gc_marked() const { 363 return mark()->is_marked(); 364 } 365 366 // Used by scavengers 367 bool oopDesc::is_forwarded() const { 368 // The extra heap check is needed since the obj might be locked, in which case the 369 // mark would point to a stack location and have the sentinel bit cleared 370 return mark()->is_marked(); 371 } 372 373 // Used by scavengers 374 void oopDesc::forward_to(oop p) { 375 assert(check_obj_alignment(p), 376 "forwarding to something not aligned"); 377 assert(Universe::heap()->is_in_reserved(p), 378 "forwarding to something not in heap"); 379 assert(!is_archive_object(oop(this)) && 380 !is_archive_object(p), 381 "forwarding archive object"); 382 markOop m = markOopDesc::encode_pointer_as_mark(p); 383 assert(m->decode_pointer() == p, "encoding must be reversable"); 384 set_mark(m); 385 } |