< prev index next >

src/share/vm/gc/g1/g1SATBCardTableModRefBS.hpp

Print this page
rev 8362 : [mq]: hotspot


   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 
  25 #ifndef SHARE_VM_GC_IMPLEMENTATION_G1_G1SATBCARDTABLEMODREFBS_HPP
  26 #define SHARE_VM_GC_IMPLEMENTATION_G1_G1SATBCARDTABLEMODREFBS_HPP
  27 
  28 #include "gc_implementation/g1/g1RegionToSpaceMapper.hpp"
  29 #include "memory/cardTableModRefBS.hpp"
  30 #include "memory/memRegion.hpp"
  31 #include "oops/oop.hpp"
  32 #include "utilities/macros.hpp"
  33 
  34 class DirtyCardQueueSet;
  35 class G1SATBCardTableLoggingModRefBS;
  36 
  37 // This barrier is specialized to use a logging barrier to support
  38 // snapshot-at-the-beginning marking.
  39 
  40 class G1SATBCardTableModRefBS: public CardTableModRefBS {
  41 protected:
  42   enum G1CardValues {
  43     g1_young_gen = CT_MR_BS_last_reserved << 1
  44   };
  45 
  46   G1SATBCardTableModRefBS(MemRegion whole_heap, const BarrierSet::FakeRtti& fake_rtti);
  47   ~G1SATBCardTableModRefBS() { }
  48 
  49 public:


 166   virtual void resize_covered_region(MemRegion new_region) { ShouldNotReachHere(); }
 167 
 168   void write_ref_field_work(void* field, oop new_val, bool release = false);
 169 
 170   // Can be called from static contexts.
 171   static void write_ref_field_static(void* field, oop new_val);
 172 
 173   // NB: if you do a whole-heap invalidation, the "usual invariant" defined
 174   // above no longer applies.
 175   void invalidate(MemRegion mr, bool whole_heap = false);
 176 
 177   void write_region_work(MemRegion mr)    { invalidate(mr); }
 178   void write_ref_array_work(MemRegion mr) { invalidate(mr); }
 179 };
 180 
 181 template<>
 182 struct BarrierSet::GetName<G1SATBCardTableLoggingModRefBS> {
 183   static const BarrierSet::Name value = BarrierSet::G1SATBCTLogging;
 184 };
 185 
 186 #endif // SHARE_VM_GC_IMPLEMENTATION_G1_G1SATBCARDTABLEMODREFBS_HPP


   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 
  25 #ifndef SHARE_VM_GC_G1_G1SATBCARDTABLEMODREFBS_HPP
  26 #define SHARE_VM_GC_G1_G1SATBCARDTABLEMODREFBS_HPP
  27 
  28 #include "gc/g1/g1RegionToSpaceMapper.hpp"
  29 #include "gc/shared/cardTableModRefBS.hpp"
  30 #include "memory/memRegion.hpp"
  31 #include "oops/oop.hpp"
  32 #include "utilities/macros.hpp"
  33 
  34 class DirtyCardQueueSet;
  35 class G1SATBCardTableLoggingModRefBS;
  36 
  37 // This barrier is specialized to use a logging barrier to support
  38 // snapshot-at-the-beginning marking.
  39 
  40 class G1SATBCardTableModRefBS: public CardTableModRefBS {
  41 protected:
  42   enum G1CardValues {
  43     g1_young_gen = CT_MR_BS_last_reserved << 1
  44   };
  45 
  46   G1SATBCardTableModRefBS(MemRegion whole_heap, const BarrierSet::FakeRtti& fake_rtti);
  47   ~G1SATBCardTableModRefBS() { }
  48 
  49 public:


 166   virtual void resize_covered_region(MemRegion new_region) { ShouldNotReachHere(); }
 167 
 168   void write_ref_field_work(void* field, oop new_val, bool release = false);
 169 
 170   // Can be called from static contexts.
 171   static void write_ref_field_static(void* field, oop new_val);
 172 
 173   // NB: if you do a whole-heap invalidation, the "usual invariant" defined
 174   // above no longer applies.
 175   void invalidate(MemRegion mr, bool whole_heap = false);
 176 
 177   void write_region_work(MemRegion mr)    { invalidate(mr); }
 178   void write_ref_array_work(MemRegion mr) { invalidate(mr); }
 179 };
 180 
 181 template<>
 182 struct BarrierSet::GetName<G1SATBCardTableLoggingModRefBS> {
 183   static const BarrierSet::Name value = BarrierSet::G1SATBCTLogging;
 184 };
 185 
 186 #endif // SHARE_VM_GC_G1_G1SATBCARDTABLEMODREFBS_HPP
< prev index next >