src/hotspot/share/gc/shared/barrierSet.hpp
changeset 52142 ca0c25e01c5b
parent 52070 e4d72440d60e
child 53207 b1c6d4d7f801
equal deleted inserted replaced
52141:de6dc206a92b 52142:ca0c25e01c5b
    34 #include "utilities/macros.hpp"
    34 #include "utilities/macros.hpp"
    35 
    35 
    36 class BarrierSetAssembler;
    36 class BarrierSetAssembler;
    37 class BarrierSetC1;
    37 class BarrierSetC1;
    38 class BarrierSetC2;
    38 class BarrierSetC2;
       
    39 class BarrierSetNMethod;
    39 class JavaThread;
    40 class JavaThread;
    40 
    41 
    41 // This class provides the interface between a barrier implementation and
    42 // This class provides the interface between a barrier implementation and
    42 // the rest of the system.
    43 // the rest of the system.
    43 
    44 
    70 private:
    71 private:
    71   FakeRtti _fake_rtti;
    72   FakeRtti _fake_rtti;
    72   BarrierSetAssembler* _barrier_set_assembler;
    73   BarrierSetAssembler* _barrier_set_assembler;
    73   BarrierSetC1* _barrier_set_c1;
    74   BarrierSetC1* _barrier_set_c1;
    74   BarrierSetC2* _barrier_set_c2;
    75   BarrierSetC2* _barrier_set_c2;
       
    76   BarrierSetNMethod* _barrier_set_nmethod;
    75 
    77 
    76 public:
    78 public:
    77   // Metafunction mapping a class derived from BarrierSet to the
    79   // Metafunction mapping a class derived from BarrierSet to the
    78   // corresponding Name enum tag.
    80   // corresponding Name enum tag.
    79   template<typename T> struct GetName;
    81   template<typename T> struct GetName;
    93 
    95 
    94 protected:
    96 protected:
    95   BarrierSet(BarrierSetAssembler* barrier_set_assembler,
    97   BarrierSet(BarrierSetAssembler* barrier_set_assembler,
    96              BarrierSetC1* barrier_set_c1,
    98              BarrierSetC1* barrier_set_c1,
    97              BarrierSetC2* barrier_set_c2,
    99              BarrierSetC2* barrier_set_c2,
       
   100              BarrierSetNMethod* barrier_set_nmethod,
    98              const FakeRtti& fake_rtti) :
   101              const FakeRtti& fake_rtti) :
    99     _fake_rtti(fake_rtti),
   102     _fake_rtti(fake_rtti),
   100     _barrier_set_assembler(barrier_set_assembler),
   103     _barrier_set_assembler(barrier_set_assembler),
   101     _barrier_set_c1(barrier_set_c1),
   104     _barrier_set_c1(barrier_set_c1),
   102     _barrier_set_c2(barrier_set_c2) {}
   105     _barrier_set_c2(barrier_set_c2),
       
   106     _barrier_set_nmethod(barrier_set_nmethod) {}
   103   ~BarrierSet() { }
   107   ~BarrierSet() { }
   104 
   108 
   105   template <class BarrierSetAssemblerT>
   109   template <class BarrierSetAssemblerT>
   106   static BarrierSetAssembler* make_barrier_set_assembler() {
   110   static BarrierSetAssembler* make_barrier_set_assembler() {
   107     return NOT_ZERO(new BarrierSetAssemblerT()) ZERO_ONLY(NULL);
   111     return NOT_ZERO(new BarrierSetAssemblerT()) ZERO_ONLY(NULL);
   152   }
   156   }
   153 
   157 
   154   BarrierSetC2* barrier_set_c2() {
   158   BarrierSetC2* barrier_set_c2() {
   155     assert(_barrier_set_c2 != NULL, "should be set");
   159     assert(_barrier_set_c2 != NULL, "should be set");
   156     return _barrier_set_c2;
   160     return _barrier_set_c2;
       
   161   }
       
   162 
       
   163   BarrierSetNMethod* barrier_set_nmethod() {
       
   164     return _barrier_set_nmethod;
   157   }
   165   }
   158 
   166 
   159   // The AccessBarrier of a BarrierSet subclass is called by the Access API
   167   // The AccessBarrier of a BarrierSet subclass is called by the Access API
   160   // (cf. oops/access.hpp) to perform decorated accesses. GC implementations
   168   // (cf. oops/access.hpp) to perform decorated accesses. GC implementations
   161   // may override these default access operations by declaring an
   169   // may override these default access operations by declaring an