< prev index next >

src/hotspot/share/gc/serial/markSweep.inline.hpp

Print this page

        

*** 26,57 **** #define SHARE_GC_SERIAL_MARKSWEEP_INLINE_HPP #include "classfile/classLoaderData.inline.hpp" #include "gc/serial/markSweep.hpp" #include "memory/universe.hpp" ! #include "oops/markWord.inline.hpp" #include "oops/access.inline.hpp" #include "oops/compressedOops.inline.hpp" #include "oops/oop.inline.hpp" #include "utilities/stack.inline.hpp" inline void MarkSweep::mark_object(oop obj) { // some marks may contain information we need to preserve so we store them away // and overwrite the mark. We'll restore it at the end of markSweep. ! markWord mark = obj->mark_raw(); ! obj->set_mark_raw(markWord::prototype().set_marked()); ! if (obj->mark_must_be_preserved(mark)) { preserve_mark(obj, mark); } } template <class T> inline void MarkSweep::mark_and_push(T* p) { T heap_oop = RawAccess<>::oop_load(p); if (!CompressedOops::is_null(heap_oop)) { oop obj = CompressedOops::decode_not_null(heap_oop); ! if (!obj->mark_raw().is_marked()) { mark_object(obj); _marking_stack.push(obj); } } } --- 26,57 ---- #define SHARE_GC_SERIAL_MARKSWEEP_INLINE_HPP #include "classfile/classLoaderData.inline.hpp" #include "gc/serial/markSweep.hpp" #include "memory/universe.hpp" ! #include "oops/markOop.inline.hpp" #include "oops/access.inline.hpp" #include "oops/compressedOops.inline.hpp" #include "oops/oop.inline.hpp" #include "utilities/stack.inline.hpp" inline void MarkSweep::mark_object(oop obj) { // some marks may contain information we need to preserve so we store them away // and overwrite the mark. We'll restore it at the end of markSweep. ! markOop mark = obj->mark_raw(); ! obj->set_mark_raw(markOopDesc::prototype()->set_marked()); ! if (mark->must_be_preserved(obj)) { preserve_mark(obj, mark); } } template <class T> inline void MarkSweep::mark_and_push(T* p) { T heap_oop = RawAccess<>::oop_load(p); if (!CompressedOops::is_null(heap_oop)) { oop obj = CompressedOops::decode_not_null(heap_oop); ! if (!obj->mark_raw()->is_marked()) { mark_object(obj); _marking_stack.push(obj); } } }
*** 76,95 **** T heap_oop = RawAccess<>::oop_load(p); if (!CompressedOops::is_null(heap_oop)) { oop obj = CompressedOops::decode_not_null(heap_oop); assert(Universe::heap()->is_in(obj), "should be in heap"); ! oop new_obj = oop(obj->mark_raw().decode_pointer()); ! assert(new_obj != NULL || // is forwarding ptr? ! obj->mark_raw() == markWord::prototype() || // not gc marked? ! (UseBiasedLocking && obj->mark_raw().has_bias_pattern()), // not gc marked? "should be forwarded"); if (new_obj != NULL) { ! DEBUG_ONLY(Universe::heap()->check_oop_location((HeapWord*)new_obj);) RawAccess<IS_NOT_NULL>::oop_store(p, new_obj); } } } --- 76,96 ---- T heap_oop = RawAccess<>::oop_load(p); if (!CompressedOops::is_null(heap_oop)) { oop obj = CompressedOops::decode_not_null(heap_oop); assert(Universe::heap()->is_in(obj), "should be in heap"); ! oop new_obj = oop(obj->mark_raw()->decode_pointer()); ! assert(new_obj != NULL || // is forwarding ptr? ! obj->mark_raw() == markOopDesc::prototype() || // not gc marked? ! (UseBiasedLocking && obj->mark_raw()->has_bias_pattern()), // not gc marked? "should be forwarded"); if (new_obj != NULL) { ! assert(Universe::heap()->is_in_reserved(new_obj), ! "should be in object space"); RawAccess<IS_NOT_NULL>::oop_store(p, new_obj); } } }
< prev index next >