src/share/vm/gc_implementation/parallelScavenge/psPromotionManager.hpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File nmethods-gc-ps Sdiff src/share/vm/gc_implementation/parallelScavenge

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

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  *


 154   static PSPromotionManager* gc_thread_promotion_manager(int index);
 155   static PSPromotionManager* vm_thread_promotion_manager();
 156 
 157   static bool steal_depth(int queue_num, int* seed, StarTask& t) {
 158     return stack_array_depth()->steal(queue_num, seed, t);
 159   }
 160 
 161   PSPromotionManager();
 162 
 163   // Accessors
 164   OopStarTaskQueue* claimed_stack_depth() {
 165     return &_claimed_stack_depth;
 166   }
 167 
 168   bool young_gen_is_full()             { return _young_gen_is_full; }
 169 
 170   bool old_gen_is_full()               { return _old_gen_is_full; }
 171   void set_old_gen_is_full(bool state) { _old_gen_is_full = state; }
 172 
 173   // Promotion methods
 174   oop copy_to_survivor_space(oop o);
 175   oop oop_promotion_failed(oop obj, markOop obj_mark);
 176 
 177   void reset();
 178 
 179   void flush_labs();
 180   void drain_stacks(bool totally_drain) {
 181     drain_stacks_depth(totally_drain);
 182   }
 183  public:
 184   void drain_stacks_cond_depth() {
 185     if (claimed_stack_depth()->size() > _target_stack_size) {
 186       drain_stacks_depth(false);
 187     }
 188   }
 189   void drain_stacks_depth(bool totally_drain);
 190 
 191   bool stacks_empty() {
 192     return claimed_stack_depth()->is_empty();
 193   }
 194 
   1 /*
   2  * Copyright (c) 2002, 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  *


 154   static PSPromotionManager* gc_thread_promotion_manager(int index);
 155   static PSPromotionManager* vm_thread_promotion_manager();
 156 
 157   static bool steal_depth(int queue_num, int* seed, StarTask& t) {
 158     return stack_array_depth()->steal(queue_num, seed, t);
 159   }
 160 
 161   PSPromotionManager();
 162 
 163   // Accessors
 164   OopStarTaskQueue* claimed_stack_depth() {
 165     return &_claimed_stack_depth;
 166   }
 167 
 168   bool young_gen_is_full()             { return _young_gen_is_full; }
 169 
 170   bool old_gen_is_full()               { return _old_gen_is_full; }
 171   void set_old_gen_is_full(bool state) { _old_gen_is_full = state; }
 172 
 173   // Promotion methods
 174   template<bool promote_immediately> oop copy_to_survivor_space(oop o);
 175   oop oop_promotion_failed(oop obj, markOop obj_mark);
 176 
 177   void reset();
 178 
 179   void flush_labs();
 180   void drain_stacks(bool totally_drain) {
 181     drain_stacks_depth(totally_drain);
 182   }
 183  public:
 184   void drain_stacks_cond_depth() {
 185     if (claimed_stack_depth()->size() > _target_stack_size) {
 186       drain_stacks_depth(false);
 187     }
 188   }
 189   void drain_stacks_depth(bool totally_drain);
 190 
 191   bool stacks_empty() {
 192     return claimed_stack_depth()->is_empty();
 193   }
 194 
src/share/vm/gc_implementation/parallelScavenge/psPromotionManager.hpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File