< prev index next >

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

Print this page
rev 8362 : [mq]: hotspot


   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  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_implementation/g1/concurrentMark.inline.hpp"
  27 #include "gc_implementation/g1/dirtyCardQueue.hpp"
  28 #include "gc_implementation/g1/g1CollectedHeap.inline.hpp"
  29 #include "gc_implementation/g1/g1EvacFailure.hpp"
  30 #include "gc_implementation/g1/g1_globals.hpp"
  31 #include "gc_implementation/g1/g1OopClosures.inline.hpp"
  32 #include "gc_implementation/g1/heapRegion.hpp"
  33 #include "gc_implementation/g1/heapRegionRemSet.hpp"
  34 
  35 class UpdateRSetDeferred : public OopsInHeapRegionClosure {
  36 private:
  37   G1CollectedHeap* _g1;
  38   DirtyCardQueue *_dcq;
  39   G1SATBCardTableModRefBS* _ct_bs;
  40 
  41 public:
  42   UpdateRSetDeferred(G1CollectedHeap* g1, DirtyCardQueue* dcq) :
  43     _g1(g1), _ct_bs(_g1->g1_barrier_set()), _dcq(dcq) {}
  44 
  45   virtual void do_oop(narrowOop* p) { do_oop_work(p); }
  46   virtual void do_oop(      oop* p) { do_oop_work(p); }
  47   template <class T> void do_oop_work(T* p) {
  48     assert(_from->is_in_reserved(p), "paranoia");
  49     if (!_from->is_in_reserved(oopDesc::load_decode_heap_oop(p)) &&
  50         !_from->is_survivor()) {
  51       size_t card_index = _ct_bs->index_for(p);
  52       if (_ct_bs->mark_card_deferred(card_index)) {
  53         _dcq->enqueue((jbyte*)_ct_bs->byte_for_index(card_index));




   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  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/concurrentMark.inline.hpp"
  27 #include "gc/g1/dirtyCardQueue.hpp"
  28 #include "gc/g1/g1CollectedHeap.inline.hpp"
  29 #include "gc/g1/g1EvacFailure.hpp"
  30 #include "gc/g1/g1OopClosures.inline.hpp"
  31 #include "gc/g1/g1_globals.hpp"
  32 #include "gc/g1/heapRegion.hpp"
  33 #include "gc/g1/heapRegionRemSet.hpp"
  34 
  35 class UpdateRSetDeferred : public OopsInHeapRegionClosure {
  36 private:
  37   G1CollectedHeap* _g1;
  38   DirtyCardQueue *_dcq;
  39   G1SATBCardTableModRefBS* _ct_bs;
  40 
  41 public:
  42   UpdateRSetDeferred(G1CollectedHeap* g1, DirtyCardQueue* dcq) :
  43     _g1(g1), _ct_bs(_g1->g1_barrier_set()), _dcq(dcq) {}
  44 
  45   virtual void do_oop(narrowOop* p) { do_oop_work(p); }
  46   virtual void do_oop(      oop* p) { do_oop_work(p); }
  47   template <class T> void do_oop_work(T* p) {
  48     assert(_from->is_in_reserved(p), "paranoia");
  49     if (!_from->is_in_reserved(oopDesc::load_decode_heap_oop(p)) &&
  50         !_from->is_survivor()) {
  51       size_t card_index = _ct_bs->index_for(p);
  52       if (_ct_bs->mark_card_deferred(card_index)) {
  53         _dcq->enqueue((jbyte*)_ct_bs->byte_for_index(card_index));


< prev index next >