< prev index next >

src/share/vm/memory/cardTableModRefBS.hpp

Print this page
rev 7318 : 8064721: The card tables only ever need two covering regions


 267 public:
 268   // Constants
 269   enum SomePublicConstants {
 270     card_shift                  = 9,
 271     card_size                   = 1 << card_shift,
 272     card_size_in_words          = card_size / sizeof(HeapWord)
 273   };
 274 
 275   static int clean_card_val()      { return clean_card; }
 276   static int clean_card_mask_val() { return clean_card_mask; }
 277   static int dirty_card_val()      { return dirty_card; }
 278   static int claimed_card_val()    { return claimed_card; }
 279   static int precleaned_card_val() { return precleaned_card; }
 280   static int deferred_card_val()   { return deferred_card; }
 281 
 282   // For RTTI simulation.
 283   bool is_a(BarrierSet::Name bsn) {
 284     return bsn == BarrierSet::CardTableModRef || ModRefBarrierSet::is_a(bsn);
 285   }
 286 
 287   CardTableModRefBS(MemRegion whole_heap, int max_covered_regions);
 288   ~CardTableModRefBS();
 289 
 290   virtual void initialize();
 291 
 292   // *** Barrier set functions.
 293 
 294   bool has_write_ref_pre_barrier() { return false; }
 295 
 296   // Record a reference update. Note that these versions are precise!
 297   // The scanning code has to handle the fact that the write barrier may be
 298   // either precise or imprecise. We make non-virtual inline variants of
 299   // these functions here for performance.
 300 protected:
 301   void write_ref_field_work(oop obj, size_t offset, oop newVal);
 302   virtual void write_ref_field_work(void* field, oop newVal, bool release = false);
 303 public:
 304 
 305   bool has_write_ref_array_opt() { return true; }
 306   bool has_write_region_opt() { return true; }
 307 


 465   // !val_equals -> it will check that all cards covered by mr do not equal val
 466   void verify_region(MemRegion mr, jbyte val, bool val_equals) PRODUCT_RETURN;
 467   void verify_not_dirty_region(MemRegion mr) PRODUCT_RETURN;
 468   void verify_dirty_region(MemRegion mr) PRODUCT_RETURN;
 469 
 470   static size_t par_chunk_heapword_alignment() {
 471     return ParGCCardsPerStrideChunk * card_size_in_words;
 472   }
 473 
 474 };
 475 
 476 class CardTableRS;
 477 
 478 // A specialization for the CardTableRS gen rem set.
 479 class CardTableModRefBSForCTRS: public CardTableModRefBS {
 480   CardTableRS* _rs;
 481 protected:
 482   bool card_will_be_scanned(jbyte cv);
 483   bool card_may_have_been_dirty(jbyte cv);
 484 public:
 485   CardTableModRefBSForCTRS(MemRegion whole_heap,
 486                            int max_covered_regions) :
 487     CardTableModRefBS(whole_heap, max_covered_regions) {}
 488 
 489   void set_CTRS(CardTableRS* rs) { _rs = rs; }
 490 };
 491 
 492 
 493 #endif // SHARE_VM_MEMORY_CARDTABLEMODREFBS_HPP


 267 public:
 268   // Constants
 269   enum SomePublicConstants {
 270     card_shift                  = 9,
 271     card_size                   = 1 << card_shift,
 272     card_size_in_words          = card_size / sizeof(HeapWord)
 273   };
 274 
 275   static int clean_card_val()      { return clean_card; }
 276   static int clean_card_mask_val() { return clean_card_mask; }
 277   static int dirty_card_val()      { return dirty_card; }
 278   static int claimed_card_val()    { return claimed_card; }
 279   static int precleaned_card_val() { return precleaned_card; }
 280   static int deferred_card_val()   { return deferred_card; }
 281 
 282   // For RTTI simulation.
 283   bool is_a(BarrierSet::Name bsn) {
 284     return bsn == BarrierSet::CardTableModRef || ModRefBarrierSet::is_a(bsn);
 285   }
 286 
 287   CardTableModRefBS(MemRegion whole_heap);
 288   ~CardTableModRefBS();
 289 
 290   virtual void initialize();
 291 
 292   // *** Barrier set functions.
 293 
 294   bool has_write_ref_pre_barrier() { return false; }
 295 
 296   // Record a reference update. Note that these versions are precise!
 297   // The scanning code has to handle the fact that the write barrier may be
 298   // either precise or imprecise. We make non-virtual inline variants of
 299   // these functions here for performance.
 300 protected:
 301   void write_ref_field_work(oop obj, size_t offset, oop newVal);
 302   virtual void write_ref_field_work(void* field, oop newVal, bool release = false);
 303 public:
 304 
 305   bool has_write_ref_array_opt() { return true; }
 306   bool has_write_region_opt() { return true; }
 307 


 465   // !val_equals -> it will check that all cards covered by mr do not equal val
 466   void verify_region(MemRegion mr, jbyte val, bool val_equals) PRODUCT_RETURN;
 467   void verify_not_dirty_region(MemRegion mr) PRODUCT_RETURN;
 468   void verify_dirty_region(MemRegion mr) PRODUCT_RETURN;
 469 
 470   static size_t par_chunk_heapword_alignment() {
 471     return ParGCCardsPerStrideChunk * card_size_in_words;
 472   }
 473 
 474 };
 475 
 476 class CardTableRS;
 477 
 478 // A specialization for the CardTableRS gen rem set.
 479 class CardTableModRefBSForCTRS: public CardTableModRefBS {
 480   CardTableRS* _rs;
 481 protected:
 482   bool card_will_be_scanned(jbyte cv);
 483   bool card_may_have_been_dirty(jbyte cv);
 484 public:
 485   CardTableModRefBSForCTRS(MemRegion whole_heap) :
 486     CardTableModRefBS(whole_heap) {}

 487 
 488   void set_CTRS(CardTableRS* rs) { _rs = rs; }
 489 };
 490 
 491 
 492 #endif // SHARE_VM_MEMORY_CARDTABLEMODREFBS_HPP
< prev index next >