comparison src/share/vm/gc_implementation/g1/concurrentMark.inline.hpp @ 6862:8a5ea0a9ccc4

7127708: G1: change task num types from int to uint in concurrent mark Summary: Change the type of various task num fields, parameters etc to unsigned and rename them to be more consistent with the other collectors. Code changes were also reviewed by Vitaly Davidovich. Reviewed-by: johnc Contributed-by: Kaushik Srenevasan <kaushik@twitter.com>
author johnc
date Sat, 06 Oct 2012 01:17:44 -0700
parents 988bf00cc564
children 9def4075da6d
comparison
equal deleted inserted replaced
6830:81e878c53615 6862:8a5ea0a9ccc4
277 _g1h->heap_region_containing((HeapWord*) objAddr)), "invariant"); 277 _g1h->heap_region_containing((HeapWord*) objAddr)), "invariant");
278 assert(!_g1h->is_obj_ill(obj), "invariant"); 278 assert(!_g1h->is_obj_ill(obj), "invariant");
279 assert(_nextMarkBitMap->isMarked(objAddr), "invariant"); 279 assert(_nextMarkBitMap->isMarked(objAddr), "invariant");
280 280
281 if (_cm->verbose_high()) { 281 if (_cm->verbose_high()) {
282 gclog_or_tty->print_cr("[%d] pushing "PTR_FORMAT, _task_id, (void*) obj); 282 gclog_or_tty->print_cr("[%u] pushing "PTR_FORMAT, _worker_id, (void*) obj);
283 } 283 }
284 284
285 if (!_task_queue->push(obj)) { 285 if (!_task_queue->push(obj)) {
286 // The local task queue looks full. We need to push some entries 286 // The local task queue looks full. We need to push some entries
287 // to the global stack. 287 // to the global stack.
288 288
289 if (_cm->verbose_medium()) { 289 if (_cm->verbose_medium()) {
290 gclog_or_tty->print_cr("[%d] task queue overflow, " 290 gclog_or_tty->print_cr("[%u] task queue overflow, "
291 "moving entries to the global stack", 291 "moving entries to the global stack",
292 _task_id); 292 _worker_id);
293 } 293 }
294 move_entries_to_global_stack(); 294 move_entries_to_global_stack();
295 295
296 // this should succeed since, even if we overflow the global 296 // this should succeed since, even if we overflow the global
297 // stack, we should have definitely removed some entries from the 297 // stack, we should have definitely removed some entries from the
316 316
317 #define _CHECK_BOTH_FINGERS_ 1 317 #define _CHECK_BOTH_FINGERS_ 1
318 318
319 inline void CMTask::deal_with_reference(oop obj) { 319 inline void CMTask::deal_with_reference(oop obj) {
320 if (_cm->verbose_high()) { 320 if (_cm->verbose_high()) {
321 gclog_or_tty->print_cr("[%d] we're dealing with reference = "PTR_FORMAT, 321 gclog_or_tty->print_cr("[%u] we're dealing with reference = "PTR_FORMAT,
322 _task_id, (void*) obj); 322 _worker_id, (void*) obj);
323 } 323 }
324 324
325 ++_refs_reached; 325 ++_refs_reached;
326 326
327 HeapWord* objAddr = (HeapWord*) obj; 327 HeapWord* objAddr = (HeapWord*) obj;
333 // bitmap (otherwise, it's a waste of time since we won't do 333 // bitmap (otherwise, it's a waste of time since we won't do
334 // anything with it). 334 // anything with it).
335 HeapRegion* hr = _g1h->heap_region_containing_raw(obj); 335 HeapRegion* hr = _g1h->heap_region_containing_raw(obj);
336 if (!hr->obj_allocated_since_next_marking(obj)) { 336 if (!hr->obj_allocated_since_next_marking(obj)) {
337 if (_cm->verbose_high()) { 337 if (_cm->verbose_high()) {
338 gclog_or_tty->print_cr("[%d] "PTR_FORMAT" is not considered marked", 338 gclog_or_tty->print_cr("[%u] "PTR_FORMAT" is not considered marked",
339 _task_id, (void*) obj); 339 _worker_id, (void*) obj);
340 } 340 }
341 341
342 // we need to mark it first 342 // we need to mark it first
343 if (_cm->par_mark_and_count(obj, hr, _marked_bytes_array, _card_bm)) { 343 if (_cm->par_mark_and_count(obj, hr, _marked_bytes_array, _card_bm)) {
344 // No OrderAccess:store_load() is needed. It is implicit in the 344 // No OrderAccess:store_load() is needed. It is implicit in the
348 #if _CHECK_BOTH_FINGERS_ 348 #if _CHECK_BOTH_FINGERS_
349 // we will check both the local and global fingers 349 // we will check both the local and global fingers
350 350
351 if (_finger != NULL && objAddr < _finger) { 351 if (_finger != NULL && objAddr < _finger) {
352 if (_cm->verbose_high()) { 352 if (_cm->verbose_high()) {
353 gclog_or_tty->print_cr("[%d] below the local finger ("PTR_FORMAT"), " 353 gclog_or_tty->print_cr("[%u] below the local finger ("PTR_FORMAT"), "
354 "pushing it", _task_id, _finger); 354 "pushing it", _worker_id, _finger);
355 } 355 }
356 push(obj); 356 push(obj);
357 } else if (_curr_region != NULL && objAddr < _region_limit) { 357 } else if (_curr_region != NULL && objAddr < _region_limit) {
358 // do nothing 358 // do nothing
359 } else if (objAddr < global_finger) { 359 } else if (objAddr < global_finger) {
365 // be visited when a task is scanning the region and will also 365 // be visited when a task is scanning the region and will also
366 // be pushed on the stack. So, some duplicate work, but no 366 // be pushed on the stack. So, some duplicate work, but no
367 // correctness problems. 367 // correctness problems.
368 368
369 if (_cm->verbose_high()) { 369 if (_cm->verbose_high()) {
370 gclog_or_tty->print_cr("[%d] below the global finger " 370 gclog_or_tty->print_cr("[%u] below the global finger "
371 "("PTR_FORMAT"), pushing it", 371 "("PTR_FORMAT"), pushing it",
372 _task_id, global_finger); 372 _worker_id, global_finger);
373 } 373 }
374 push(obj); 374 push(obj);
375 } else { 375 } else {
376 // do nothing 376 // do nothing
377 } 377 }
380 380
381 if (objAddr < global_finger) { 381 if (objAddr < global_finger) {
382 // see long comment above 382 // see long comment above
383 383
384 if (_cm->verbose_high()) { 384 if (_cm->verbose_high()) {
385 gclog_or_tty->print_cr("[%d] below the global finger " 385 gclog_or_tty->print_cr("[%u] below the global finger "
386 "("PTR_FORMAT"), pushing it", 386 "("PTR_FORMAT"), pushing it",
387 _task_id, global_finger); 387 _worker_id, global_finger);
388 } 388 }
389 push(obj); 389 push(obj);
390 } 390 }
391 #endif // _CHECK_BOTH_FINGERS_ 391 #endif // _CHECK_BOTH_FINGERS_
392 } 392 }