本文整理汇总了C++中Klass::set_alloc_count方法的典型用法代码示例。如果您正苦于以下问题:C++ Klass::set_alloc_count方法的具体用法?C++ Klass::set_alloc_count怎么用?C++ Klass::set_alloc_count使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Klass
的用法示例。
在下文中一共展示了Klass::set_alloc_count方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: do_object
void do_object(oop obj) {
if (obj->is_klass()) {
Klass* k = Klass::cast(klassOop(obj));
k->set_alloc_count(0);
k->set_alloc_size(0);
}
}
示例2: classify_object
object_type ClassifyObjectClosure::classify_object(oop obj, bool count) {
object_type type = unknown_type;
Klass* k = obj->blueprint();
if (k->as_klassOop() == SystemDictionary::Object_klass()) {
tty->print_cr("Found the class!");
}
if (count) {
k->set_alloc_count(k->alloc_count() + 1);
}
if (obj->is_instance()) {
if (k->oop_is_instanceRef()) {
type = instanceRef_type;
} else {
type = instance_type;
}
} else if (obj->is_typeArray()) {
type = typeArray_type;
} else if (obj->is_objArray()) {
type = objArray_type;
} else if (obj->is_symbol()) {
type = symbol_type;
} else if (obj->is_klass()) {
Klass* k = ((klassOop)obj)->klass_part();
if (k->oop_is_instance()) {
type = instanceKlass_type;
} else {
type = klass_type;
}
} else if (obj->is_method()) {
type = method_type;
} else if (obj->is_constMethod()) {
type = constMethod_type;
} else if (obj->is_methodData()) {
ShouldNotReachHere();
} else if (obj->is_constantPool()) {
type = constantPool_type;
} else if (obj->is_constantPoolCache()) {
type = constantPoolCache_type;
} else if (obj->is_compiledICHolder()) {
type = compiledICHolder_type;
} else {
ShouldNotReachHere();
}
assert(type != unknown_type, "found object of unknown type.");
return type;
}
示例3: base_create_klass_oop
klassOop Klass::base_create_klass_oop(KlassHandle& klass, int size,
const Klass_vtbl& vtbl, TRAPS) {
size = align_object_size(size);
// allocate and initialize vtable
Klass* kl = (Klass*) vtbl.allocate_permanent(klass, size, CHECK_NULL);
klassOop k = kl->as_klassOop();
{ // Preinitialize supertype information.
// A later call to initialize_supers() may update these settings:
kl->set_super(NULL);
for (juint i = 0; i < Klass::primary_super_limit(); i++) {
kl->_primary_supers[i] = NULL;
}
kl->set_secondary_supers(NULL);
oop_store_without_check((oop*) &kl->_primary_supers[0], k);
kl->set_super_check_offset(in_bytes(primary_supers_offset()));
}
kl->set_java_mirror(NULL);
kl->set_modifier_flags(0);
kl->set_layout_helper(Klass::_lh_neutral_value);
kl->set_name(NULL);
AccessFlags af;
af.set_flags(0);
kl->set_access_flags(af);
kl->set_subklass(NULL);
kl->set_next_sibling(NULL);
kl->set_alloc_count(0);
kl->set_alloc_size(0);
TRACE_SET_KLASS_TRACE_ID(kl, 0);
kl->set_prototype_header(markOopDesc::prototype());
kl->set_biased_lock_revocation_count(0);
kl->set_last_biased_lock_bulk_revocation_time(0);
return k;
}