comparison src/share/vm/gc_implementation/parallelScavenge/psPromotionManager.inline.hpp @ 113:ba764ed4b6f2

6420645: Create a vm that uses compressed oops for up to 32gb heapsizes Summary: Compressed oops in instances, arrays, and headers. Code contributors are coleenp, phh, never, swamyv Reviewed-by: jmasa, kamg, acorn, tbell, kvn, rasbold
author coleenp
date Sun, 13 Apr 2008 17:43:42 -0400
parents a61af66fc99e
children d1605aabd0a1
comparison
equal deleted inserted replaced
110:a49a647afe9a 113:ba764ed4b6f2
26 assert(_manager_array != NULL, "access of NULL manager_array"); 26 assert(_manager_array != NULL, "access of NULL manager_array");
27 assert(index >= 0 && index <= (int)ParallelGCThreads, "out of range manager_array access"); 27 assert(index >= 0 && index <= (int)ParallelGCThreads, "out of range manager_array access");
28 return _manager_array[index]; 28 return _manager_array[index];
29 } 29 }
30 30
31 inline void PSPromotionManager::claim_or_forward_internal_depth(oop* p) { 31 template <class T>
32 if (p != NULL) { 32 inline void PSPromotionManager::claim_or_forward_internal_depth(T* p) {
33 oop o = *p; 33 if (p != NULL) { // XXX: error if p != NULL here
34 oop o = oopDesc::load_decode_heap_oop_not_null(p);
34 if (o->is_forwarded()) { 35 if (o->is_forwarded()) {
35 o = o->forwardee(); 36 o = o->forwardee();
36
37 // Card mark 37 // Card mark
38 if (PSScavenge::is_obj_in_young((HeapWord*) o)) { 38 if (PSScavenge::is_obj_in_young((HeapWord*) o)) {
39 PSScavenge::card_table()->inline_write_ref_field_gc(p, o); 39 PSScavenge::card_table()->inline_write_ref_field_gc(p, o);
40 } 40 }
41 *p = o; 41 oopDesc::encode_store_heap_oop_not_null(p, o);
42 } else { 42 } else {
43 push_depth(p); 43 push_depth(p);
44 } 44 }
45 } 45 }
46 } 46 }
47 47
48 inline void PSPromotionManager::claim_or_forward_internal_breadth(oop* p) { 48 template <class T>
49 if (p != NULL) { 49 inline void PSPromotionManager::claim_or_forward_internal_breadth(T* p) {
50 oop o = *p; 50 if (p != NULL) { // XXX: error if p != NULL here
51 oop o = oopDesc::load_decode_heap_oop_not_null(p);
51 if (o->is_forwarded()) { 52 if (o->is_forwarded()) {
52 o = o->forwardee(); 53 o = o->forwardee();
53 } else { 54 } else {
54 o = copy_to_survivor_space(o, false); 55 o = copy_to_survivor_space(o, false);
55 } 56 }
56
57 // Card mark 57 // Card mark
58 if (PSScavenge::is_obj_in_young((HeapWord*) o)) { 58 if (PSScavenge::is_obj_in_young((HeapWord*) o)) {
59 PSScavenge::card_table()->inline_write_ref_field_gc(p, o); 59 PSScavenge::card_table()->inline_write_ref_field_gc(p, o);
60 } 60 }
61 *p = o; 61 oopDesc::encode_store_heap_oop_not_null(p, o);
62 } 62 }
63 } 63 }
64 64
65 inline void PSPromotionManager::flush_prefetch_queue() { 65 inline void PSPromotionManager::flush_prefetch_queue() {
66 assert(!depth_first(), "invariant"); 66 assert(!depth_first(), "invariant");
67 for (int i=0; i<_prefetch_queue.length(); i++) { 67 for (int i = 0; i < _prefetch_queue.length(); i++) {
68 claim_or_forward_internal_breadth(_prefetch_queue.pop()); 68 claim_or_forward_internal_breadth((oop*)_prefetch_queue.pop());
69 } 69 }
70 } 70 }
71 71
72 inline void PSPromotionManager::claim_or_forward_depth(oop* p) { 72 template <class T>
73 inline void PSPromotionManager::claim_or_forward_depth(T* p) {
73 assert(depth_first(), "invariant"); 74 assert(depth_first(), "invariant");
74 assert(PSScavenge::should_scavenge(*p, true), "revisiting object?"); 75 assert(PSScavenge::should_scavenge(p, true), "revisiting object?");
75 assert(Universe::heap()->kind() == CollectedHeap::ParallelScavengeHeap, "Sanity"); 76 assert(Universe::heap()->kind() == CollectedHeap::ParallelScavengeHeap,
77 "Sanity");
76 assert(Universe::heap()->is_in(p), "pointer outside heap"); 78 assert(Universe::heap()->is_in(p), "pointer outside heap");
77 79
78 claim_or_forward_internal_depth(p); 80 claim_or_forward_internal_depth(p);
79 } 81 }
80 82
81 inline void PSPromotionManager::claim_or_forward_breadth(oop* p) { 83 template <class T>
84 inline void PSPromotionManager::claim_or_forward_breadth(T* p) {
82 assert(!depth_first(), "invariant"); 85 assert(!depth_first(), "invariant");
83 assert(PSScavenge::should_scavenge(*p, true), "revisiting object?"); 86 assert(PSScavenge::should_scavenge(p, true), "revisiting object?");
84 assert(Universe::heap()->kind() == CollectedHeap::ParallelScavengeHeap, "Sanity"); 87 assert(Universe::heap()->kind() == CollectedHeap::ParallelScavengeHeap,
88 "Sanity");
85 assert(Universe::heap()->is_in(p), "pointer outside heap"); 89 assert(Universe::heap()->is_in(p), "pointer outside heap");
86 90
87 if (UsePrefetchQueue) { 91 if (UsePrefetchQueue) {
88 claim_or_forward_internal_breadth(_prefetch_queue.push_and_pop(p)); 92 claim_or_forward_internal_breadth((T*)_prefetch_queue.push_and_pop(p));
89 } else { 93 } else {
90 // This option is used for testing. The use of the prefetch 94 // This option is used for testing. The use of the prefetch
91 // queue can delay the processing of the objects and thus 95 // queue can delay the processing of the objects and thus
92 // change the order of object scans. For example, remembered 96 // change the order of object scans. For example, remembered
93 // set updates are typically the clearing of the remembered 97 // set updates are typically the clearing of the remembered
104 // in the queue and the delay can be zero. 108 // in the queue and the delay can be zero.
105 claim_or_forward_internal_breadth(p); 109 claim_or_forward_internal_breadth(p);
106 } 110 }
107 } 111 }
108 112
109 inline void PSPromotionManager::process_popped_location_depth(oop* p) { 113 inline void PSPromotionManager::process_popped_location_depth(StarTask p) {
110 if (is_oop_masked(p)) { 114 if (is_oop_masked(p)) {
111 assert(PSChunkLargeArrays, "invariant"); 115 assert(PSChunkLargeArrays, "invariant");
112 oop const old = unmask_chunked_array_oop(p); 116 oop const old = unmask_chunked_array_oop(p);
113 process_array_chunk(old); 117 process_array_chunk(old);
114 } else { 118 } else {
115 PSScavenge::copy_and_push_safe_barrier(this, p); 119 if (p.is_narrow()) {
120 PSScavenge::copy_and_push_safe_barrier(this, (narrowOop*)p);
121 } else {
122 PSScavenge::copy_and_push_safe_barrier(this, (oop*)p);
123 }
116 } 124 }
117 } 125 }