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 * 23 */ 24 25 class AdjoiningGenerations; 26 class GCTaskManager; 27 class PSAdaptiveSizePolicy; 28 class GenerationSizer; 29 class CollectorPolicy; 30 31 class ParallelScavengeHeap : public CollectedHeap { 32 friend class VMStructs; 33 private: 34 static PSYoungGen* _young_gen; 35 static PSOldGen* _old_gen; 36 static PSPermGen* _perm_gen; 37 38 // Sizing policy for entire heap 39 static PSAdaptiveSizePolicy* _size_policy; 40 static PSGCAdaptivePolicyCounters* _gc_policy_counters; 41 42 static ParallelScavengeHeap* _psh; 43 44 size_t _perm_gen_alignment; 246 // Save the tops of the spaces in all generations 247 void record_gen_tops_before_GC() PRODUCT_RETURN; 248 249 // Mangle the unused parts of all spaces in the heap 250 void gen_mangle_unused_area() PRODUCT_RETURN; 251 252 // Call these in sequential code around the processing of strong roots. 253 class ParStrongRootsScope : public MarkingCodeBlobClosure::MarkScope { 254 public: 255 ParStrongRootsScope(); 256 ~ParStrongRootsScope(); 257 }; 258 }; 259 260 inline size_t ParallelScavengeHeap::set_alignment(size_t& var, size_t val) 261 { 262 assert(is_power_of_2((intptr_t)val), "must be a power of 2"); 263 var = round_to(val, intra_heap_alignment()); 264 return var; 265 } | 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 * 23 */ 24 25 #ifndef SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PARALLELSCAVENGEHEAP_HPP 26 #define SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PARALLELSCAVENGEHEAP_HPP 27 28 #include "gc_implementation/parallelScavenge/objectStartArray.hpp" 29 #include "gc_implementation/parallelScavenge/psGCAdaptivePolicyCounters.hpp" 30 #include "gc_implementation/parallelScavenge/psOldGen.hpp" 31 #include "gc_implementation/parallelScavenge/psPermGen.hpp" 32 #include "gc_implementation/parallelScavenge/psYoungGen.hpp" 33 #include "gc_implementation/shared/gcPolicyCounters.hpp" 34 #include "gc_interface/collectedHeap.inline.hpp" 35 #include "utilities/ostream.hpp" 36 37 class AdjoiningGenerations; 38 class GCTaskManager; 39 class PSAdaptiveSizePolicy; 40 class GenerationSizer; 41 class CollectorPolicy; 42 43 class ParallelScavengeHeap : public CollectedHeap { 44 friend class VMStructs; 45 private: 46 static PSYoungGen* _young_gen; 47 static PSOldGen* _old_gen; 48 static PSPermGen* _perm_gen; 49 50 // Sizing policy for entire heap 51 static PSAdaptiveSizePolicy* _size_policy; 52 static PSGCAdaptivePolicyCounters* _gc_policy_counters; 53 54 static ParallelScavengeHeap* _psh; 55 56 size_t _perm_gen_alignment; 258 // Save the tops of the spaces in all generations 259 void record_gen_tops_before_GC() PRODUCT_RETURN; 260 261 // Mangle the unused parts of all spaces in the heap 262 void gen_mangle_unused_area() PRODUCT_RETURN; 263 264 // Call these in sequential code around the processing of strong roots. 265 class ParStrongRootsScope : public MarkingCodeBlobClosure::MarkScope { 266 public: 267 ParStrongRootsScope(); 268 ~ParStrongRootsScope(); 269 }; 270 }; 271 272 inline size_t ParallelScavengeHeap::set_alignment(size_t& var, size_t val) 273 { 274 assert(is_power_of_2((intptr_t)val), "must be a power of 2"); 275 var = round_to(val, intra_heap_alignment()); 276 return var; 277 } 278 279 #endif // SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PARALLELSCAVENGEHEAP_HPP |