本文整理汇总了C++中LiveRange::set_start方法的典型用法代码示例。如果您正苦于以下问题:C++ LiveRange::set_start方法的具体用法?C++ LiveRange::set_start怎么用?C++ LiveRange::set_start使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LiveRange
的用法示例。
在下文中一共展示了LiveRange::set_start方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: precompact
//.........这里部分代码省略.........
} else {
/* run over all the contiguous dead objects */
HeapWord* end = q;
do {
/* prefetch beyond end */
Prefetch::write(end, interval);
end += oop(end)->size();
} while (end < t && (!oop(end)->is_gc_marked()));
/* see if we might want to pretend this object is alive so that
* we don't have to compact quite as often.
*/
if (allowed_deadspace > 0 && q == compact_top) {
size_t sz = pointer_delta(end, q);
if (insert_deadspace(allowed_deadspace, q, sz)) {
size_t compaction_max_size = pointer_delta(compact_end, compact_top);
// This should only happen if a space in the young gen overflows the
// old gen. If that should happen, we null out the start_array, because
// the young spaces are not covered by one.
while (sz > compaction_max_size) {
// First record the last compact_top
dest->set_compaction_top(compact_top);
// Advance to the next compaction decorator
advance_destination_decorator();
dest = destination_decorator();
// Update compaction info
start_array = dest->start_array();
compact_top = dest->compaction_top();
compact_end = dest->space()->end();
assert(compact_top == dest->space()->bottom(), "Advanced to space already in use");
assert(compact_end > compact_top, "Must always be space remaining");
compaction_max_size =
pointer_delta(compact_end, compact_top);
}
// store the forwarding pointer into the mark word
if (q != compact_top) {
oop(q)->forward_to(oop(compact_top));
assert(oop(q)->is_gc_marked(), "encoding the pointer should preserve the mark");
} else {
// if the object isn't moving we can just set the mark to the default
// mark and handle it specially later on.
oop(q)->init_mark();
assert(oop(q)->forwardee() == NULL, "should be forwarded to NULL");
}
// Update object start array
if (start_array) {
start_array->allocate_block(compact_top);
}
VALIDATE_MARK_SWEEP_ONLY(MarkSweep::register_live_oop(oop(q), sz));
compact_top += sz;
assert(compact_top <= dest->space()->end(),
"Exceeding space in destination");
q = end;
end_of_live = end;
continue;
}
}
/* for the previous LiveRange, record the end of the live objects. */
if (liveRange) {
liveRange->set_end(q);
}
/* record the current LiveRange object.
* liveRange->start() is overlaid on the mark word.
*/
liveRange = (LiveRange*)q;
liveRange->set_start(end);
liveRange->set_end(end);
/* see if this is the first dead region. */
if (q < first_dead) {
first_dead = q;
}
/* move on to the next object */
q = end;
}
}
assert(q == t, "just checking");
if (liveRange != NULL) {
liveRange->set_end(q);
}
_end_of_live = end_of_live;
if (end_of_live < first_dead) {
first_dead = end_of_live;
}
_first_dead = first_dead;
// Update compaction top
dest->set_compaction_top(compact_top);
}