Skip to content
Permalink
Browse files
8260309: Shenandoah: Clean up ShenandoahBarrierSet
Reviewed-by: shade, zgu
  • Loading branch information
rkennke committed Feb 1, 2021
1 parent 181d63f commit df33595e9fb32267da9702863ab131d98ab71422
@@ -23,16 +23,13 @@
*/

#include "precompiled.hpp"
#include "gc/shenandoah/shenandoahAsserts.hpp"
#include "gc/shenandoah/shenandoahClosures.inline.hpp"
#include "gc/shenandoah/shenandoahBarrierSet.hpp"
#include "gc/shenandoah/shenandoahBarrierSetClone.inline.hpp"
#include "gc/shenandoah/shenandoahBarrierSetAssembler.hpp"
#include "gc/shenandoah/shenandoahBarrierSetNMethod.hpp"
#include "gc/shenandoah/shenandoahClosures.inline.hpp"
#include "gc/shenandoah/shenandoahHeap.inline.hpp"
#include "gc/shenandoah/shenandoahStackWatermark.hpp"
#include "memory/iterator.inline.hpp"
#include "runtime/interfaceSupport.inline.hpp"
#ifdef COMPILER1
#include "gc/shenandoah/c1/shenandoahBarrierSetC1.hpp"
#endif
@@ -64,21 +61,13 @@ void ShenandoahBarrierSet::print_on(outputStream* st) const {
st->print("ShenandoahBarrierSet");
}

bool ShenandoahBarrierSet::is_a(BarrierSet::Name bsn) {
return bsn == BarrierSet::ShenandoahBarrierSet;
}

bool ShenandoahBarrierSet::is_aligned(HeapWord* hw) {
return true;
}

bool ShenandoahBarrierSet::need_load_reference_barrier(DecoratorSet decorators, BasicType type) {
if (!ShenandoahLoadRefBarrier) return false;
// Only needed for references
return is_reference_type(type);
}

bool ShenandoahBarrierSet::need_keep_alive_barrier(DecoratorSet decorators,BasicType type) {
bool ShenandoahBarrierSet::need_keep_alive_barrier(DecoratorSet decorators, BasicType type) {
if (!ShenandoahSATBBarrier) return false;
// Only needed for references
if (!is_reference_type(type)) return false;
@@ -25,16 +25,15 @@
#ifndef SHARE_GC_SHENANDOAH_SHENANDOAHBARRIERSET_HPP
#define SHARE_GC_SHENANDOAH_SHENANDOAHBARRIERSET_HPP

#include "gc/shared/accessBarrierSupport.hpp"
#include "gc/shared/barrierSet.hpp"
#include "gc/shenandoah/shenandoahHeap.hpp"
#include "gc/shenandoah/shenandoahSATBMarkQueueSet.hpp"

class ShenandoahHeap;
class ShenandoahBarrierSetAssembler;

class ShenandoahBarrierSet: public BarrierSet {
private:
ShenandoahHeap* _heap;
ShenandoahHeap* const _heap;
BufferNode::Allocator _satb_mark_queue_buffer_allocator;
ShenandoahSATBMarkQueueSet _satb_mark_queue_set;

@@ -72,10 +71,6 @@ class ShenandoahBarrierSet: public BarrierSet {

void print_on(outputStream* st) const;

bool is_a(BarrierSet::Name bsn);

bool is_aligned(HeapWord* hw);

template <class T>
inline void arraycopy_barrier(T* src, T* dst, size_t count);
inline void clone_barrier(oop src);
@@ -159,11 +154,11 @@ class ShenandoahBarrierSet: public BarrierSet {
// Clone barrier support
static void clone_in_heap(oop src, oop dst, size_t size);

// Needed for loads on non-heap weak references
// Support for concurrent roots evacuation, updating and weak roots clearing
template <typename T>
static oop oop_load_not_in_heap(T* addr);

// Used for catching bad stores
// Support for concurrent roots marking
template <typename T>
static void oop_store_not_in_heap(T* addr, oop value);

@@ -25,7 +25,7 @@
#ifndef SHARE_GC_SHENANDOAH_SHENANDOAHBARRIERSET_INLINE_HPP
#define SHARE_GC_SHENANDOAH_SHENANDOAHBARRIERSET_INLINE_HPP

#include "gc/shared/barrierSet.hpp"
#include "gc/shared/accessBarrierSupport.inline.hpp"
#include "gc/shenandoah/shenandoahAsserts.hpp"
#include "gc/shenandoah/shenandoahBarrierSet.hpp"
#include "gc/shenandoah/shenandoahCollectionSet.inline.hpp"
@@ -35,7 +35,6 @@
#include "gc/shenandoah/shenandoahHeapRegion.hpp"
#include "gc/shenandoah/shenandoahMarkingContext.inline.hpp"
#include "gc/shenandoah/shenandoahThreadLocalData.hpp"
#include "memory/iterator.inline.hpp"
#include "oops/oop.inline.hpp"

inline oop ShenandoahBarrierSet::resolve_forwarded_not_null(oop p) {
@@ -29,7 +29,7 @@
#include "gc/shenandoah/shenandoahCollectionSet.inline.hpp"
#include "gc/shenandoah/shenandoahEvacOOMHandler.hpp"
#include "gc/shenandoah/shenandoahHeap.inline.hpp"
#include "memory/iterator.hpp"
#include "memory/iterator.inline.hpp"
#include "oops/access.hpp"
#include "oops/compressedOops.hpp"

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2016, 2019, Red Hat, Inc. All rights reserved.
* Copyright (c) 2016, 2021, Red Hat, Inc. 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
@@ -29,6 +29,7 @@
#include "gc/shenandoah/shenandoahHeapRegionSet.hpp"
#include "gc/shenandoah/shenandoahMarkingContext.inline.hpp"
#include "logging/logStream.hpp"
#include "memory/resourceArea.hpp"
#include "runtime/orderAccess.hpp"

ShenandoahFreeSet::ShenandoahFreeSet(ShenandoahHeap* heap, size_t max_regions) :
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2016, 2020, Red Hat, Inc. All rights reserved.
* Copyright (c) 2016, 2021, Red Hat, Inc. 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
@@ -28,6 +28,7 @@
#include "gc/shenandoah/shenandoahTaskqueue.inline.hpp"
#include "logging/log.hpp"
#include "logging/logStream.hpp"
#include "memory/resourceArea.hpp"

void ShenandoahObjToScanQueueSet::clear() {
uint size = GenericTaskQueueSet<ShenandoahObjToScanQueue, mtGC>::size();

0 comments on commit df33595

Please sign in to comment.