< prev index next >

src/share/vm/gc_implementation/g1/concurrentMark.inline.hpp

Print this page
rev 8126 : [mq]: filter
rev 8127 : [mq]: inc4

@@ -330,10 +330,23 @@
           // past this object. In this case, the object will probably
           // be visited when a task is scanning the region and will also
           // be pushed on the stack. So, some duplicate work, but no
           // correctness problems.
           if (is_below_finger(objAddr, global_finger)) {
+            if (obj->is_typeArray()) {
+              // Immediately process arrays of binary data, rather
+              // than pushing on the mark stack.  This keeps us from
+              // adding humongous objects to the mark stack that might
+              // be reclaimed before the entry is processed - see
+              // selection of candidates for eager reclaim of humongous
+              // objects.  The cost of the additional type test is
+              // mitigated by avoiding a trip through the mark stack,
+              // by only doing a bookkeeping update and avoiding the
+              // actual scan of the object - a typeArray contains no
+              // references, and the metadata is built-in.
+              process_grey_object<false>(obj);
+            } else {
             if (_cm->verbose_high()) {
               gclog_or_tty->print_cr("[%u] below a finger (local: " PTR_FORMAT
                                      ", global: " PTR_FORMAT ") pushing "
                                      PTR_FORMAT " on mark stack",
                                      _worker_id, p2i(_finger),

@@ -343,10 +356,11 @@
           }
         }
       }
     }
   }
+  }
 }
 
 inline void ConcurrentMark::markPrev(oop p) {
   assert(!_prevMarkBitMap->isMarked((HeapWord*) p), "sanity");
   // Note we are overriding the read-only view of the prev map here, via
< prev index next >