RFR: 8220503: Move ShenandoahTerminatorTerminator::should_exit_termination out of header

Roman Kennke rkennke at redhat.com
Mon Mar 9 11:27:57 UTC 2020


Hi Aditya,

> Addressing another silly active bug... this fixes 8220503 by moving the definition of
> ShenandoahTerminatorTerminator::should_exit_termination into shenandoahTaskqueue.cpp, matching how
> it is in shenandoah/jdk8u.
> 
> I removed the comment next to the function. Looking at the history, it was originally next to the
> virtual "should_force_termination" function back when that function existed and its default
> implementation returned false. I don't know if there's value in keeping the comment now, especially
> because it might accidentally be misunderstood to mean that the function returns true. If someone
> feels strongly about keeping it, I'm happy to add it back (and perhaps reword it for clarity).
> 
> Bug: https://bugs.openjdk.java.net/browse/JDK-8220503
> Patch: See below

Patch looks ok to me. You are right, I don't think we still need the
comment, it is misleading and wrong.

I'll push the patch for you! Thank you!

Roman


> ===
> 
> diff -r e44b68e5bdaf src/hotspot/share/gc/shenandoah/shenandoahTaskqueue.cpp
> --- a/src/hotspot/share/gc/shenandoah/shenandoahTaskqueue.cpp   Sun Mar 08 15:15:38 2020 +0900
> +++ b/src/hotspot/share/gc/shenandoah/shenandoahTaskqueue.cpp   Sun Mar 08 21:03:46 2020 -0700
> @@ -88,3 +88,7 @@
>    }
>  }
>  #endif // TASKQUEUE_STATS
> +
> +bool ShenandoahTerminatorTerminator::should_exit_termination() {
> +  return _heap->cancelled_gc();
> +}
> diff -r e44b68e5bdaf src/hotspot/share/gc/shenandoah/shenandoahTaskqueue.hpp
> --- a/src/hotspot/share/gc/shenandoah/shenandoahTaskqueue.hpp   Sun Mar 08 15:15:38 2020 +0900
> +++ b/src/hotspot/share/gc/shenandoah/shenandoahTaskqueue.hpp   Sun Mar 08 21:03:46 2020 -0700
> @@ -335,8 +335,7 @@
>    ShenandoahHeap* _heap;
>  public:
>    ShenandoahTerminatorTerminator(ShenandoahHeap* const heap) : _heap(heap) { }
> -  // return true, terminates immediately, even if there's remaining work left
> -  virtual bool should_exit_termination() { return _heap->cancelled_gc(); }
> +  virtual bool should_exit_termination();
>  };
> 
>  #endif // SHARE_GC_SHENANDOAH_SHENANDOAHTASKQUEUE_HPP
> 



More information about the shenandoah-dev mailing list