src/share/vm/gc_implementation/g1/g1EvacFailure.hpp

Print this page
rev 3985 : 7132678: G1: verify that the marking bitmaps have no marks for objects over TAMS
Summary: Verify that parts of the marking bitmaps that should not have marks do not have marks, i.e., the parts of the bitmap that cover [TAMS:top) areas for each heap region.
Reviewed-by:
   1 /*
   2  * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   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
   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  *


 174 
 175     assert(!hr->isHumongous(), "sanity");
 176     assert(hr->in_collection_set(), "bad CS");
 177 
 178     if (hr->claimHeapRegion(HeapRegion::ParEvacFailureClaimValue)) {
 179       if (hr->evacuation_failed()) {
 180         RemoveSelfForwardPtrObjClosure rspc(_g1h, _cm, hr, _update_rset_cl,
 181                                             during_initial_mark,
 182                                             during_conc_mark,
 183                                             _worker_id);
 184 
 185         MemRegion mr(hr->bottom(), hr->end());
 186         // We'll recreate the prev marking info so we'll first clear
 187         // the prev bitmap range for this region. We never mark any
 188         // CSet objects explicitly so the next bitmap range should be
 189         // cleared anyway.
 190         _cm->clearRangePrevBitmap(mr);
 191 
 192         hr->note_self_forwarding_removal_start(during_initial_mark,
 193                                                during_conc_mark);

 194 
 195         // In the common case (i.e. when there is no evacuation
 196         // failure) we make sure that the following is done when
 197         // the region is freed so that it is "ready-to-go" when it's
 198         // re-allocated. However, when evacuation failure happens, a
 199         // region will remain in the heap and might ultimately be added
 200         // to a CSet in the future. So we have to be careful here and
 201         // make sure the region's RSet is ready for parallel iteration
 202         // whenever this might be required in the future.
 203         hr->rem_set()->reset_for_par_iteration();
 204         hr->reset_bot();
 205         _update_rset_cl->set_region(hr);
 206         hr->object_iterate(&rspc);
 207 
 208         hr->note_self_forwarding_removal_end(during_initial_mark,
 209                                              during_conc_mark,
 210                                              rspc.marked_bytes());
 211       }
 212     }
 213     return false;


   1 /*
   2  * Copyright (c) 2012, 2013 Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   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
   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  *


 174 
 175     assert(!hr->isHumongous(), "sanity");
 176     assert(hr->in_collection_set(), "bad CS");
 177 
 178     if (hr->claimHeapRegion(HeapRegion::ParEvacFailureClaimValue)) {
 179       if (hr->evacuation_failed()) {
 180         RemoveSelfForwardPtrObjClosure rspc(_g1h, _cm, hr, _update_rset_cl,
 181                                             during_initial_mark,
 182                                             during_conc_mark,
 183                                             _worker_id);
 184 
 185         MemRegion mr(hr->bottom(), hr->end());
 186         // We'll recreate the prev marking info so we'll first clear
 187         // the prev bitmap range for this region. We never mark any
 188         // CSet objects explicitly so the next bitmap range should be
 189         // cleared anyway.
 190         _cm->clearRangePrevBitmap(mr);
 191 
 192         hr->note_self_forwarding_removal_start(during_initial_mark,
 193                                                during_conc_mark);
 194         _g1h->check_bitmaps("Self-Forwarding Ptr Removal", hr);
 195 
 196         // In the common case (i.e. when there is no evacuation
 197         // failure) we make sure that the following is done when
 198         // the region is freed so that it is "ready-to-go" when it's
 199         // re-allocated. However, when evacuation failure happens, a
 200         // region will remain in the heap and might ultimately be added
 201         // to a CSet in the future. So we have to be careful here and
 202         // make sure the region's RSet is ready for parallel iteration
 203         // whenever this might be required in the future.
 204         hr->rem_set()->reset_for_par_iteration();
 205         hr->reset_bot();
 206         _update_rset_cl->set_region(hr);
 207         hr->object_iterate(&rspc);
 208 
 209         hr->note_self_forwarding_removal_end(during_initial_mark,
 210                                              during_conc_mark,
 211                                              rspc.marked_bytes());
 212       }
 213     }
 214     return false;