comparison src/hotspot/share/gc/shared/barrierSet.hpp @ 50590:4fa726f796f5

8202781: Fix typo in DiscoveredListIterator::complete_enqeue Reviewed-by: kbarrett
author tschatzl
date Tue, 08 May 2018 16:49:20 +0200
parents 93d84f667d12
children ffa644980dff
comparison
equal deleted inserted replaced
12:c6f4984aff95 13:25cb72b27d2b
31 #include "oops/accessBackend.hpp" 31 #include "oops/accessBackend.hpp"
32 #include "oops/oopsHierarchy.hpp" 32 #include "oops/oopsHierarchy.hpp"
33 #include "utilities/fakeRttiSupport.hpp" 33 #include "utilities/fakeRttiSupport.hpp"
34 #include "utilities/macros.hpp" 34 #include "utilities/macros.hpp"
35 35
36 class BarrierSetAssembler;
37 class BarrierSetC1;
36 class JavaThread; 38 class JavaThread;
37 class BarrierSetAssembler;
38 39
39 // This class provides the interface between a barrier implementation and 40 // This class provides the interface between a barrier implementation and
40 // the rest of the system. 41 // the rest of the system.
41 42
42 class BarrierSet: public CHeapObj<mtGC> { 43 class BarrierSet: public CHeapObj<mtGC> {
66 typedef FakeRttiSupport<BarrierSet, Name> FakeRtti; 67 typedef FakeRttiSupport<BarrierSet, Name> FakeRtti;
67 68
68 private: 69 private:
69 FakeRtti _fake_rtti; 70 FakeRtti _fake_rtti;
70 BarrierSetAssembler* _barrier_set_assembler; 71 BarrierSetAssembler* _barrier_set_assembler;
72 BarrierSetC1* _barrier_set_c1;
71 73
72 public: 74 public:
73 // Metafunction mapping a class derived from BarrierSet to the 75 // Metafunction mapping a class derived from BarrierSet to the
74 // corresponding Name enum tag. 76 // corresponding Name enum tag.
75 template<typename T> struct GetName; 77 template<typename T> struct GetName;
86 bool is_a(BarrierSet::Name bsn) const { return _fake_rtti.has_tag(bsn); } 88 bool is_a(BarrierSet::Name bsn) const { return _fake_rtti.has_tag(bsn); }
87 89
88 // End of fake RTTI support. 90 // End of fake RTTI support.
89 91
90 protected: 92 protected:
91 BarrierSet(BarrierSetAssembler* barrier_set_assembler, const FakeRtti& fake_rtti) : 93 BarrierSet(BarrierSetAssembler* barrier_set_assembler,
94 BarrierSetC1* barrier_set_c1,
95 const FakeRtti& fake_rtti) :
92 _fake_rtti(fake_rtti), 96 _fake_rtti(fake_rtti),
93 _barrier_set_assembler(barrier_set_assembler) { } 97 _barrier_set_assembler(barrier_set_assembler),
98 _barrier_set_c1(barrier_set_c1) {}
94 ~BarrierSet() { } 99 ~BarrierSet() { }
95 100
96 template <class BarrierSetAssemblerT> 101 template <class BarrierSetAssemblerT>
97 BarrierSetAssembler* make_barrier_set_assembler() { 102 BarrierSetAssembler* make_barrier_set_assembler() {
98 return NOT_ZERO(new BarrierSetAssemblerT()) ZERO_ONLY(NULL); 103 return NOT_ZERO(new BarrierSetAssemblerT()) ZERO_ONLY(NULL);
104 }
105
106 template <class BarrierSetC1T>
107 BarrierSetC1* make_barrier_set_c1() {
108 return COMPILER1_PRESENT(new BarrierSetC1T()) NOT_COMPILER1(NULL);
99 } 109 }
100 110
101 public: 111 public:
102 // Support for optimizing compilers to call the barrier set on slow path allocations 112 // Support for optimizing compilers to call the barrier set on slow path allocations
103 // that did not enter a TLAB. Used for e.g. ReduceInitialCardMarks. 113 // that did not enter a TLAB. Used for e.g. ReduceInitialCardMarks.
119 static void set_barrier_set(BarrierSet* barrier_set); 129 static void set_barrier_set(BarrierSet* barrier_set);
120 130
121 BarrierSetAssembler* barrier_set_assembler() { 131 BarrierSetAssembler* barrier_set_assembler() {
122 assert(_barrier_set_assembler != NULL, "should be set"); 132 assert(_barrier_set_assembler != NULL, "should be set");
123 return _barrier_set_assembler; 133 return _barrier_set_assembler;
134 }
135
136 BarrierSetC1* barrier_set_c1() {
137 assert(_barrier_set_c1 != NULL, "should be set");
138 return _barrier_set_c1;
124 } 139 }
125 140
126 // The AccessBarrier of a BarrierSet subclass is called by the Access API 141 // The AccessBarrier of a BarrierSet subclass is called by the Access API
127 // (cf. oops/access.hpp) to perform decorated accesses. GC implementations 142 // (cf. oops/access.hpp) to perform decorated accesses. GC implementations
128 // may override these default access operations by declaring an 143 // may override these default access operations by declaring an