< prev index next >

src/share/vm/gc/g1/g1ConcurrentMarkObjArrayProcessor.cpp

Print this page
rev 12666 : imported patch 8168467-use-taskentry-as-mark-stack-elem
rev 12667 : imported patch 8168467-kim-review


  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 
  25 #include "precompiled.hpp"
  26 #include "gc/g1/g1ConcurrentMark.inline.hpp"
  27 #include "gc/g1/g1ConcurrentMarkObjArrayProcessor.inline.hpp"
  28 
  29 void G1CMObjArrayProcessor::push_array_slice(HeapWord* what) {
  30   G1TaskQueueEntry entry(what);
  31   _task->push(entry);
  32 }
  33 
  34 size_t G1CMObjArrayProcessor::process_array_slice(objArrayOop obj, HeapWord* start_from, size_t remaining) {
  35   size_t words_to_scan = MIN2(remaining, ObjArrayMarkingStride);
  36 
  37   if (remaining > ObjArrayMarkingStride) {
  38     push_array_slice(start_from + ObjArrayMarkingStride);
  39   }
  40 
  41   // Then process current area.
  42   MemRegion mr(start_from, words_to_scan);
  43   return _task->scan_objArray(obj, mr);
  44 }
  45 
  46 size_t G1CMObjArrayProcessor::process_obj(oop obj) {
  47   assert(should_be_sliced(obj), "Must be an array object %d and large " SIZE_FORMAT, obj->is_objArray(), (size_t)obj->size());
  48 
  49   return process_array_slice(objArrayOop(obj), (HeapWord*)obj, (size_t)objArrayOop(obj)->size());
  50 }
  51 




  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 
  25 #include "precompiled.hpp"
  26 #include "gc/g1/g1ConcurrentMark.inline.hpp"
  27 #include "gc/g1/g1ConcurrentMarkObjArrayProcessor.inline.hpp"
  28 
  29 void G1CMObjArrayProcessor::push_array_slice(HeapWord* what) {
  30   _task->push(G1TaskQueueEntry::from_slice(what));

  31 }
  32 
  33 size_t G1CMObjArrayProcessor::process_array_slice(objArrayOop obj, HeapWord* start_from, size_t remaining) {
  34   size_t words_to_scan = MIN2(remaining, ObjArrayMarkingStride);
  35 
  36   if (remaining > ObjArrayMarkingStride) {
  37     push_array_slice(start_from + ObjArrayMarkingStride);
  38   }
  39 
  40   // Then process current area.
  41   MemRegion mr(start_from, words_to_scan);
  42   return _task->scan_objArray(obj, mr);
  43 }
  44 
  45 size_t G1CMObjArrayProcessor::process_obj(oop obj) {
  46   assert(should_be_sliced(obj), "Must be an array object %d and large " SIZE_FORMAT, obj->is_objArray(), (size_t)obj->size());
  47 
  48   return process_array_slice(objArrayOop(obj), (HeapWord*)obj, (size_t)objArrayOop(obj)->size());
  49 }
  50 


< prev index next >