< prev index next >

src/hotspot/share/gc/parallel/psParallelCompact.cpp

Print this page


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


 866     oop referent = CompressedOops::decode_not_null(heap_oop);
 867     return PSParallelCompact::mark_bitmap()->is_unmarked(referent)
 868         && ReferenceProcessor::discover_reference(obj, type);
 869   }
 870   virtual bool discover_reference(oop obj, ReferenceType type) {
 871     if (UseCompressedOops) {
 872       return discover<narrowOop>(obj, type);
 873     } else {
 874       return discover<oop>(obj, type);
 875     }
 876   }
 877 };
 878 
 879 void PSParallelCompact::post_initialize() {
 880   ParallelScavengeHeap* heap = ParallelScavengeHeap::heap();
 881   _span_based_discoverer.set_span(heap->reserved_region());
 882   _ref_processor =
 883     new PCReferenceProcessor(&_span_based_discoverer,
 884                              &_is_alive_closure); // non-header is alive closure
 885 
 886   _counters = new CollectorCounters("PSParallelCompact", 1);
 887 
 888   // Initialize static fields in ParCompactionManager.
 889   ParCompactionManager::initialize(mark_bitmap());
 890 }
 891 
 892 bool PSParallelCompact::initialize() {
 893   ParallelScavengeHeap* heap = ParallelScavengeHeap::heap();
 894   MemRegion mr = heap->reserved_region();
 895 
 896   // Was the old gen get allocated successfully?
 897   if (!heap->old_gen()->is_allocated()) {
 898     return false;
 899   }
 900 
 901   initialize_space_info();
 902   initialize_dead_wood_limiter();
 903 
 904   if (!_mark_bitmap.initialize(mr)) {
 905     vm_shutdown_during_initialization(
 906       err_msg("Unable to allocate " SIZE_FORMAT "KB bitmaps for parallel "


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


 866     oop referent = CompressedOops::decode_not_null(heap_oop);
 867     return PSParallelCompact::mark_bitmap()->is_unmarked(referent)
 868         && ReferenceProcessor::discover_reference(obj, type);
 869   }
 870   virtual bool discover_reference(oop obj, ReferenceType type) {
 871     if (UseCompressedOops) {
 872       return discover<narrowOop>(obj, type);
 873     } else {
 874       return discover<oop>(obj, type);
 875     }
 876   }
 877 };
 878 
 879 void PSParallelCompact::post_initialize() {
 880   ParallelScavengeHeap* heap = ParallelScavengeHeap::heap();
 881   _span_based_discoverer.set_span(heap->reserved_region());
 882   _ref_processor =
 883     new PCReferenceProcessor(&_span_based_discoverer,
 884                              &_is_alive_closure); // non-header is alive closure
 885 
 886   _counters = new CollectorCounters("Parallel full collection pauses", 1);
 887 
 888   // Initialize static fields in ParCompactionManager.
 889   ParCompactionManager::initialize(mark_bitmap());
 890 }
 891 
 892 bool PSParallelCompact::initialize() {
 893   ParallelScavengeHeap* heap = ParallelScavengeHeap::heap();
 894   MemRegion mr = heap->reserved_region();
 895 
 896   // Was the old gen get allocated successfully?
 897   if (!heap->old_gen()->is_allocated()) {
 898     return false;
 899   }
 900 
 901   initialize_space_info();
 902   initialize_dead_wood_limiter();
 903 
 904   if (!_mark_bitmap.initialize(mr)) {
 905     vm_shutdown_during_initialization(
 906       err_msg("Unable to allocate " SIZE_FORMAT "KB bitmaps for parallel "


< prev index next >