162 }
163 compact_top = cp->space->bottom();
164 cp->space->set_compaction_top(compact_top);
165 // The correct adjusted_size may not be the same as that for this method
166 // (i.e., cp->space may no longer be "this" so adjust the size again.
167 // Use the virtual method which is not used above to save the virtual
168 // dispatch.
169 adjusted_size = cp->space->adjust_object_size_v(size);
170 compaction_max_size = pointer_delta(cp->space->end(), compact_top);
171 assert(cp->space->minimum_free_block_size() == 0, "just checking");
172 } while (adjusted_size > compaction_max_size);
173 }
174
175 // store the forwarding pointer into the mark word
176 if ((HeapWord*)q != compact_top) {
177 q->forward_to(oop(compact_top));
178 assert(q->is_gc_marked(), "encoding the pointer should preserve the mark");
179 } else {
180 // if the object isn't moving we can just set the mark to the default
181 // mark and handle it specially later on.
182 q->init_mark();
183 assert(q->forwardee() == NULL, "should be forwarded to NULL");
184 }
185
186 compact_top += adjusted_size;
187
188 // we need to update the offset table so that the beginnings of objects can be
189 // found during scavenge. Note that we are updating the offset table based on
190 // where the object will be once the compaction phase finishes.
191
192 // Always call cross_threshold(). A contiguous space can only call it when
193 // the compaction_top exceeds the current threshold but not for an
194 // non-contiguous space.
195 cp->threshold =
196 cp->space->cross_threshold(compact_top - adjusted_size, compact_top);
197 return compact_top;
198 }
199
200 // A modified copy of OffsetTableContigSpace::cross_threshold() with _offsets -> _bt
201 // and use of single_block instead of alloc_block. The name here is not really
202 // appropriate - maybe a more general name could be invented for both the
|
162 }
163 compact_top = cp->space->bottom();
164 cp->space->set_compaction_top(compact_top);
165 // The correct adjusted_size may not be the same as that for this method
166 // (i.e., cp->space may no longer be "this" so adjust the size again.
167 // Use the virtual method which is not used above to save the virtual
168 // dispatch.
169 adjusted_size = cp->space->adjust_object_size_v(size);
170 compaction_max_size = pointer_delta(cp->space->end(), compact_top);
171 assert(cp->space->minimum_free_block_size() == 0, "just checking");
172 } while (adjusted_size > compaction_max_size);
173 }
174
175 // store the forwarding pointer into the mark word
176 if ((HeapWord*)q != compact_top) {
177 q->forward_to(oop(compact_top));
178 assert(q->is_gc_marked(), "encoding the pointer should preserve the mark");
179 } else {
180 // if the object isn't moving we can just set the mark to the default
181 // mark and handle it specially later on.
182 q->init_mark_raw();
183 assert(q->forwardee() == NULL, "should be forwarded to NULL");
184 }
185
186 compact_top += adjusted_size;
187
188 // we need to update the offset table so that the beginnings of objects can be
189 // found during scavenge. Note that we are updating the offset table based on
190 // where the object will be once the compaction phase finishes.
191
192 // Always call cross_threshold(). A contiguous space can only call it when
193 // the compaction_top exceeds the current threshold but not for an
194 // non-contiguous space.
195 cp->threshold =
196 cp->space->cross_threshold(compact_top - adjusted_size, compact_top);
197 return compact_top;
198 }
199
200 // A modified copy of OffsetTableContigSpace::cross_threshold() with _offsets -> _bt
201 // and use of single_block instead of alloc_block. The name here is not really
202 // appropriate - maybe a more general name could be invented for both the
|