本文整理汇总了C++中Klass::next_link方法的典型用法代码示例。如果您正苦于以下问题:C++ Klass::next_link方法的具体用法?C++ Klass::next_link怎么用?C++ Klass::next_link使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Klass
的用法示例。
在下文中一共展示了Klass::next_link方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: classes_do
void ClassLoaderData::classes_do(KlassClosure* klass_closure) {
// Lock-free access requires load_ptr_acquire
for (Klass* k = load_ptr_acquire(&_klasses); k != NULL; k = k->next_link()) {
klass_closure->do_klass(k);
assert(k != k->next_link(), "no loops!");
}
}
示例2: dump
void ClassLoaderData::dump(outputStream * const out) {
ResourceMark rm;
out->print("ClassLoaderData CLD: "PTR_FORMAT", loader: "PTR_FORMAT", loader_klass: "PTR_FORMAT" %s {",
p2i(this), p2i((void *)class_loader()),
p2i(class_loader() != NULL ? class_loader()->klass() : NULL), loader_name());
if (claimed()) out->print(" claimed ");
if (is_unloading()) out->print(" unloading ");
out->print(" handles " INTPTR_FORMAT, p2i(handles()));
out->cr();
if (metaspace_or_null() != NULL) {
out->print_cr("metaspace: " INTPTR_FORMAT, p2i(metaspace_or_null()));
metaspace_or_null()->dump(out);
} else {
out->print_cr("metaspace: NULL");
}
#ifdef CLD_DUMP_KLASSES
if (Verbose) {
ResourceMark rm;
Klass* k = _klasses;
while (k != NULL) {
out->print_cr("klass "PTR_FORMAT", %s, CT: %d, MUT: %d", k, k->name()->as_C_string(),
k->has_modified_oops(), k->has_accumulated_modified_oops());
assert(k != k->next_link(), "no loops!");
k = k->next_link();
}
}
#endif // CLD_DUMP_KLASSES
#undef CLD_DUMP_KLASSES
if (_jmethod_ids != NULL) {
Method::print_jmethod_ids(this, out);
}
out->print_cr("}");
}
示例3: classes_do
void ClassLoaderData::classes_do(void f(InstanceKlass*)) {
for (Klass* k = _klasses; k != NULL; k = k->next_link()) {
if (k->oop_is_instance()) {
f(InstanceKlass::cast(k));
}
assert(k != k->next_link(), "no loops!");
}
}
示例4: methods_do
void ClassLoaderData::methods_do(void f(Method*)) {
for (Klass* k = _klasses; k != NULL; k = k->next_link()) {
if (k->is_instance_klass()) {
InstanceKlass::cast(k)->methods_do(f);
}
}
}
示例5: 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!");
}
}
示例6: methods_do
void ClassLoaderData::methods_do(void f(Method*)) {
// Lock-free access requires load_ptr_acquire
for (Klass* k = load_ptr_acquire(&_klasses); k != NULL; k = k->next_link()) {
if (k->is_instance_klass()) {
InstanceKlass::cast(k)->methods_do(f);
}
}
}
示例7: remove_class
// This is called by InstanceKlass::deallocate_contents() to remove the
// scratch_class for redefine classes. We need a lock because there it may not
// be called at a safepoint if there's an error.
void ClassLoaderData::remove_class(Klass* scratch_class) {
MutexLockerEx ml(metaspace_lock(), Mutex::_no_safepoint_check_flag);
Klass* prev = NULL;
for (Klass* k = _klasses; k != NULL; k = k->next_link()) {
if (k == scratch_class) {
if (prev == NULL) {
_klasses = k->next_link();
} else {
Klass* next = k->next_link();
prev->set_next_link(next);
}
return;
}
prev = k;
assert(k != k->next_link(), "no loops!");
}
ShouldNotReachHere(); // should have found this class!!
}
示例8: loaded_classes_do
void ClassLoaderData::loaded_classes_do(KlassClosure* klass_closure) {
// Lock to avoid classes being modified/added/removed during iteration
MutexLockerEx ml(metaspace_lock(), Mutex::_no_safepoint_check_flag);
for (Klass* k = _klasses; k != NULL; k = k->next_link()) {
// Do not filter ArrayKlass oops here...
if (k->oop_is_array() || (k->oop_is_instance() && InstanceKlass::cast(k)->is_loaded())) {
klass_closure->do_klass(k);
}
}
}
示例9: contains_klass
bool ClassLoaderData::contains_klass(Klass* klass) {
for (Klass* k = _klasses; k != NULL; k = k->next_link()) {
if (k == klass) return true;
}
return false;
}