本文整理汇总了C++中Klass::class_loader_data方法的典型用法代码示例。如果您正苦于以下问题:C++ Klass::class_loader_data方法的具体用法?C++ Klass::class_loader_data怎么用?C++ Klass::class_loader_data使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Klass
的用法示例。
在下文中一共展示了Klass::class_loader_data方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: oop_pc_follow_contents
void InstanceMirrorKlass::oop_pc_follow_contents(oop obj, ParCompactionManager* cm) {
InstanceKlass::oop_pc_follow_contents(obj, cm);
// Follow the klass field in the mirror.
Klass* klass = java_lang_Class::as_Klass(obj);
if (klass != NULL) {
// An anonymous class doesn't have its own class loader, so the call
// to follow_klass will mark and push its java mirror instead of the
// class loader. When handling the java mirror for an anonymous class
// we need to make sure its class loader data is claimed, this is done
// by calling follow_class_loader explicitly. For non-anonymous classes
// the call to follow_class_loader is made when the class loader itself
// is handled.
if (klass->is_instance_klass() && InstanceKlass::cast(klass)->is_anonymous()) {
cm->follow_class_loader(klass->class_loader_data());
} else {
cm->follow_klass(klass);
}
} else {
// If klass is NULL then this a mirror for a primitive type.
// We don't have to follow them, since they are handled as strong
// roots in Universe::oops_do.
assert(java_lang_Class::is_primitive(obj), "Sanity check");
}
ParCompactionManager::MarkAndPushClosure cl(cm);
oop_oop_iterate_statics<true>(obj, &cl);
}
示例2: verify
void ClassLoaderData::verify() {
oop cl = class_loader();
guarantee(this == class_loader_data(cl) || is_anonymous(), "Must be the same");
guarantee(cl != NULL || this == ClassLoaderData::the_null_class_loader_data() || is_anonymous(), "must be");
// Verify the integrity of the allocated space.
if (metaspace_or_null() != NULL) {
metaspace_or_null()->verify();
}
for (Klass* k = _klasses; k != NULL; k = k->next_link()) {
guarantee(k->class_loader_data() == this, "Must be the same");
k->verify();
assert(k != k->next_link(), "no loops!");
}
}