108 cld->oops_do(&mark_and_push_closure, &follow_klass_closure, true);
109 }
110
111 inline void ParCompactionManager::follow_contents(oop obj) {
112 assert(PSParallelCompact::mark_bitmap()->is_marked(obj), "should be marked");
113 obj->pc_follow_contents(this);
114 }
115
116 template <class T>
117 inline void oop_pc_follow_contents_specialized(objArrayOop obj, int index, ParCompactionManager* cm) {
118 const size_t len = size_t(obj->length());
119 const size_t beg_index = size_t(index);
120 assert(beg_index < len || len == 0, "index too large");
121
122 const size_t stride = MIN2(len - beg_index, ObjArrayMarkingStride);
123 const size_t end_index = beg_index + stride;
124 T* const base = (T*)obj->base();
125 T* const beg = base + beg_index;
126 T* const end = base + end_index;
127
128 // Push the non-NULL elements of the next stride on the marking stack.
129 for (T* e = beg; e < end; e++) {
130 cm->mark_and_push<T>(e);
131 }
132
133 if (end_index < len) {
134 cm->push_objarray(obj, end_index); // Push the continuation.
135 }
136 }
137
138 inline void ParCompactionManager::follow_contents(objArrayOop obj, int index) {
139 if (UseCompressedOops) {
140 oop_pc_follow_contents_specialized<narrowOop>(obj, index, this);
141 } else {
142 oop_pc_follow_contents_specialized<oop>(obj, index, this);
143 }
144 }
145
146 inline void ParCompactionManager::update_contents(oop obj) {
147 obj->pc_update_contents(this);
148 }
149
150 #endif // SHARE_VM_GC_PARALLEL_PSCOMPACTIONMANAGER_INLINE_HPP
|
108 cld->oops_do(&mark_and_push_closure, &follow_klass_closure, true);
109 }
110
111 inline void ParCompactionManager::follow_contents(oop obj) {
112 assert(PSParallelCompact::mark_bitmap()->is_marked(obj), "should be marked");
113 obj->pc_follow_contents(this);
114 }
115
116 template <class T>
117 inline void oop_pc_follow_contents_specialized(objArrayOop obj, int index, ParCompactionManager* cm) {
118 const size_t len = size_t(obj->length());
119 const size_t beg_index = size_t(index);
120 assert(beg_index < len || len == 0, "index too large");
121
122 const size_t stride = MIN2(len - beg_index, ObjArrayMarkingStride);
123 const size_t end_index = beg_index + stride;
124 T* const base = (T*)obj->base();
125 T* const beg = base + beg_index;
126 T* const end = base + end_index;
127
128 if (end_index < len) {
129 cm->push_objarray(obj, end_index); // Push the continuation.
130 }
131
132 // Push the non-NULL elements of the next stride on the marking stack.
133 for (T* e = beg; e < end; e++) {
134 cm->mark_and_push<T>(e);
135 }
136 }
137
138 inline void ParCompactionManager::follow_contents(objArrayOop obj, int index) {
139 if (UseCompressedOops) {
140 oop_pc_follow_contents_specialized<narrowOop>(obj, index, this);
141 } else {
142 oop_pc_follow_contents_specialized<oop>(obj, index, this);
143 }
144 }
145
146 inline void ParCompactionManager::update_contents(oop obj) {
147 obj->pc_update_contents(this);
148 }
149
150 #endif // SHARE_VM_GC_PARALLEL_PSCOMPACTIONMANAGER_INLINE_HPP
|