Skip to content

Commit df33595

Browse files
committedFeb 1, 2021
8260309: Shenandoah: Clean up ShenandoahBarrierSet
Reviewed-by: shade, zgu
1 parent 181d63f commit df33595

6 files changed

+12
-27
lines changed
 

‎src/hotspot/share/gc/shenandoah/shenandoahBarrierSet.cpp

+2-13
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,13 @@
2323
*/
2424

2525
#include "precompiled.hpp"
26-
#include "gc/shenandoah/shenandoahAsserts.hpp"
27-
#include "gc/shenandoah/shenandoahClosures.inline.hpp"
2826
#include "gc/shenandoah/shenandoahBarrierSet.hpp"
2927
#include "gc/shenandoah/shenandoahBarrierSetClone.inline.hpp"
3028
#include "gc/shenandoah/shenandoahBarrierSetAssembler.hpp"
3129
#include "gc/shenandoah/shenandoahBarrierSetNMethod.hpp"
30+
#include "gc/shenandoah/shenandoahClosures.inline.hpp"
3231
#include "gc/shenandoah/shenandoahHeap.inline.hpp"
3332
#include "gc/shenandoah/shenandoahStackWatermark.hpp"
34-
#include "memory/iterator.inline.hpp"
35-
#include "runtime/interfaceSupport.inline.hpp"
3633
#ifdef COMPILER1
3734
#include "gc/shenandoah/c1/shenandoahBarrierSetC1.hpp"
3835
#endif
@@ -64,21 +61,13 @@ void ShenandoahBarrierSet::print_on(outputStream* st) const {
6461
st->print("ShenandoahBarrierSet");
6562
}
6663

67-
bool ShenandoahBarrierSet::is_a(BarrierSet::Name bsn) {
68-
return bsn == BarrierSet::ShenandoahBarrierSet;
69-
}
70-
71-
bool ShenandoahBarrierSet::is_aligned(HeapWord* hw) {
72-
return true;
73-
}
74-
7564
bool ShenandoahBarrierSet::need_load_reference_barrier(DecoratorSet decorators, BasicType type) {
7665
if (!ShenandoahLoadRefBarrier) return false;
7766
// Only needed for references
7867
return is_reference_type(type);
7968
}
8069

81-
bool ShenandoahBarrierSet::need_keep_alive_barrier(DecoratorSet decorators,BasicType type) {
70+
bool ShenandoahBarrierSet::need_keep_alive_barrier(DecoratorSet decorators, BasicType type) {
8271
if (!ShenandoahSATBBarrier) return false;
8372
// Only needed for references
8473
if (!is_reference_type(type)) return false;

‎src/hotspot/share/gc/shenandoah/shenandoahBarrierSet.hpp

+4-9
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,15 @@
2525
#ifndef SHARE_GC_SHENANDOAH_SHENANDOAHBARRIERSET_HPP
2626
#define SHARE_GC_SHENANDOAH_SHENANDOAHBARRIERSET_HPP
2727

28-
#include "gc/shared/accessBarrierSupport.hpp"
2928
#include "gc/shared/barrierSet.hpp"
30-
#include "gc/shenandoah/shenandoahHeap.hpp"
3129
#include "gc/shenandoah/shenandoahSATBMarkQueueSet.hpp"
3230

31+
class ShenandoahHeap;
3332
class ShenandoahBarrierSetAssembler;
3433

3534
class ShenandoahBarrierSet: public BarrierSet {
3635
private:
37-
ShenandoahHeap* _heap;
36+
ShenandoahHeap* const _heap;
3837
BufferNode::Allocator _satb_mark_queue_buffer_allocator;
3938
ShenandoahSATBMarkQueueSet _satb_mark_queue_set;
4039

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

7372
void print_on(outputStream* st) const;
7473

75-
bool is_a(BarrierSet::Name bsn);
76-
77-
bool is_aligned(HeapWord* hw);
78-
7974
template <class T>
8075
inline void arraycopy_barrier(T* src, T* dst, size_t count);
8176
inline void clone_barrier(oop src);
@@ -159,11 +154,11 @@ class ShenandoahBarrierSet: public BarrierSet {
159154
// Clone barrier support
160155
static void clone_in_heap(oop src, oop dst, size_t size);
161156

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

166-
// Used for catching bad stores
161+
// Support for concurrent roots marking
167162
template <typename T>
168163
static void oop_store_not_in_heap(T* addr, oop value);
169164

‎src/hotspot/share/gc/shenandoah/shenandoahBarrierSet.inline.hpp

+1-2
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
#ifndef SHARE_GC_SHENANDOAH_SHENANDOAHBARRIERSET_INLINE_HPP
2626
#define SHARE_GC_SHENANDOAH_SHENANDOAHBARRIERSET_INLINE_HPP
2727

28-
#include "gc/shared/barrierSet.hpp"
28+
#include "gc/shared/accessBarrierSupport.inline.hpp"
2929
#include "gc/shenandoah/shenandoahAsserts.hpp"
3030
#include "gc/shenandoah/shenandoahBarrierSet.hpp"
3131
#include "gc/shenandoah/shenandoahCollectionSet.inline.hpp"
@@ -35,7 +35,6 @@
3535
#include "gc/shenandoah/shenandoahHeapRegion.hpp"
3636
#include "gc/shenandoah/shenandoahMarkingContext.inline.hpp"
3737
#include "gc/shenandoah/shenandoahThreadLocalData.hpp"
38-
#include "memory/iterator.inline.hpp"
3938
#include "oops/oop.inline.hpp"
4039

4140
inline oop ShenandoahBarrierSet::resolve_forwarded_not_null(oop p) {

‎src/hotspot/share/gc/shenandoah/shenandoahBarrierSetClone.inline.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
#include "gc/shenandoah/shenandoahCollectionSet.inline.hpp"
3030
#include "gc/shenandoah/shenandoahEvacOOMHandler.hpp"
3131
#include "gc/shenandoah/shenandoahHeap.inline.hpp"
32-
#include "memory/iterator.hpp"
32+
#include "memory/iterator.inline.hpp"
3333
#include "oops/access.hpp"
3434
#include "oops/compressedOops.hpp"
3535

‎src/hotspot/share/gc/shenandoah/shenandoahFreeSet.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2016, 2019, Red Hat, Inc. All rights reserved.
2+
* Copyright (c) 2016, 2021, Red Hat, Inc. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -29,6 +29,7 @@
2929
#include "gc/shenandoah/shenandoahHeapRegionSet.hpp"
3030
#include "gc/shenandoah/shenandoahMarkingContext.inline.hpp"
3131
#include "logging/logStream.hpp"
32+
#include "memory/resourceArea.hpp"
3233
#include "runtime/orderAccess.hpp"
3334

3435
ShenandoahFreeSet::ShenandoahFreeSet(ShenandoahHeap* heap, size_t max_regions) :

‎src/hotspot/share/gc/shenandoah/shenandoahTaskqueue.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2016, 2020, Red Hat, Inc. All rights reserved.
2+
* Copyright (c) 2016, 2021, Red Hat, Inc. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -28,6 +28,7 @@
2828
#include "gc/shenandoah/shenandoahTaskqueue.inline.hpp"
2929
#include "logging/log.hpp"
3030
#include "logging/logStream.hpp"
31+
#include "memory/resourceArea.hpp"
3132

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

0 commit comments

Comments
 (0)
Please sign in to comment.