< prev index next >

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

Print this page
*** 1,7 ***
--- 1,8 ---
  /*
   * Copyright (c) 2019, 2020, Red Hat, Inc. All rights reserved.
+  * Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   *
   * This code is free software; you can redistribute it and/or modify it
   * under the terms of the GNU General Public License version 2 only, as
   * published by the Free Software Foundation.

*** 46,11 ***
    if (CompressedOops::is_null(obj)) {
      return false;
    }
    obj = ShenandoahBarrierSet::resolve_forwarded_not_null(obj);
    shenandoah_assert_not_forwarded_if(nullptr, obj, ShenandoahHeap::heap()->is_concurrent_mark_in_progress());
!   return _mark_context->is_marked(obj);
  }
  
  ShenandoahIsAliveClosure::ShenandoahIsAliveClosure() :
    _mark_context(ShenandoahHeap::heap()->marking_context()) {
  }
--- 47,11 ---
    if (CompressedOops::is_null(obj)) {
      return false;
    }
    obj = ShenandoahBarrierSet::resolve_forwarded_not_null(obj);
    shenandoah_assert_not_forwarded_if(nullptr, obj, ShenandoahHeap::heap()->is_concurrent_mark_in_progress());
!   return _mark_context->is_marked_or_old(obj);
  }
  
  ShenandoahIsAliveClosure::ShenandoahIsAliveClosure() :
    _mark_context(ShenandoahHeap::heap()->marking_context()) {
  }

*** 58,11 ***
  bool ShenandoahIsAliveClosure::do_object_b(oop obj) {
    if (CompressedOops::is_null(obj)) {
      return false;
    }
    shenandoah_assert_not_forwarded(nullptr, obj);
!   return _mark_context->is_marked(obj);
  }
  
  BoolObjectClosure* ShenandoahIsAliveSelector::is_alive_closure() {
    return ShenandoahHeap::heap()->has_forwarded_objects() ?
           reinterpret_cast<BoolObjectClosure*>(&_fwd_alive_cl) :
--- 59,11 ---
  bool ShenandoahIsAliveClosure::do_object_b(oop obj) {
    if (CompressedOops::is_null(obj)) {
      return false;
    }
    shenandoah_assert_not_forwarded(nullptr, obj);
!   return _mark_context->is_marked_or_old(obj);
  }
  
  BoolObjectClosure* ShenandoahIsAliveSelector::is_alive_closure() {
    return ShenandoahHeap::heap()->has_forwarded_objects() ?
           reinterpret_cast<BoolObjectClosure*>(&_fwd_alive_cl) :

*** 86,11 ***
  }
  
  template <typename T>
  void ShenandoahKeepAliveClosure::do_oop_work(T* p) {
    assert(ShenandoahHeap::heap()->is_concurrent_mark_in_progress(), "Only for concurrent marking phase");
!   assert(!ShenandoahHeap::heap()->has_forwarded_objects(), "Not expected");
  
    T o = RawAccess<>::oop_load(p);
    if (!CompressedOops::is_null(o)) {
      oop obj = CompressedOops::decode_not_null(o);
      _bs->enqueue(obj);
--- 87,11 ---
  }
  
  template <typename T>
  void ShenandoahKeepAliveClosure::do_oop_work(T* p) {
    assert(ShenandoahHeap::heap()->is_concurrent_mark_in_progress(), "Only for concurrent marking phase");
!   assert(ShenandoahHeap::heap()->is_concurrent_old_mark_in_progress() || !ShenandoahHeap::heap()->has_forwarded_objects(), "Not expected");
  
    T o = RawAccess<>::oop_load(p);
    if (!CompressedOops::is_null(o)) {
      oop obj = CompressedOops::decode_not_null(o);
      _bs->enqueue(obj);
< prev index next >