本文整理汇总了C++中oop::age方法的典型用法代码示例。如果您正苦于以下问题:C++ oop::age方法的具体用法?C++ oop::age怎么用?C++ oop::age使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类oop
的用法示例。
在下文中一共展示了oop::age方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
bool G1StringDedup::is_candidate_from_evacuation(bool from_young, bool to_young, oop obj) {
if (from_young && java_lang_String::is_instance(obj)) {
if (to_young && obj->age() == StringDeduplicationAgeThreshold) {
// Candidate found. String is being evacuated from young to young and just
// reached the deduplication age threshold.
return true;
}
if (!to_young && obj->age() < StringDeduplicationAgeThreshold) {
// Candidate found. String is being evacuated from young to old but has not
// reached the deduplication age threshold, i.e. has not previously been a
// candidate during its life in the young generation.
return true;
}
}
// Not a candidate
return false;
}
示例2: copy_to_survivor_space
oop DefNewGeneration::copy_to_survivor_space(oop old, oop* from) {
assert(is_in_reserved(old) && !old->is_forwarded(),
"shouldn't be scavenging this oop");
size_t s = old->size();
oop obj = NULL;
// Try allocating obj in to-space (unless too old or won't fit or JVMPI
// enabled)
if (old->age() < tenuring_threshold() &&
!Universe::jvmpi_slow_allocation()) {
obj = (oop) to()->allocate(s);
}
// Otherwise try allocating obj tenured
if (obj == NULL) {
obj = _next_gen->promote(old, s, from);
if (obj == NULL) {
// A failed promotion likely means the MaxLiveObjectEvacuationRatio flag
// is incorrectly set. In any case, its seriously wrong to be here!
vm_exit_out_of_memory(s*wordSize, "promotion");
}
} else {
// Prefetch beyond obj
const intx interval = PrefetchCopyIntervalInBytes;
atomic::prefetch_write(obj, interval);
// Copy obj
Memory::copy_words_aligned((HeapWord*)old, (HeapWord*)obj, s);
// Increment age if obj still in new generation
obj->incr_age();
age_table()->add(obj, s);
}
if (Universe::jvmpi_move_event_enabled()) {
Universe::jvmpi_object_move(old, obj);
}
// Done, insert forward pointer to obj in this header
old->forward_to(obj);
return obj;
}
示例3: copy_to_survivor_space
oop DefNewGeneration::copy_to_survivor_space(oop old) {
assert(is_in_reserved(old) && !old->is_forwarded(),
"shouldn't be scavenging this oop");
size_t s = old->size();
oop obj = NULL;
// Try allocating obj in to-space (unless too old)
if (old->age() < tenuring_threshold()) {
obj = (oop) to()->allocate(s);
}
// Otherwise try allocating obj tenured
if (obj == NULL) {
obj = _next_gen->promote(old, s);
if (obj == NULL) {
if (!HandlePromotionFailure) {
// A failed promotion likely means the MaxLiveObjectEvacuationRatio flag
// is incorrectly set. In any case, its seriously wrong to be here!
vm_exit_out_of_memory(s*wordSize, "promotion");
}
handle_promotion_failure(old);
return old;
}
} else {
// Prefetch beyond obj
const intx interval = PrefetchCopyIntervalInBytes;
Prefetch::write(obj, interval);
// Copy obj
Copy::aligned_disjoint_words((HeapWord*)old, (HeapWord*)obj, s);
// Increment age if obj still in new generation
obj->incr_age();
age_table()->add(obj, s);
}
// Done, insert forward pointer to obj in this header
old->forward_to(obj);
return obj;
}
示例4: copy_to_survivor_space
oop DefNewGeneration::copy_to_survivor_space(oop old) {
assert(is_in_reserved(old) && !old->is_forwarded(),
"shouldn't be scavenging this oop");
size_t s = old->size();
oop obj = NULL;
// Try allocating obj in to-space (unless too old)
if (old->age() < tenuring_threshold()) {
obj = (oop) to()->allocate(s);
}
// Otherwise try allocating obj tenured
if (obj == NULL) {
obj = _next_gen->promote(old, s);
if (obj == NULL) {
handle_promotion_failure(old);
return old;
}
} else {
// Prefetch beyond obj
const intx interval = PrefetchCopyIntervalInBytes;
Prefetch::write(obj, interval);
// Copy obj
Copy::aligned_disjoint_words((HeapWord*)old, (HeapWord*)obj, s);
// Increment age if obj still in new generation
obj->incr_age();
age_table()->add(obj, s);
}
// Done, insert forward pointer to obj in this header
old->forward_to(obj);
return obj;
}
示例5: add
// add entry
void add(oop p, size_t oop_size) {
int age = p->age();
assert(age > 0 && age < table_size, "invalid age of object");
sizes[age] += oop_size;
}
示例6: add
// add entry
void AgeTable::add(oop p, size_t oop_size) {
add(p->age(), oop_size);
}
示例7: add
// add entry
void add(oop p, size_t oop_size) {
add(p->age(), oop_size);
}