void ReceiverTypeData::oop_iterate_m(OopClosure* blk, MemRegion mr) { // Currently, this interface is called only during card-scanning for // a young gen gc, in which case this object cannot contribute anything, // since it does not contain any references that cross out of // the perm gen. However, for future more general use we allow // the possibility of calling for instance from more general // iterators (for example, a future regionalized perm gen for G1, // or the possibility of moving some references out of perm in // the case of other collectors). In that case, you will need // to relax or remove some of the assertions below. #ifdef ASSERT // Verify that none of the embedded oop references cross out of // this generation. for (uint row = 0; row < row_limit(); row++) { if (receiver(row) != NULL) { oop* adr = adr_receiver(row); CollectedHeap* h = Universe::heap(); assert(h->is_permanent(adr) && h->is_permanent_or_null(*adr), "Not intra-perm"); } } #endif // ASSERT assert(!blk->should_remember_mdo(), "Not expected to remember MDO"); return; // Nothing to do, see comment above #if 0 if (blk->should_remember_mdo()) { // This is a set of weak references that need // to be followed at the end of the strong marking // phase. Memoize this object so it can be visited // in the weak roots processing phase. blk->remember_mdo(data()); } else { // normal scan for (uint row = 0; row < row_limit(); row++) { if (receiver(row) != NULL) { oop* adr = adr_receiver(row); if (mr.contains(adr)) { blk->do_oop(adr); } else if ((HeapWord*)adr >= mr.end()) { // Test that the current cursor and the two ends of the range // that we may have skipped iterating over are monotonically ordered; // this is just a paranoid assertion, just in case represetations // should change in the future rendering the short-circuit return // here invalid. assert((row+1 >= row_limit() || adr_receiver(row+1) > adr) && (row+2 >= row_limit() || adr_receiver(row_limit()-1) > adr_receiver(row+1)), "Reducing?"); break; // remaining should be outside this mr too } } } } #endif }
void ReceiverTypeData::update_pointers() { for (uint row = 0; row < row_limit(); row++) { if (receiver_unchecked(row) != NULL) { PSParallelCompact::adjust_pointer(adr_receiver(row)); } } }
void ReceiverTypeData::adjust_pointers() { for (uint row = 0; row < row_limit(); row++) { if (receiver(row) != NULL) { MarkSweep::adjust_pointer(adr_receiver(row)); } } }
void VirtualCallData::oop_iterate(OopClosure* blk) { for (uint row = 0; row < row_limit(); row++) { if (receiver(row) != NULL) { blk->do_oop(adr_receiver(row)); } } }
void VirtualCallData::follow_contents() { for (uint row = 0; row < row_limit(); row++) { if (receiver(row) != NULL) { MarkSweep::mark_and_push(adr_receiver(row)); } } }
void ReceiverTypeData::update_pointers(HeapWord* beg_addr, HeapWord* end_addr) { // The loop bounds could be computed based on beg_addr/end_addr and the // boundary test hoisted outside the loop (see klassVTable for an example); // however, row_limit() is small enough (2) to make that less efficient. for (uint row = 0; row < row_limit(); row++) { if (receiver_unchecked(row) != NULL) { PSParallelCompact::adjust_pointer(adr_receiver(row), beg_addr, end_addr); } } }
void VirtualCallData::oop_iterate_m(OopClosure* blk, MemRegion mr) { for (uint row = 0; row < row_limit(); row++) { if (receiver(row) != NULL) { oop* adr = adr_receiver(row); if (mr.contains(adr)) { blk->do_oop(adr); } } } }
void ReceiverTypeData::oop_iterate(OopClosure* blk) { if (blk->should_remember_mdo()) { // This is a set of weak references that need // to be followed at the end of the strong marking // phase. Memoize this object so it can be visited // in the weak roots processing phase. blk->remember_mdo(data()); } else { // normal scan for (uint row = 0; row < row_limit(); row++) { if (receiver(row) != NULL) { oop* adr = adr_receiver(row); blk->do_oop(adr); } } } }