comparison src/share/vm/gc_implementation/parallelScavenge/psScavenge.inline.hpp @ 10370:47bdfb3d010f

8015486: PSScavenge::is_obj_in_young is unnecessarily slow with UseCompressedOops Summary: Compare compressed oops to a compressed young gen boundary instead of uncompressing the oops before doing the young gen boundary check. Reviewed-by: brutisso, jmasa
author stefank
date Thu, 30 May 2013 10:58:16 +0200
parents da91efe96a93
children 190899198332
comparison
equal deleted inserted replaced
10369:5534bd30c151 10370:47bdfb3d010f
37 _to_space_top_before_gc = heap->young_gen()->to_space()->top(); 37 _to_space_top_before_gc = heap->young_gen()->to_space()->top();
38 } 38 }
39 39
40 template <class T> inline bool PSScavenge::should_scavenge(T* p) { 40 template <class T> inline bool PSScavenge::should_scavenge(T* p) {
41 T heap_oop = oopDesc::load_heap_oop(p); 41 T heap_oop = oopDesc::load_heap_oop(p);
42 if (oopDesc::is_null(heap_oop)) return false; 42 return PSScavenge::is_obj_in_young(heap_oop);
43 oop obj = oopDesc::decode_heap_oop_not_null(heap_oop);
44 return PSScavenge::is_obj_in_young((HeapWord*)obj);
45 } 43 }
46 44
47 template <class T> 45 template <class T>
48 inline bool PSScavenge::should_scavenge(T* p, MutableSpace* to_space) { 46 inline bool PSScavenge::should_scavenge(T* p, MutableSpace* to_space) {
49 if (should_scavenge(p)) { 47 if (should_scavenge(p)) {
92 // We cannot mark without test, as some code passes us pointers 90 // We cannot mark without test, as some code passes us pointers
93 // that are outside the heap. These pointers are either from roots 91 // that are outside the heap. These pointers are either from roots
94 // or from metadata. 92 // or from metadata.
95 if ((!PSScavenge::is_obj_in_young((HeapWord*)p)) && 93 if ((!PSScavenge::is_obj_in_young((HeapWord*)p)) &&
96 Universe::heap()->is_in_reserved(p)) { 94 Universe::heap()->is_in_reserved(p)) {
97 if (PSScavenge::is_obj_in_young((HeapWord*)new_obj)) { 95 if (PSScavenge::is_obj_in_young(new_obj)) {
98 card_table()->inline_write_ref_field_gc(p, new_obj); 96 card_table()->inline_write_ref_field_gc(p, new_obj);
99 } 97 }
100 } 98 }
101 } 99 }
102 100
145 } else { 143 } else {
146 new_obj = _pm->copy_to_survivor_space</*promote_immediately=*/false>(o); 144 new_obj = _pm->copy_to_survivor_space</*promote_immediately=*/false>(o);
147 } 145 }
148 oopDesc::encode_store_heap_oop_not_null(p, new_obj); 146 oopDesc::encode_store_heap_oop_not_null(p, new_obj);
149 147
150 if (PSScavenge::is_obj_in_young((HeapWord*)new_obj)) { 148 if (PSScavenge::is_obj_in_young(new_obj)) {
151 do_klass_barrier(); 149 do_klass_barrier();
152 } 150 }
153 } 151 }
154 } 152 }
155 153