本文整理汇总了C++中KlassHandle::oop_is_instance方法的典型用法代码示例。如果您正苦于以下问题:C++ KlassHandle::oop_is_instance方法的具体用法?C++ KlassHandle::oop_is_instance怎么用?C++ KlassHandle::oop_is_instance使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KlassHandle
的用法示例。
在下文中一共展示了KlassHandle::oop_is_instance方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: instance_size
int instanceMirrorKlass::instance_size(KlassHandle k) {
if (k() != NULL && k->oop_is_instance()) {
return align_object_size(size_helper() + instanceKlass::cast(k())->static_field_size());
}
return size_helper();
}
示例2: initialize_from_super
int klassVtable::initialize_from_super(KlassHandle super) {
if (super.is_null()) {
return 0;
} else {
// copy methods from superKlass
// can't inherit from array class, so must be instanceKlass
assert(super->oop_is_instance(), "must be instance klass");
instanceKlass* sk = (instanceKlass*)super()->klass_part();
klassVtable* superVtable = sk->vtable();
assert(superVtable->length() <= _length, "vtable too short");
#ifdef ASSERT
superVtable->verify(tty, true);
#endif
superVtable->copy_vtable_to(table());
#ifndef PRODUCT
if (PrintVtables && Verbose) {
tty->print_cr("copy vtable from %s to %s size %d", sk->internal_name(), klass()->internal_name(), _length);
}
#endif
return superVtable->length();
}
}
示例3: process_class
void CHA::process_class(KlassHandle r, GrowableArray<KlassHandle>* receivers, GrowableArray<methodHandle>* methods, symbolHandle name, symbolHandle signature) {
// recursively add non-abstract subclasses of r to receivers list
assert(!r->is_interface(), "should call process_interface instead");
for (Klass* s = r->subklass(); s != NULL && !methods->is_full(); s = s->next_sibling()) {
// preorder traversal, so check subclasses first
if (s->is_interface()) {
// can only happen if r == Object
assert(r->superklass() == NULL, "must be klass Object");
} else {
process_class(s, receivers, methods, name, signature);
}
}
// now check r itself (after subclasses because of preorder)
if (!methods->is_full()) {
// don't add abstract classes to receivers list
// (but still consider their methods -- they may be non-abstract)
if (!receivers->is_full() && !r->is_abstract()) receivers->push(r);
methodOop m = NULL;
if (r->oop_is_instance()) m = instanceKlass::cast(r())->find_method(name(), signature());
if (m != NULL && !m->is_abstract()) {
if (!methods->contains(m)) methods->push(m);
}
}
}