hotspot/src/share/vm/gc_implementation/g1/concurrentMark.inline.hpp
changeset 24424 2658d7834c6e
parent 22551 9bf46d16dcc6
child 26160 aba6b01cb988
equal deleted inserted replaced
24358:8528b67f6562 24424:2658d7834c6e
     1 /*
     1 /*
     2  * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.
     7  * published by the Free Software Foundation.
   275               _g1h->heap_region_containing((HeapWord*) objAddr)), "invariant");
   275               _g1h->heap_region_containing((HeapWord*) objAddr)), "invariant");
   276   assert(!_g1h->is_obj_ill(obj), "invariant");
   276   assert(!_g1h->is_obj_ill(obj), "invariant");
   277   assert(_nextMarkBitMap->isMarked(objAddr), "invariant");
   277   assert(_nextMarkBitMap->isMarked(objAddr), "invariant");
   278 
   278 
   279   if (_cm->verbose_high()) {
   279   if (_cm->verbose_high()) {
   280     gclog_or_tty->print_cr("[%u] pushing "PTR_FORMAT, _worker_id, (void*) obj);
   280     gclog_or_tty->print_cr("[%u] pushing " PTR_FORMAT, _worker_id, p2i((void*) obj));
   281   }
   281   }
   282 
   282 
   283   if (!_task_queue->push(obj)) {
   283   if (!_task_queue->push(obj)) {
   284     // The local task queue looks full. We need to push some entries
   284     // The local task queue looks full. We need to push some entries
   285     // to the global stack.
   285     // to the global stack.
   315 #define _CHECK_BOTH_FINGERS_      1
   315 #define _CHECK_BOTH_FINGERS_      1
   316 
   316 
   317 inline void CMTask::deal_with_reference(oop obj) {
   317 inline void CMTask::deal_with_reference(oop obj) {
   318   if (_cm->verbose_high()) {
   318   if (_cm->verbose_high()) {
   319     gclog_or_tty->print_cr("[%u] we're dealing with reference = "PTR_FORMAT,
   319     gclog_or_tty->print_cr("[%u] we're dealing with reference = "PTR_FORMAT,
   320                            _worker_id, (void*) obj);
   320                            _worker_id, p2i((void*) obj));
   321   }
   321   }
   322 
   322 
   323   ++_refs_reached;
   323   ++_refs_reached;
   324 
   324 
   325   HeapWord* objAddr = (HeapWord*) obj;
   325   HeapWord* objAddr = (HeapWord*) obj;
   332       // anything with it).
   332       // anything with it).
   333       HeapRegion* hr = _g1h->heap_region_containing_raw(obj);
   333       HeapRegion* hr = _g1h->heap_region_containing_raw(obj);
   334       if (!hr->obj_allocated_since_next_marking(obj)) {
   334       if (!hr->obj_allocated_since_next_marking(obj)) {
   335         if (_cm->verbose_high()) {
   335         if (_cm->verbose_high()) {
   336           gclog_or_tty->print_cr("[%u] "PTR_FORMAT" is not considered marked",
   336           gclog_or_tty->print_cr("[%u] "PTR_FORMAT" is not considered marked",
   337                                  _worker_id, (void*) obj);
   337                                  _worker_id, p2i((void*) obj));
   338         }
   338         }
   339 
   339 
   340         // we need to mark it first
   340         // we need to mark it first
   341         if (_cm->par_mark_and_count(obj, hr, _marked_bytes_array, _card_bm)) {
   341         if (_cm->par_mark_and_count(obj, hr, _marked_bytes_array, _card_bm)) {
   342           // No OrderAccess:store_load() is needed. It is implicit in the
   342           // No OrderAccess:store_load() is needed. It is implicit in the
   347           // we will check both the local and global fingers
   347           // we will check both the local and global fingers
   348 
   348 
   349           if (_finger != NULL && objAddr < _finger) {
   349           if (_finger != NULL && objAddr < _finger) {
   350             if (_cm->verbose_high()) {
   350             if (_cm->verbose_high()) {
   351               gclog_or_tty->print_cr("[%u] below the local finger ("PTR_FORMAT"), "
   351               gclog_or_tty->print_cr("[%u] below the local finger ("PTR_FORMAT"), "
   352                                      "pushing it", _worker_id, _finger);
   352                                      "pushing it", _worker_id, p2i(_finger));
   353             }
   353             }
   354             push(obj);
   354             push(obj);
   355           } else if (_curr_region != NULL && objAddr < _region_limit) {
   355           } else if (_curr_region != NULL && objAddr < _region_limit) {
   356             // do nothing
   356             // do nothing
   357           } else if (objAddr < global_finger) {
   357           } else if (objAddr < global_finger) {
   365             // correctness problems.
   365             // correctness problems.
   366 
   366 
   367             if (_cm->verbose_high()) {
   367             if (_cm->verbose_high()) {
   368               gclog_or_tty->print_cr("[%u] below the global finger "
   368               gclog_or_tty->print_cr("[%u] below the global finger "
   369                                      "("PTR_FORMAT"), pushing it",
   369                                      "("PTR_FORMAT"), pushing it",
   370                                      _worker_id, global_finger);
   370                                      _worker_id, p2i(global_finger));
   371             }
   371             }
   372             push(obj);
   372             push(obj);
   373           } else {
   373           } else {
   374             // do nothing
   374             // do nothing
   375           }
   375           }
   380             // see long comment above
   380             // see long comment above
   381 
   381 
   382             if (_cm->verbose_high()) {
   382             if (_cm->verbose_high()) {
   383               gclog_or_tty->print_cr("[%u] below the global finger "
   383               gclog_or_tty->print_cr("[%u] below the global finger "
   384                                      "("PTR_FORMAT"), pushing it",
   384                                      "("PTR_FORMAT"), pushing it",
   385                                      _worker_id, global_finger);
   385                                      _worker_id, p2i(global_finger));
   386             }
   386             }
   387             push(obj);
   387             push(obj);
   388           }
   388           }
   389 #endif // _CHECK_BOTH_FINGERS_
   389 #endif // _CHECK_BOTH_FINGERS_
   390         }
   390         }