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

Print this page




   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 #include "incls/_precompiled.incl"
  26 #include "incls/_psPromotionManager.cpp.incl"







  27 
  28 PSPromotionManager**         PSPromotionManager::_manager_array = NULL;
  29 OopStarTaskQueueSet*         PSPromotionManager::_stack_array_depth = NULL;
  30 PSOldGen*                    PSPromotionManager::_old_gen = NULL;
  31 MutableSpace*                PSPromotionManager::_young_space = NULL;
  32 
  33 void PSPromotionManager::initialize() {
  34   ParallelScavengeHeap* heap = (ParallelScavengeHeap*)Universe::heap();
  35   assert(heap->kind() == CollectedHeap::ParallelScavengeHeap, "Sanity");
  36 
  37   _old_gen = heap->old_gen();
  38   _young_space = heap->young_gen()->to_space();
  39 
  40   assert(_manager_array == NULL, "Attempt to initialize twice");
  41   _manager_array = NEW_C_HEAP_ARRAY(PSPromotionManager*, ParallelGCThreads+1 );
  42   guarantee(_manager_array != NULL, "Could not initialize promotion manager");
  43 
  44   _stack_array_depth = new OopStarTaskQueueSet(ParallelGCThreads);
  45   guarantee(_stack_array_depth != NULL, "Cound not initialize promotion manager");
  46 




   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 #include "precompiled.hpp"
  26 #include "gc_implementation/parallelScavenge/parallelScavengeHeap.hpp"
  27 #include "gc_implementation/parallelScavenge/psOldGen.hpp"
  28 #include "gc_implementation/parallelScavenge/psPromotionManager.inline.hpp"
  29 #include "gc_implementation/parallelScavenge/psScavenge.inline.hpp"
  30 #include "gc_implementation/shared/mutableSpace.hpp"
  31 #include "memory/memRegion.hpp"
  32 #include "oops/oop.inline.hpp"
  33 #include "oops/oop.psgc.inline.hpp"
  34 
  35 PSPromotionManager**         PSPromotionManager::_manager_array = NULL;
  36 OopStarTaskQueueSet*         PSPromotionManager::_stack_array_depth = NULL;
  37 PSOldGen*                    PSPromotionManager::_old_gen = NULL;
  38 MutableSpace*                PSPromotionManager::_young_space = NULL;
  39 
  40 void PSPromotionManager::initialize() {
  41   ParallelScavengeHeap* heap = (ParallelScavengeHeap*)Universe::heap();
  42   assert(heap->kind() == CollectedHeap::ParallelScavengeHeap, "Sanity");
  43 
  44   _old_gen = heap->old_gen();
  45   _young_space = heap->young_gen()->to_space();
  46 
  47   assert(_manager_array == NULL, "Attempt to initialize twice");
  48   _manager_array = NEW_C_HEAP_ARRAY(PSPromotionManager*, ParallelGCThreads+1 );
  49   guarantee(_manager_array != NULL, "Could not initialize promotion manager");
  50 
  51   _stack_array_depth = new OopStarTaskQueueSet(ParallelGCThreads);
  52   guarantee(_stack_array_depth != NULL, "Cound not initialize promotion manager");
  53