< prev index next >

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

Print this page
rev 8362 : [mq]: hotspot
   1 /*
   2  * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   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_MEMORY_CARDTABLERS_HPP
  26 #define SHARE_VM_MEMORY_CARDTABLERS_HPP
  27 
  28 #include "memory/cardTableModRefBS.hpp"
  29 #include "memory/genRemSet.hpp"
  30 #include "memory/memRegion.hpp"
  31 
  32 class Space;
  33 class OopsInGenClosure;
  34 
  35 // This kind of "GenRemSet" uses a card table both as shared data structure
  36 // for a mod ref barrier set and for the rem set information.
  37 
  38 class CardTableRS: public GenRemSet {
  39   friend class VMStructs;
  40   // Below are private classes used in impl.
  41   friend class VerifyCTSpaceClosure;
  42   friend class ClearNoncleanCardWrapper;
  43 
  44   static jbyte clean_card_val() {
  45     return CardTableModRefBS::clean_card;
  46   }
  47 
  48   static intptr_t clean_card_row() {
  49     return CardTableModRefBS::clean_card_row;


 170 
 171 class ClearNoncleanCardWrapper: public MemRegionClosure {
 172   DirtyCardToOopClosure* _dirty_card_closure;
 173   CardTableRS* _ct;
 174   bool _is_par;
 175 private:
 176   // Clears the given card, return true if the corresponding card should be
 177   // processed.
 178   inline bool clear_card(jbyte* entry);
 179   // Work methods called by the clear_card()
 180   inline bool clear_card_serial(jbyte* entry);
 181   inline bool clear_card_parallel(jbyte* entry);
 182   // check alignment of pointer
 183   bool is_word_aligned(jbyte* entry);
 184 
 185 public:
 186   ClearNoncleanCardWrapper(DirtyCardToOopClosure* dirty_card_closure, CardTableRS* ct);
 187   void do_MemRegion(MemRegion mr);
 188 };
 189 
 190 #endif // SHARE_VM_MEMORY_CARDTABLERS_HPP
   1 /*
   2  * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   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_SHARED_CARDTABLERS_HPP
  26 #define SHARE_VM_GC_SHARED_CARDTABLERS_HPP
  27 
  28 #include "gc/shared/cardTableModRefBS.hpp"
  29 #include "gc/shared/genRemSet.hpp"
  30 #include "memory/memRegion.hpp"
  31 
  32 class Space;
  33 class OopsInGenClosure;
  34 
  35 // This kind of "GenRemSet" uses a card table both as shared data structure
  36 // for a mod ref barrier set and for the rem set information.
  37 
  38 class CardTableRS: public GenRemSet {
  39   friend class VMStructs;
  40   // Below are private classes used in impl.
  41   friend class VerifyCTSpaceClosure;
  42   friend class ClearNoncleanCardWrapper;
  43 
  44   static jbyte clean_card_val() {
  45     return CardTableModRefBS::clean_card;
  46   }
  47 
  48   static intptr_t clean_card_row() {
  49     return CardTableModRefBS::clean_card_row;


 170 
 171 class ClearNoncleanCardWrapper: public MemRegionClosure {
 172   DirtyCardToOopClosure* _dirty_card_closure;
 173   CardTableRS* _ct;
 174   bool _is_par;
 175 private:
 176   // Clears the given card, return true if the corresponding card should be
 177   // processed.
 178   inline bool clear_card(jbyte* entry);
 179   // Work methods called by the clear_card()
 180   inline bool clear_card_serial(jbyte* entry);
 181   inline bool clear_card_parallel(jbyte* entry);
 182   // check alignment of pointer
 183   bool is_word_aligned(jbyte* entry);
 184 
 185 public:
 186   ClearNoncleanCardWrapper(DirtyCardToOopClosure* dirty_card_closure, CardTableRS* ct);
 187   void do_MemRegion(MemRegion mr);
 188 };
 189 
 190 #endif // SHARE_VM_GC_SHARED_CARDTABLERS_HPP
< prev index next >