< prev index next >

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

Print this page
rev 8362 : 8079792: GC directory structure cleanup
Reviewed-by:


   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_CARDTABLEMODREFBS_HPP
  26 #define SHARE_VM_MEMORY_CARDTABLEMODREFBS_HPP
  27 
  28 #include "memory/modRefBarrierSet.hpp"
  29 #include "oops/oop.hpp"
  30 
  31 // This kind of "BarrierSet" allows a "CollectedHeap" to detect and
  32 // enumerate ref fields that have been modified (since the last
  33 // enumeration.)
  34 
  35 // As it currently stands, this barrier is *imprecise*: when a ref field in
  36 // an object "o" is modified, the card table entry for the card containing
  37 // the head of "o" is dirtied, not necessarily the card containing the
  38 // modified field itself.  For object arrays, however, the barrier *is*
  39 // precise; only the card containing the modified element is dirtied.
  40 // Closures used to scan dirty cards should take these
  41 // considerations into account.
  42 
  43 class Generation;
  44 class OopsInGenClosure;
  45 class DirtyCardToOopClosure;
  46 class ClearNoncleanCardWrapper;
  47 class CardTableRS;
  48 


 448     CardTableModRefBS(
 449       whole_heap,
 450       // Concrete tag should be BarrierSet::CardTableForRS.
 451       // That will presently break things in a bunch of places though.
 452       // The concrete tag is used as a dispatch key in many places, and
 453       // CardTableForRS does not correctly dispatch in some of those
 454       // uses. This will be addressed as part of a reorganization of the
 455       // BarrierSet hierarchy.
 456       BarrierSet::FakeRtti(BarrierSet::CardTableModRef, 0).add_tag(BarrierSet::CardTableForRS))
 457     {}
 458 
 459   void set_CTRS(CardTableRS* rs) { _rs = rs; }
 460 };
 461 
 462 template<>
 463 struct BarrierSet::GetName<CardTableModRefBSForCTRS> {
 464   static const BarrierSet::Name value = BarrierSet::CardTableForRS;
 465 };
 466 
 467 
 468 #endif // SHARE_VM_MEMORY_CARDTABLEMODREFBS_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_SHARED_CARDTABLEMODREFBS_HPP
  26 #define SHARE_VM_GC_SHARED_CARDTABLEMODREFBS_HPP
  27 
  28 #include "gc/shared/modRefBarrierSet.hpp"
  29 #include "oops/oop.hpp"
  30 
  31 // This kind of "BarrierSet" allows a "CollectedHeap" to detect and
  32 // enumerate ref fields that have been modified (since the last
  33 // enumeration.)
  34 
  35 // As it currently stands, this barrier is *imprecise*: when a ref field in
  36 // an object "o" is modified, the card table entry for the card containing
  37 // the head of "o" is dirtied, not necessarily the card containing the
  38 // modified field itself.  For object arrays, however, the barrier *is*
  39 // precise; only the card containing the modified element is dirtied.
  40 // Closures used to scan dirty cards should take these
  41 // considerations into account.
  42 
  43 class Generation;
  44 class OopsInGenClosure;
  45 class DirtyCardToOopClosure;
  46 class ClearNoncleanCardWrapper;
  47 class CardTableRS;
  48 


 448     CardTableModRefBS(
 449       whole_heap,
 450       // Concrete tag should be BarrierSet::CardTableForRS.
 451       // That will presently break things in a bunch of places though.
 452       // The concrete tag is used as a dispatch key in many places, and
 453       // CardTableForRS does not correctly dispatch in some of those
 454       // uses. This will be addressed as part of a reorganization of the
 455       // BarrierSet hierarchy.
 456       BarrierSet::FakeRtti(BarrierSet::CardTableModRef, 0).add_tag(BarrierSet::CardTableForRS))
 457     {}
 458 
 459   void set_CTRS(CardTableRS* rs) { _rs = rs; }
 460 };
 461 
 462 template<>
 463 struct BarrierSet::GetName<CardTableModRefBSForCTRS> {
 464   static const BarrierSet::Name value = BarrierSet::CardTableForRS;
 465 };
 466 
 467 
 468 #endif // SHARE_VM_GC_SHARED_CARDTABLEMODREFBS_HPP
< prev index next >