< prev index next >

src/hotspot/share/gc/shenandoah/shenandoahMarkingContext.inline.hpp

Print this page




  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 
  25 #ifndef SHARE_GC_SHENANDOAH_SHENANDOAHMARKINGCONTEXT_INLINE_HPP
  26 #define SHARE_GC_SHENANDOAH_SHENANDOAHMARKINGCONTEXT_INLINE_HPP
  27 
  28 #include "gc/shenandoah/shenandoahMarkingContext.hpp"
  29 
  30 inline MarkBitMap* ShenandoahMarkingContext::mark_bit_map() {
  31   return &_mark_bit_map;
  32 }
  33 
  34 inline bool ShenandoahMarkingContext::mark(oop obj) {
  35   shenandoah_assert_not_forwarded(NULL, obj);
  36   return (! allocated_after_mark_start(obj)) && _mark_bit_map.par_mark(obj);

  37 }
  38 
  39 inline bool ShenandoahMarkingContext::is_marked(oop obj) const {
  40   return allocated_after_mark_start(obj) || _mark_bit_map.is_marked(obj);

  41 }
  42 
  43 inline bool ShenandoahMarkingContext::allocated_after_mark_start(oop obj) const {
  44   HeapWord* addr = cast_from_oop<HeapWord*>(obj);
  45   uintx index = ((uintx) addr) >> ShenandoahHeapRegion::region_size_bytes_shift();
  46   HeapWord* top_at_mark_start = _top_at_mark_starts[index];
  47   bool alloc_after_mark_start = addr >= top_at_mark_start;
  48   return alloc_after_mark_start;
  49 }
  50 
  51 #endif // SHARE_GC_SHENANDOAH_SHENANDOAHMARKINGCONTEXT_INLINE_HPP


  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 
  25 #ifndef SHARE_GC_SHENANDOAH_SHENANDOAHMARKINGCONTEXT_INLINE_HPP
  26 #define SHARE_GC_SHENANDOAH_SHENANDOAHMARKINGCONTEXT_INLINE_HPP
  27 
  28 #include "gc/shenandoah/shenandoahMarkingContext.hpp"
  29 
  30 inline MarkBitMap* ShenandoahMarkingContext::mark_bit_map() {
  31   return &_mark_bit_map;
  32 }
  33 
  34 inline bool ShenandoahMarkingContext::mark(oop obj) {
  35   shenandoah_assert_not_forwarded(NULL, obj);
  36   HeapWord* addr = cast_from_oop<HeapWord*>(obj);
  37   return (! allocated_after_mark_start(addr)) && _mark_bit_map.par_mark(addr);
  38 }
  39 
  40 inline bool ShenandoahMarkingContext::is_marked(oop obj) const {
  41   HeapWord* addr = cast_from_oop<HeapWord*>(obj);
  42   return allocated_after_mark_start(addr) || _mark_bit_map.is_marked(addr);
  43 }
  44 
  45 inline bool ShenandoahMarkingContext::allocated_after_mark_start(HeapWord* addr) const {

  46   uintx index = ((uintx) addr) >> ShenandoahHeapRegion::region_size_bytes_shift();
  47   HeapWord* top_at_mark_start = _top_at_mark_starts[index];
  48   bool alloc_after_mark_start = addr >= top_at_mark_start;
  49   return alloc_after_mark_start;
  50 }
  51 
  52 #endif // SHARE_GC_SHENANDOAH_SHENANDOAHMARKINGCONTEXT_INLINE_HPP
< prev index next >