< prev index next >

src/share/vm/gc/shared/barrierSet.hpp

Print this page




  35 class BarrierSet: public CHeapObj<mtGC> {
  36   friend class VMStructs;
  37 public:
  38   // Fake RTTI support.  For a derived class T to participate
  39   // - T must have a corresponding Name entry.
  40   // - GetName<T> must be specialized to return the corresponding Name
  41   //   entry.
  42   // - If T is a base class, the constructor must have a FakeRtti
  43   //   parameter and pass it up to its base class, with the tag set
  44   //   augmented with the corresponding Name entry.
  45   // - If T is a concrete class, the constructor must create a
  46   //   FakeRtti object whose tag set includes the corresponding Name
  47   //   entry, and pass it up to its base class.
  48 
  49   enum Name {                   // associated class
  50     ModRef,                     // ModRefBarrierSet
  51     CardTableModRef,            // CardTableModRefBS
  52     CardTableForRS,             // CardTableModRefBSForCTRS
  53     CardTableExtension,         // CardTableExtension
  54     G1SATBCT,                   // G1SATBCardTableModRefBS
  55     G1SATBCTLogging             // G1SATBCardTableLoggingModRefBS

  56   };
  57 
  58 protected:
  59   typedef FakeRttiSupport<BarrierSet, Name> FakeRtti;
  60 
  61 private:
  62   FakeRtti _fake_rtti;
  63 
  64   // Metafunction mapping a class derived from BarrierSet to the
  65   // corresponding Name enum tag.
  66   template<typename T> struct GetName;
  67 
  68   // Downcast argument to a derived barrier set type.
  69   // The cast is checked in a debug build.
  70   // T must have a specialization for BarrierSet::GetName<T>.
  71   template<typename T> friend T* barrier_set_cast(BarrierSet* bs);
  72 
  73 public:
  74   // Note: This is not presently the Name corresponding to the
  75   // concrete class of this object.




  35 class BarrierSet: public CHeapObj<mtGC> {
  36   friend class VMStructs;
  37 public:
  38   // Fake RTTI support.  For a derived class T to participate
  39   // - T must have a corresponding Name entry.
  40   // - GetName<T> must be specialized to return the corresponding Name
  41   //   entry.
  42   // - If T is a base class, the constructor must have a FakeRtti
  43   //   parameter and pass it up to its base class, with the tag set
  44   //   augmented with the corresponding Name entry.
  45   // - If T is a concrete class, the constructor must create a
  46   //   FakeRtti object whose tag set includes the corresponding Name
  47   //   entry, and pass it up to its base class.
  48 
  49   enum Name {                   // associated class
  50     ModRef,                     // ModRefBarrierSet
  51     CardTableModRef,            // CardTableModRefBS
  52     CardTableForRS,             // CardTableModRefBSForCTRS
  53     CardTableExtension,         // CardTableExtension
  54     G1SATBCT,                   // G1SATBCardTableModRefBS
  55     G1SATBCTLogging,            // G1SATBCardTableLoggingModRefBS
  56     Epsilon,                    // EpsilonBarrierSet
  57   };
  58 
  59 protected:
  60   typedef FakeRttiSupport<BarrierSet, Name> FakeRtti;
  61 
  62 private:
  63   FakeRtti _fake_rtti;
  64 
  65   // Metafunction mapping a class derived from BarrierSet to the
  66   // corresponding Name enum tag.
  67   template<typename T> struct GetName;
  68 
  69   // Downcast argument to a derived barrier set type.
  70   // The cast is checked in a debug build.
  71   // T must have a specialization for BarrierSet::GetName<T>.
  72   template<typename T> friend T* barrier_set_cast(BarrierSet* bs);
  73 
  74 public:
  75   // Note: This is not presently the Name corresponding to the
  76   // concrete class of this object.


< prev index next >