本文整理汇总了C++中oop::oop_iterate_header方法的典型用法代码示例。如果您正苦于以下问题:C++ oop::oop_iterate_header方法的具体用法?C++ oop::oop_iterate_header怎么用?C++ oop::oop_iterate_header使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类oop
的用法示例。
在下文中一共展示了oop::oop_iterate_header方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: oop_oop_iterate
int klassKlass::oop_oop_iterate(oop obj, OopClosure* blk) {
// Get size before changing pointers
int size = oop_size(obj);
Klass* k = Klass::cast(klassOop(obj));
blk->do_oop(k->adr_super());
for (juint i = 0; i < Klass::primary_super_limit(); i++)
blk->do_oop(k->adr_primary_supers()+i);
blk->do_oop(k->adr_secondary_super_cache());
blk->do_oop(k->adr_secondary_supers());
blk->do_oop(k->adr_java_mirror());
blk->do_oop(k->adr_name());
// The following are in the perm gen and are treated
// specially in a later phase of a perm gen collection; ...
assert(oop(k)->is_perm(), "should be in perm");
assert(oop(k->subklass())->is_perm_or_null(), "should be in perm");
assert(oop(k->next_sibling())->is_perm_or_null(), "should be in perm");
// ... don't scan them normally, but remember this klassKlass
// for later (see, for instance, oop_follow_contents above
// for what MarkSweep does with it.
if (blk->should_remember_klasses()) {
blk->remember_klass(k);
}
obj->oop_iterate_header(blk);
return size;
}
示例2: oop_oop_iterate_m
int klassKlass::oop_oop_iterate_m(oop obj, OopClosure* blk, MemRegion mr) {
// Get size before changing pointers
int size = oop_size(obj);
Klass* k = Klass::cast(klassOop(obj));
oop* adr;
adr = k->adr_super();
if (mr.contains(adr)) blk->do_oop(adr);
for (juint i = 0; i < Klass::primary_super_limit(); i++) {
adr = k->adr_primary_supers()+i;
if (mr.contains(adr)) blk->do_oop(adr);
}
adr = k->adr_secondary_super_cache();
if (mr.contains(adr)) blk->do_oop(adr);
adr = k->adr_secondary_supers();
if (mr.contains(adr)) blk->do_oop(adr);
adr = k->adr_java_mirror();
if (mr.contains(adr)) blk->do_oop(adr);
adr = k->adr_name();
if (mr.contains(adr)) blk->do_oop(adr);
// The following are "weak links" in the perm gen and are
// treated specially in a later phase of a perm gen collection.
assert(oop(k)->is_perm(), "should be in perm");
assert(oop(k->adr_subklass())->is_perm(), "should be in perm");
assert(oop(k->adr_next_sibling())->is_perm(), "should be in perm");
if (blk->should_remember_klasses()
&& (mr.contains(k->adr_subklass())
|| mr.contains(k->adr_next_sibling()))) {
blk->remember_klass(k);
}
obj->oop_iterate_header(blk, mr);
return size;
}
示例3: oop_oop_iterate
int compiledICHolderKlass::oop_oop_iterate(oop obj, OopClosure* blk) {
assert(obj->is_compiledICHolder(), "must be compiledICHolder");
compiledICHolderOop c = compiledICHolderOop(obj);
// Get size before changing pointers.
// Don't call size() or oop_size() since that is a virtual call.
int size = c->object_size();
obj->oop_iterate_header(blk);
blk->do_oop(c->adr_holder_method());
blk->do_oop(c->adr_holder_klass());
return size;
}
示例4: oop_oop_iterate
int methodDataKlass::oop_oop_iterate(oop obj, OopClosure* blk) {
assert (obj->is_methodData(), "object must be method data");
methodDataOop m = methodDataOop(obj);
// Get size before changing pointers
// Don't call size() or oop_size() since that is a virtual call.
int size = m->object_size();
obj->oop_iterate_header(blk);
blk->do_oop(m->adr_method());
ResourceMark rm;
for (ProfileData* data = m->first_data();
m->is_valid(data);
data = m->next_data(data)) {
data->oop_iterate(blk);
}
return size;
}
示例5: oop_oop_iterate_m
int compiledICHolderKlass::oop_oop_iterate_m(oop obj, OopClosure* blk,
MemRegion mr) {
assert(obj->is_compiledICHolder(), "must be compiledICHolder");
compiledICHolderOop c = compiledICHolderOop(obj);
// Get size before changing pointers.
// Don't call size() or oop_size() since that is a virtual call.
int size = c->object_size();
obj->oop_iterate_header(blk, mr);
oop* adr;
adr = c->adr_holder_method();
if (mr.contains(adr)) blk->do_oop(adr);
adr = c->adr_holder_klass();
if (mr.contains(adr)) blk->do_oop(adr);
return size;
}
示例6: do_object
void do_object(oop obj) {
obj->oop_iterate_header(&resolve);
obj->oop_iterate(&resolve);
assert(obj->klass()->is_shared(), "Klass not pointing into shared space.");
// If the object is a Java object or class which might (in the
// future) contain a reference to a young gen object, add it to the
// list.
if (obj->is_klass() || obj->is_instance()) {
if (obj->is_klass() ||
obj->is_a(SystemDictionary::Class_klass()) ||
obj->is_a(SystemDictionary::Throwable_klass())) {
// Do nothing
}
else if (obj->is_a(SystemDictionary::String_klass())) {
// immutable objects.
} else {
// someone added an object we hadn't accounted for.
ShouldNotReachHere();
}
}
}