Skip to content
Permalink
Browse files
8255527: Shenandoah: Let ShenadoahGCStateResetter disable barriers
Reviewed-by: shade, zgu
  • Loading branch information
rkennke committed Oct 28, 2020
1 parent 3c4fc79 commit 1f00c3b9ba75fe3aff9844874b2d7190e53d1b22
Showing 2 changed files with 8 additions and 5 deletions.
@@ -41,15 +41,17 @@
#include "utilities/debug.hpp"

ShenandoahGCStateResetter::ShenandoahGCStateResetter() :
_gc_state(ShenandoahHeap::heap()->gc_state()),
_heap(ShenandoahHeap::heap()),
_gc_state(_heap->gc_state()),
_concurrent_weak_root_in_progress(ShenandoahHeap::heap()->is_concurrent_weak_root_in_progress()) {
_heap->_gc_state.clear();
_heap->set_concurrent_weak_root_in_progress(false);
}

ShenandoahGCStateResetter::~ShenandoahGCStateResetter() {
ShenandoahHeap* const heap = ShenandoahHeap::heap();
heap->_gc_state.set(_gc_state);
assert(heap->gc_state() == _gc_state, "Should be restored");
heap->set_concurrent_weak_root_in_progress(_concurrent_weak_root_in_progress);
_heap->_gc_state.set(_gc_state);
assert(_heap->gc_state() == _gc_state, "Should be restored");
_heap->set_concurrent_weak_root_in_progress(_concurrent_weak_root_in_progress);
}

// Check for overflow of number of root types.
@@ -30,6 +30,7 @@

class ShenandoahGCStateResetter : public StackObj {
private:
ShenandoahHeap* const _heap;
const char _gc_state;
const bool _concurrent_weak_root_in_progress;

1 comment on commit 1f00c3b

@bridgekeeper
Copy link

@bridgekeeper bridgekeeper bot commented on 1f00c3b Oct 28, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.