hotspot/src/share/vm/gc_implementation/parallelScavenge/psPromotionManager.inline.hpp
changeset 30566 18eb9aa972d0
parent 30173 13cf7580b000
equal deleted inserted replaced
30563:03c5eaa78f80 30566:18eb9aa972d0
    29 #include "gc_implementation/parallelScavenge/psOldGen.hpp"
    29 #include "gc_implementation/parallelScavenge/psOldGen.hpp"
    30 #include "gc_implementation/parallelScavenge/psPromotionManager.hpp"
    30 #include "gc_implementation/parallelScavenge/psPromotionManager.hpp"
    31 #include "gc_implementation/parallelScavenge/psPromotionLAB.inline.hpp"
    31 #include "gc_implementation/parallelScavenge/psPromotionLAB.inline.hpp"
    32 #include "gc_implementation/parallelScavenge/psScavenge.hpp"
    32 #include "gc_implementation/parallelScavenge/psScavenge.hpp"
    33 #include "oops/oop.inline.hpp"
    33 #include "oops/oop.inline.hpp"
       
    34 #include "utilities/taskqueue.inline.hpp"
    34 
    35 
    35 inline PSPromotionManager* PSPromotionManager::manager_array(int index) {
    36 inline PSPromotionManager* PSPromotionManager::manager_array(int index) {
    36   assert(_manager_array != NULL, "access of NULL manager_array");
    37   assert(_manager_array != NULL, "access of NULL manager_array");
    37   assert(index >= 0 && index <= (int)ParallelGCThreads, "out of range manager_array access");
    38   assert(index >= 0 && index <= (int)ParallelGCThreads, "out of range manager_array access");
    38   return &_manager_array[index];
    39   return &_manager_array[index];
       
    40 }
       
    41 
       
    42 template <class T>
       
    43 inline void PSPromotionManager::push_depth(T* p) {
       
    44   claimed_stack_depth()->push(p);
    39 }
    45 }
    40 
    46 
    41 template <class T>
    47 template <class T>
    42 inline void PSPromotionManager::claim_or_forward_internal_depth(T* p) {
    48 inline void PSPromotionManager::claim_or_forward_internal_depth(T* p) {
    43   if (p != NULL) { // XXX: error if p != NULL here
    49   if (p != NULL) { // XXX: error if p != NULL here
    97 // This method is pretty bulky. It would be nice to split it up
   103 // This method is pretty bulky. It would be nice to split it up
    98 // into smaller submethods, but we need to be careful not to hurt
   104 // into smaller submethods, but we need to be careful not to hurt
    99 // performance.
   105 // performance.
   100 //
   106 //
   101 template<bool promote_immediately>
   107 template<bool promote_immediately>
   102 oop PSPromotionManager::copy_to_survivor_space(oop o) {
   108 inline oop PSPromotionManager::copy_to_survivor_space(oop o) {
   103   assert(should_scavenge(&o), "Sanity");
   109   assert(should_scavenge(&o), "Sanity");
   104 
   110 
   105   oop new_obj = NULL;
   111   oop new_obj = NULL;
   106 
   112 
   107   // NOTE! We must be very careful with any methods that access the mark
   113   // NOTE! We must be very careful with any methods that access the mark
   315       copy_and_push_safe_barrier<oop, /*promote_immediately=*/false>(p);
   321       copy_and_push_safe_barrier<oop, /*promote_immediately=*/false>(p);
   316     }
   322     }
   317   }
   323   }
   318 }
   324 }
   319 
   325 
       
   326 inline bool PSPromotionManager::steal_depth(int queue_num, int* seed, StarTask& t) {
       
   327   return stack_array_depth()->steal(queue_num, seed, t);
       
   328 }
       
   329 
   320 #if TASKQUEUE_STATS
   330 #if TASKQUEUE_STATS
   321 void PSPromotionManager::record_steal(StarTask& p) {
   331 void PSPromotionManager::record_steal(StarTask& p) {
   322   if (is_oop_masked(p)) {
   332   if (is_oop_masked(p)) {
   323     ++_masked_steals;
   333     ++_masked_steals;
   324   }
   334   }