455 assert(_whole_heap.contains(result), 456 err_msg("Returning result = "PTR_FORMAT" out of bounds of " 457 " card marking array's _whole_heap = ["PTR_FORMAT","PTR_FORMAT")", 458 result, _whole_heap.start(), _whole_heap.end())); 459 return result; 460 } 461 462 // Mapping from address to card marking array index. 463 size_t index_for(void* p) { 464 assert(_whole_heap.contains(p), 465 err_msg("Attempt to access p = "PTR_FORMAT" out of bounds of " 466 " card marking array's _whole_heap = ["PTR_FORMAT","PTR_FORMAT")", 467 p, _whole_heap.start(), _whole_heap.end())); 468 return byte_for(p) - _byte_map; 469 } 470 471 const jbyte* byte_for_index(const size_t card_index) const { 472 return _byte_map + card_index; 473 } 474 475 void verify(); 476 void verify_guard(); 477 478 // val_equals -> it will check that all cards covered by mr equal val 479 // !val_equals -> it will check that all cards covered by mr do not equal val 480 void verify_region(MemRegion mr, jbyte val, bool val_equals) PRODUCT_RETURN; 481 void verify_not_dirty_region(MemRegion mr) PRODUCT_RETURN; 482 void verify_dirty_region(MemRegion mr) PRODUCT_RETURN; 483 484 static size_t par_chunk_heapword_alignment() { 485 return ParGCCardsPerStrideChunk * card_size_in_words; 486 } 487 488 }; 489 490 class CardTableRS; 491 492 // A specialization for the CardTableRS gen rem set. 493 class CardTableModRefBSForCTRS: public CardTableModRefBS { 494 CardTableRS* _rs; | 455 assert(_whole_heap.contains(result), 456 err_msg("Returning result = "PTR_FORMAT" out of bounds of " 457 " card marking array's _whole_heap = ["PTR_FORMAT","PTR_FORMAT")", 458 result, _whole_heap.start(), _whole_heap.end())); 459 return result; 460 } 461 462 // Mapping from address to card marking array index. 463 size_t index_for(void* p) { 464 assert(_whole_heap.contains(p), 465 err_msg("Attempt to access p = "PTR_FORMAT" out of bounds of " 466 " card marking array's _whole_heap = ["PTR_FORMAT","PTR_FORMAT")", 467 p, _whole_heap.start(), _whole_heap.end())); 468 return byte_for(p) - _byte_map; 469 } 470 471 const jbyte* byte_for_index(const size_t card_index) const { 472 return _byte_map + card_index; 473 } 474 475 // Print a description of the memory for the barrier set 476 virtual void print_on(outputStream* st) const; 477 478 void verify(); 479 void verify_guard(); 480 481 // val_equals -> it will check that all cards covered by mr equal val 482 // !val_equals -> it will check that all cards covered by mr do not equal val 483 void verify_region(MemRegion mr, jbyte val, bool val_equals) PRODUCT_RETURN; 484 void verify_not_dirty_region(MemRegion mr) PRODUCT_RETURN; 485 void verify_dirty_region(MemRegion mr) PRODUCT_RETURN; 486 487 static size_t par_chunk_heapword_alignment() { 488 return ParGCCardsPerStrideChunk * card_size_in_words; 489 } 490 491 }; 492 493 class CardTableRS; 494 495 // A specialization for the CardTableRS gen rem set. 496 class CardTableModRefBSForCTRS: public CardTableModRefBS { 497 CardTableRS* _rs; |