< prev index next >

src/share/vm/gc_implementation/parallelScavenge/psPromotionLAB.cpp

Print this page


   1 /*
   2  * Copyright (c) 2002, 2010, 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  *


 135 }
 136 
 137 #ifdef ASSERT
 138 
 139 bool PSYoungPromotionLAB::lab_is_valid(MemRegion lab) {
 140   ParallelScavengeHeap* heap = (ParallelScavengeHeap*)Universe::heap();
 141   assert(heap->kind() == CollectedHeap::ParallelScavengeHeap, "Sanity");
 142 
 143   MutableSpace* to_space = heap->young_gen()->to_space();
 144   MemRegion used = to_space->used_region();
 145   if (used.contains(lab)) {
 146     return true;
 147   }
 148 
 149   return false;
 150 }
 151 
 152 bool PSOldPromotionLAB::lab_is_valid(MemRegion lab) {
 153   ParallelScavengeHeap* heap = (ParallelScavengeHeap*)Universe::heap();
 154   assert(heap->kind() == CollectedHeap::ParallelScavengeHeap, "Sanity");
 155   assert(_start_array->covered_region().contains(lab), "Sanity");
 156 
 157   PSOldGen* old_gen = heap->old_gen();
 158   MemRegion used = old_gen->object_space()->used_region();











 159 
 160   if (used.contains(lab)) {
 161     return true;
 162   }
 163 
 164   return false;
 165 }
 166 
 167 #endif /* ASSERT */
   1 /*
   2  * Copyright (c) 2002, 2015, 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  *


 135 }
 136 
 137 #ifdef ASSERT
 138 
 139 bool PSYoungPromotionLAB::lab_is_valid(MemRegion lab) {
 140   ParallelScavengeHeap* heap = (ParallelScavengeHeap*)Universe::heap();
 141   assert(heap->kind() == CollectedHeap::ParallelScavengeHeap, "Sanity");
 142 
 143   MutableSpace* to_space = heap->young_gen()->to_space();
 144   MemRegion used = to_space->used_region();
 145   if (used.contains(lab)) {
 146     return true;
 147   }
 148 
 149   return false;
 150 }
 151 
 152 bool PSOldPromotionLAB::lab_is_valid(MemRegion lab) {
 153   ParallelScavengeHeap* heap = (ParallelScavengeHeap*)Universe::heap();
 154   assert(heap->kind() == CollectedHeap::ParallelScavengeHeap, "Sanity");
 155   MemRegion covered_region = _start_array->covered_region();
 156 
 157   PSOldGen* old_gen = heap->old_gen();
 158   MemRegion used = old_gen->object_space()->used_region();
 159 
 160   assert(covered_region.contains(lab),
 161          err_msg("Sanity - covered_region [ "PTR_FORMAT", "PTR_FORMAT" ], "
 162                  "lab [ "PTR_FORMAT", "PTR_FORMAT" ], "
 163                  "object space [ "PTR_FORMAT", "PTR_FORMAT" ]",
 164                  p2i(covered_region.start()),
 165                  p2i(covered_region.end()),
 166                  p2i(lab.start()),
 167                  p2i(lab.end()),
 168                  p2i(used.start()),
 169                  p2i(used.end())));
 170 
 171   if (used.contains(lab)) {
 172     return true;
 173   }
 174 
 175   return false;
 176 }
 177 
 178 #endif /* ASSERT */
< prev index next >