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 // This kind of "BarrierSet" allows a "CollectedHeap" to detect and 26 // enumerate ref fields that have been modified (since the last 27 // enumeration.) 28 29 // As it currently stands, this barrier is *imprecise*: when a ref field in 30 // an object "o" is modified, the card table entry for the card containing 31 // the head of "o" is dirtied, not necessarily the card containing the 32 // modified field itself. For object arrays, however, the barrier *is* 33 // precise; only the card containing the modified element is dirtied. 34 // Any MemRegionClosures used to scan dirty cards should take these 35 // considerations into account. 36 37 class Generation; 38 class OopsInGenClosure; 39 class DirtyCardToOopClosure; 40 41 class CardTableModRefBS: public ModRefBarrierSet { 42 // Some classes get to look at some private stuff. 43 friend class BytecodeInterpreter; 44 friend class VMStructs; 473 return CardsPerStrideChunk * card_size_in_words; 474 } 475 476 }; 477 478 class CardTableRS; 479 480 // A specialization for the CardTableRS gen rem set. 481 class CardTableModRefBSForCTRS: public CardTableModRefBS { 482 CardTableRS* _rs; 483 protected: 484 bool card_will_be_scanned(jbyte cv); 485 bool card_may_have_been_dirty(jbyte cv); 486 public: 487 CardTableModRefBSForCTRS(MemRegion whole_heap, 488 int max_covered_regions) : 489 CardTableModRefBS(whole_heap, max_covered_regions) {} 490 491 void set_CTRS(CardTableRS* rs) { _rs = rs; } 492 }; | 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 #include "oops/oop.inline2.hpp" 31 32 // This kind of "BarrierSet" allows a "CollectedHeap" to detect and 33 // enumerate ref fields that have been modified (since the last 34 // enumeration.) 35 36 // As it currently stands, this barrier is *imprecise*: when a ref field in 37 // an object "o" is modified, the card table entry for the card containing 38 // the head of "o" is dirtied, not necessarily the card containing the 39 // modified field itself. For object arrays, however, the barrier *is* 40 // precise; only the card containing the modified element is dirtied. 41 // Any MemRegionClosures used to scan dirty cards should take these 42 // considerations into account. 43 44 class Generation; 45 class OopsInGenClosure; 46 class DirtyCardToOopClosure; 47 48 class CardTableModRefBS: public ModRefBarrierSet { 49 // Some classes get to look at some private stuff. 50 friend class BytecodeInterpreter; 51 friend class VMStructs; 480 return CardsPerStrideChunk * card_size_in_words; 481 } 482 483 }; 484 485 class CardTableRS; 486 487 // A specialization for the CardTableRS gen rem set. 488 class CardTableModRefBSForCTRS: public CardTableModRefBS { 489 CardTableRS* _rs; 490 protected: 491 bool card_will_be_scanned(jbyte cv); 492 bool card_may_have_been_dirty(jbyte cv); 493 public: 494 CardTableModRefBSForCTRS(MemRegion whole_heap, 495 int max_covered_regions) : 496 CardTableModRefBS(whole_heap, max_covered_regions) {} 497 498 void set_CTRS(CardTableRS* rs) { _rs = rs; } 499 }; 500 501 #endif // SHARE_VM_MEMORY_CARDTABLEMODREFBS_HPP |