1.1 --- a/src/share/vm/gc_implementation/parallelScavenge/psScavenge.hpp Thu May 30 13:04:51 2013 -0700 1.2 +++ b/src/share/vm/gc_implementation/parallelScavenge/psScavenge.hpp Thu May 30 10:58:16 2013 +0200 1.3 @@ -62,19 +62,22 @@ 1.4 1.5 protected: 1.6 // Flags/counters 1.7 - static ReferenceProcessor* _ref_processor; // Reference processor for scavenging. 1.8 - static PSIsAliveClosure _is_alive_closure; // Closure used for reference processing 1.9 - static CardTableExtension* _card_table; // We cache the card table for fast access. 1.10 - static bool _survivor_overflow; // Overflow this collection 1.11 - static uint _tenuring_threshold; // tenuring threshold for next scavenge 1.12 - static elapsedTimer _accumulated_time; // total time spent on scavenge 1.13 - static HeapWord* _young_generation_boundary; // The lowest address possible for the young_gen. 1.14 - // This is used to decide if an oop should be scavenged, 1.15 - // cards should be marked, etc. 1.16 + static ReferenceProcessor* _ref_processor; // Reference processor for scavenging. 1.17 + static PSIsAliveClosure _is_alive_closure; // Closure used for reference processing 1.18 + static CardTableExtension* _card_table; // We cache the card table for fast access. 1.19 + static bool _survivor_overflow; // Overflow this collection 1.20 + static uint _tenuring_threshold; // tenuring threshold for next scavenge 1.21 + static elapsedTimer _accumulated_time; // total time spent on scavenge 1.22 + // The lowest address possible for the young_gen. 1.23 + // This is used to decide if an oop should be scavenged, 1.24 + // cards should be marked, etc. 1.25 + static HeapWord* _young_generation_boundary; 1.26 + // Used to optimize compressed oops young gen boundary checking. 1.27 + static uintptr_t _young_generation_boundary_compressed; 1.28 static Stack<markOop, mtGC> _preserved_mark_stack; // List of marks to be restored after failed promotion 1.29 static Stack<oop, mtGC> _preserved_oop_stack; // List of oops that need their mark restored. 1.30 - static CollectorCounters* _counters; // collector performance counters 1.31 - static bool _promotion_failed; 1.32 + static CollectorCounters* _counters; // collector performance counters 1.33 + static bool _promotion_failed; 1.34 1.35 static void clean_up_failed_promotion(); 1.36 1.37 @@ -112,6 +115,9 @@ 1.38 // boundary moves, _young_generation_boundary must be reset 1.39 static void set_young_generation_boundary(HeapWord* v) { 1.40 _young_generation_boundary = v; 1.41 + if (UseCompressedOops) { 1.42 + _young_generation_boundary_compressed = (uintptr_t)oopDesc::encode_heap_oop((oop)v); 1.43 + } 1.44 } 1.45 1.46 // Called by parallelScavengeHeap to init the tenuring threshold 1.47 @@ -140,11 +146,19 @@ 1.48 static void copy_and_push_safe_barrier_from_klass(PSPromotionManager* pm, oop* p); 1.49 1.50 // Is an object in the young generation 1.51 - // This assumes that the HeapWord argument is in the heap, 1.52 + // This assumes that the 'o' is in the heap, 1.53 // so it only checks one side of the complete predicate. 1.54 + 1.55 + inline static bool is_obj_in_young(oop o) { 1.56 + return (HeapWord*)o >= _young_generation_boundary; 1.57 + } 1.58 + 1.59 + inline static bool is_obj_in_young(narrowOop o) { 1.60 + return (uintptr_t)o >= _young_generation_boundary_compressed; 1.61 + } 1.62 + 1.63 inline static bool is_obj_in_young(HeapWord* o) { 1.64 - const bool result = (o >= _young_generation_boundary); 1.65 - return result; 1.66 + return o >= _young_generation_boundary; 1.67 } 1.68 }; 1.69