< prev index next >

src/share/vm/oops/oop.inline.hpp

Print this page
rev 11777 : [mq]: gcinterface.patch

*** 246,256 **** // is_objArray() && is_forwarded() // covers first scenario above // || is_typeArray() // covers second scenario above // If and when UseParallelGC uses the same obj array oop stealing/chunking // technique, we will need to suitably modify the assertion. assert((s == klass->oop_size(this)) || ! (Universe::heap()->is_gc_active() && ((is_typeArray() && UseConcMarkSweepGC) || (is_objArray() && is_forwarded() && (UseConcMarkSweepGC || UseParallelGC || UseG1GC)))), "wrong array object size"); } else { // Must be zero, so bite the bullet and take the virtual call. --- 246,256 ---- // is_objArray() && is_forwarded() // covers first scenario above // || is_typeArray() // covers second scenario above // If and when UseParallelGC uses the same obj array oop stealing/chunking // technique, we will need to suitably modify the assertion. assert((s == klass->oop_size(this)) || ! (GC::gc()->heap()->is_gc_active() && ((is_typeArray() && UseConcMarkSweepGC) || (is_objArray() && is_forwarded() && (UseConcMarkSweepGC || UseParallelGC || UseG1GC)))), "wrong array object size"); } else { // Must be zero, so bite the bullet and take the virtual call.
*** 312,322 **** } narrowOop oopDesc::encode_heap_oop_not_null(oop v) { assert(!is_null(v), "oop value can never be zero"); assert(check_obj_alignment(v), "Address not aligned"); ! assert(Universe::heap()->is_in_reserved(v), "Address not in heap"); address base = Universe::narrow_oop_base(); int shift = Universe::narrow_oop_shift(); uint64_t pd = (uint64_t)(pointer_delta((void*)v, (void*)base, 1)); assert(OopEncodingHeapMax > pd, "change encoding max if new encoding"); uint64_t result = pd >> shift; --- 312,322 ---- } narrowOop oopDesc::encode_heap_oop_not_null(oop v) { assert(!is_null(v), "oop value can never be zero"); assert(check_obj_alignment(v), "Address not aligned"); ! assert(GC::gc()->heap()->is_in_reserved(v), "Address not in heap"); address base = Universe::narrow_oop_base(); int shift = Universe::narrow_oop_shift(); uint64_t pd = (uint64_t)(pointer_delta((void*)v, (void*)base, 1)); assert(OopEncodingHeapMax > pd, "change encoding max if new encoding"); uint64_t result = pd >> shift;
*** 517,529 **** // used only for asserts bool oopDesc::is_oop(bool ignore_mark_word) const { oop obj = (oop) this; if (!check_obj_alignment(obj)) return false; ! if (!Universe::heap()->is_in_reserved(obj)) return false; // obj is aligned and accessible in heap ! if (Universe::heap()->is_in_reserved(obj->klass_or_null())) return false; // Header verification: the mark is typically non-NULL. If we're // at a safepoint, it must not be null. // Outside of a safepoint, the header could be changing (for example, // another thread could be inflating a lock on this object). --- 517,529 ---- // used only for asserts bool oopDesc::is_oop(bool ignore_mark_word) const { oop obj = (oop) this; if (!check_obj_alignment(obj)) return false; ! if (!GC::gc()->heap()->is_in_reserved(obj)) return false; // obj is aligned and accessible in heap ! if (GC::gc()->heap()->is_in_reserved(obj->klass_or_null())) return false; // Header verification: the mark is typically non-NULL. If we're // at a safepoint, it must not be null. // Outside of a safepoint, the header could be changing (for example, // another thread could be inflating a lock on this object).
*** 543,564 **** } #ifndef PRODUCT // used only for asserts bool oopDesc::is_unlocked_oop() const { ! if (!Universe::heap()->is_in_reserved(this)) return false; return mark()->is_unlocked(); } #endif // PRODUCT // Used only for markSweep, scavenging bool oopDesc::is_gc_marked() const { return mark()->is_marked(); } bool oopDesc::is_scavengable() const { ! return Universe::heap()->is_scavengable(this); } // Used by scavengers bool oopDesc::is_forwarded() const { // The extra heap check is needed since the obj might be locked, in which case the --- 543,564 ---- } #ifndef PRODUCT // used only for asserts bool oopDesc::is_unlocked_oop() const { ! if (!GC::gc()->heap()->is_in_reserved(this)) return false; return mark()->is_unlocked(); } #endif // PRODUCT // Used only for markSweep, scavenging bool oopDesc::is_gc_marked() const { return mark()->is_marked(); } bool oopDesc::is_scavengable() const { ! return GC::gc()->heap()->is_scavengable(this); } // Used by scavengers bool oopDesc::is_forwarded() const { // The extra heap check is needed since the obj might be locked, in which case the
*** 568,589 **** // Used by scavengers void oopDesc::forward_to(oop p) { assert(check_obj_alignment(p), "forwarding to something not aligned"); ! assert(Universe::heap()->is_in_reserved(p), "forwarding to something not in heap"); markOop m = markOopDesc::encode_pointer_as_mark(p); assert(m->decode_pointer() == p, "encoding must be reversable"); set_mark(m); } // Used by parallel scavengers bool oopDesc::cas_forward_to(oop p, markOop compare) { assert(check_obj_alignment(p), "forwarding to something not aligned"); ! assert(Universe::heap()->is_in_reserved(p), "forwarding to something not in heap"); markOop m = markOopDesc::encode_pointer_as_mark(p); assert(m->decode_pointer() == p, "encoding must be reversable"); return cas_set_mark(m, compare) == compare; } --- 568,589 ---- // Used by scavengers void oopDesc::forward_to(oop p) { assert(check_obj_alignment(p), "forwarding to something not aligned"); ! assert(GC::gc()->heap()->is_in_reserved(p), "forwarding to something not in heap"); markOop m = markOopDesc::encode_pointer_as_mark(p); assert(m->decode_pointer() == p, "encoding must be reversable"); set_mark(m); } // Used by parallel scavengers bool oopDesc::cas_forward_to(oop p, markOop compare) { assert(check_obj_alignment(p), "forwarding to something not aligned"); ! assert(GC::gc()->heap()->is_in_reserved(p), "forwarding to something not in heap"); markOop m = markOopDesc::encode_pointer_as_mark(p); assert(m->decode_pointer() == p, "encoding must be reversable"); return cas_set_mark(m, compare) == compare; }
< prev index next >