< prev index next >

src/hotspot/share/gc/parallel/psCardTable.cpp

Print this page




 183       return; // We're done.
 184 
 185     CardValue* worker_end_card = worker_start_card + ssize;
 186     if (worker_end_card > end_card)
 187       worker_end_card = end_card;
 188 
 189     // We do not want to scan objects more than once. In order to accomplish
 190     // this, we assert that any object with an object head inside our 'slice'
 191     // belongs to us. We may need to extend the range of scanned cards if the
 192     // last object continues into the next 'slice'.
 193     //
 194     // Note! ending cards are exclusive!
 195     HeapWord* slice_start = addr_for(worker_start_card);
 196     HeapWord* slice_end = MIN2((HeapWord*) sp_top, addr_for(worker_end_card));
 197 
 198 #ifdef ASSERT
 199     if (GCWorkerDelayMillis > 0) {
 200       // Delay 1 worker so that it proceeds after all the work
 201       // has been completed.
 202       if (stripe_number < 2) {
 203         os::sleep(Thread::current(), GCWorkerDelayMillis, false);
 204       }
 205     }
 206 #endif
 207 
 208     // If there are not objects starting within the chunk, skip it.
 209     if (!start_array->object_starts_in_range(slice_start, slice_end)) {
 210       continue;
 211     }
 212     // Update our beginning addr
 213     HeapWord* first_object = start_array->object_start(slice_start);
 214     debug_only(oop* first_object_within_slice = (oop*) first_object;)
 215     if (first_object < slice_start) {
 216       last_scanned = (oop*)(first_object + oop(first_object)->size());
 217       debug_only(first_object_within_slice = last_scanned;)
 218       worker_start_card = byte_for(last_scanned);
 219     }
 220 
 221     // Update the ending addr
 222     if (slice_end < (HeapWord*)sp_top) {
 223       // The subtraction is important! An object may start precisely at slice_end.




 183       return; // We're done.
 184 
 185     CardValue* worker_end_card = worker_start_card + ssize;
 186     if (worker_end_card > end_card)
 187       worker_end_card = end_card;
 188 
 189     // We do not want to scan objects more than once. In order to accomplish
 190     // this, we assert that any object with an object head inside our 'slice'
 191     // belongs to us. We may need to extend the range of scanned cards if the
 192     // last object continues into the next 'slice'.
 193     //
 194     // Note! ending cards are exclusive!
 195     HeapWord* slice_start = addr_for(worker_start_card);
 196     HeapWord* slice_end = MIN2((HeapWord*) sp_top, addr_for(worker_end_card));
 197 
 198 #ifdef ASSERT
 199     if (GCWorkerDelayMillis > 0) {
 200       // Delay 1 worker so that it proceeds after all the work
 201       // has been completed.
 202       if (stripe_number < 2) {
 203         os::naked_sleep(GCWorkerDelayMillis);
 204       }
 205     }
 206 #endif
 207 
 208     // If there are not objects starting within the chunk, skip it.
 209     if (!start_array->object_starts_in_range(slice_start, slice_end)) {
 210       continue;
 211     }
 212     // Update our beginning addr
 213     HeapWord* first_object = start_array->object_start(slice_start);
 214     debug_only(oop* first_object_within_slice = (oop*) first_object;)
 215     if (first_object < slice_start) {
 216       last_scanned = (oop*)(first_object + oop(first_object)->size());
 217       debug_only(first_object_within_slice = last_scanned;)
 218       worker_start_card = byte_for(last_scanned);
 219     }
 220 
 221     // Update the ending addr
 222     if (slice_end < (HeapWord*)sp_top) {
 223       // The subtraction is important! An object may start precisely at slice_end.


< prev index next >