本文整理汇总了C++中oop::is_klass方法的典型用法代码示例。如果您正苦于以下问题:C++ oop::is_klass方法的具体用法?C++ oop::is_klass怎么用?C++ oop::is_klass使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类oop
的用法示例。
在下文中一共展示了oop::is_klass方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: oop_update_pointers
int instanceKlassKlass::oop_update_pointers(ParCompactionManager* cm, oop obj) {
assert(obj->is_klass(),"must be a klass");
assert(klassOop(obj)->klass_part()->oop_is_instance_slow(),
"must be instance klass");
instanceKlass* ik = instanceKlass::cast(klassOop(obj));
ik->vtable()->oop_update_pointers(cm);
ik->itable()->oop_update_pointers(cm);
oop* const beg_oop = ik->oop_block_beg();
oop* const end_oop = ik->oop_block_end();
for (oop* cur_oop = beg_oop; cur_oop < end_oop; ++cur_oop) {
PSParallelCompact::adjust_pointer(cur_oop);
}
// embedded oops
if (ik->adr_implementor() != NULL) {
PSParallelCompact::adjust_pointer(ik->adr_implementor());
}
if (ik->adr_host_klass() != NULL) {
PSParallelCompact::adjust_pointer(ik->adr_host_klass());
}
OopClosure* closure = PSParallelCompact::adjust_root_pointer_closure();
iterate_c_heap_oops(ik, closure);
klassKlass::oop_update_pointers(cm, obj);
return ik->object_size();
}
示例2: oop_adjust_pointers
int instanceKlassKlass::oop_adjust_pointers(oop obj) {
assert(obj->is_klass(),"must be a klass");
assert(klassOop(obj)->klass_part()->oop_is_instance_slow(), "must be instance klass");
instanceKlass* ik = instanceKlass::cast(klassOop(obj));
ik->vtable()->oop_adjust_pointers();
ik->itable()->oop_adjust_pointers();
MarkSweep::adjust_pointer(ik->adr_array_klasses());
MarkSweep::adjust_pointer(ik->adr_methods());
MarkSweep::adjust_pointer(ik->adr_method_ordering());
MarkSweep::adjust_pointer(ik->adr_local_interfaces());
MarkSweep::adjust_pointer(ik->adr_transitive_interfaces());
MarkSweep::adjust_pointer(ik->adr_fields());
MarkSweep::adjust_pointer(ik->adr_constants());
MarkSweep::adjust_pointer(ik->adr_class_loader());
MarkSweep::adjust_pointer(ik->adr_protection_domain());
if (ik->adr_host_klass() != NULL) {
MarkSweep::adjust_pointer(ik->adr_host_klass());
}
MarkSweep::adjust_pointer(ik->adr_signers());
MarkSweep::adjust_pointer(ik->adr_inner_classes());
if (ik->adr_implementor() != NULL) {
MarkSweep::adjust_pointer(ik->adr_implementor());
}
MarkSweep::adjust_pointer(ik->adr_class_annotations());
MarkSweep::adjust_pointer(ik->adr_fields_annotations());
MarkSweep::adjust_pointer(ik->adr_methods_annotations());
MarkSweep::adjust_pointer(ik->adr_methods_parameter_annotations());
MarkSweep::adjust_pointer(ik->adr_methods_default_annotations());
iterate_c_heap_oops(ik, &MarkSweep::adjust_root_pointer_closure);
return klassKlass::oop_adjust_pointers(obj);
}
示例3: markSymbol
PRIM_DECL_1(behaviorPrimitives::can_be_subclassed, oop behavior) {
PROLOGUE_1("can_be_subclassed", behavior);
if (!behavior->is_klass())
return markSymbol(vmSymbols::first_argument_has_wrong_type());
return klassOop(behavior)->klass_part()->can_be_subclassed() ? trueObj : falseObj;
}
示例4: oop_update_pointers
int instanceKlassKlass::oop_update_pointers(ParCompactionManager* cm, oop obj,
HeapWord* beg_addr,
HeapWord* end_addr) {
assert(obj->is_klass(),"must be a klass");
assert(klassOop(obj)->klass_part()->oop_is_instance_slow(),
"must be instance klass");
instanceKlass* ik = instanceKlass::cast(klassOop(obj));
ik->update_static_fields(beg_addr, end_addr);
ik->vtable()->oop_update_pointers(cm, beg_addr, end_addr);
ik->itable()->oop_update_pointers(cm, beg_addr, end_addr);
oop* const beg_oop = MAX2((oop*)beg_addr, ik->oop_block_beg());
oop* const end_oop = MIN2((oop*)end_addr, ik->oop_block_end());
for (oop* cur_oop = beg_oop; cur_oop < end_oop; ++cur_oop) {
PSParallelCompact::adjust_pointer(cur_oop);
}
// The oop_map_cache, jni_ids and jni_id_map are allocated from the C heap,
// and so don't lie within any 'Chunk' boundaries. Update them when the
// lowest addressed oop in the instanceKlass 'oop_block' is updated.
if (beg_oop == ik->oop_block_beg()) {
OopClosure* closure = PSParallelCompact::adjust_root_pointer_closure();
iterate_c_heap_oops(ik, closure);
}
klassKlass::oop_update_pointers(cm, obj, beg_addr, end_addr);
return ik->object_size();
}
示例5: markSymbol
PRIM_DECL_1(behaviorPrimitives::vm_type, oop behavior) {
PROLOGUE_1("format", behavior);
if (!behavior->is_klass())
return markSymbol(vmSymbols::first_argument_has_wrong_type());
Klass::Format f = klassOop(behavior)->klass_part()->format();
switch (f) {
case Klass::mem_klass: return vmSymbols::mem_klass();
case Klass::association_klass: return vmSymbols::association_klass();
case Klass::blockClosure_klass: return vmSymbols::blockClosure_klass();
case Klass::byteArray_klass: return vmSymbols::byteArray_klass();
case Klass::symbol_klass: return vmSymbols::symbol_klass();
case Klass::context_klass: return vmSymbols::context_klass();
case Klass::doubleByteArray_klass: return vmSymbols::doubleByteArray_klass();
case Klass::doubleValueArray_klass: return vmSymbols::doubleValueArray_klass();
case Klass::double_klass: return vmSymbols::double_klass();
case Klass::klass_klass: return vmSymbols::klass_klass();
case Klass::method_klass: return vmSymbols::method_klass();
case Klass::mixin_klass: return vmSymbols::mixin_klass();
case Klass::objArray_klass: return vmSymbols::objArray_klass();
case Klass::weakArray_klass: return vmSymbols::weakArray_klass();
case Klass::process_klass: return vmSymbols::process_klass();
case Klass::vframe_klass: return vmSymbols::vframe_klass();
case Klass::proxy_klass: return vmSymbols::proxy_klass();
case Klass::smi_klass: return vmSymbols::smi_klass();
default:
fatal("wrong format for klass");
}
return markSymbol(vmSymbols::first_argument_has_wrong_type());
}
示例6: markSymbol
PRIM_DECL_2(doubleValueArrayPrimitives::allocateSize, oop receiver, oop argument) {
PROLOGUE_2("allocateSize", receiver, argument)
assert(receiver->is_klass() && klassOop(receiver)->klass_part()->oop_is_doubleValueArray(),
"receiver must double byte array class");
if (!argument->is_smi())
markSymbol(vmSymbols::first_argument_has_wrong_type());
if (smiOop(argument)->value() < 0)
return markSymbol(vmSymbols::negative_size());
int length = smiOop(argument)->value();
klassOop k = klassOop(receiver);
int ni_size = k->klass_part()->non_indexable_size();
int obj_size = ni_size + 1 + roundTo(length * sizeof(double), oopSize) / oopSize;
// allocate
doubleValueArrayOop obj = as_doubleValueArrayOop(Universe::allocate(obj_size, (memOop*)&k));
// header
memOop(obj)->initialize_header(true, k);
// instance variables
memOop(obj)->initialize_body(memOopDesc::header_size(), ni_size);
obj->set_length(length);
for (int index = 1; index <= length; index++) {
obj->double_at_put(index, 0.0);
}
return obj;
}
示例7: oop_set_partially_loaded
// The transitive_interfaces is the last field set when loading an object.
void instanceKlassKlass::oop_set_partially_loaded(oop obj) {
assert(obj->is_klass(), "object must be klass");
instanceKlass* ik = instanceKlass::cast(klassOop(obj));
assert(ik-oop_is_instance(), "object must be instanceKlass");
assert(ik->transitive_interfaces() == NULL, "just checking");
ik->set_transitive_interfaces((objArrayOop) obj); // Temporarily set transitive_interfaces to point to self
}
示例8: oop_oop_iterate
int instanceKlassKlass::oop_oop_iterate(oop obj, OopClosure* blk) {
assert(obj->is_klass(),"must be a klass");
assert(klassOop(obj)->klass_part()->oop_is_instance(), "must be instance klass");
instanceKlass* ik = instanceKlass::cast(klassOop(obj));
// Get size before changing pointers.
// Don't call size() or oop_size() since that is a virtual call.
int size = ik->object_size();
ik->iterate_static_fields(blk);
ik->vtable()->oop_oop_iterate(blk);
ik->itable()->oop_oop_iterate(blk);
blk->do_oop(ik->adr_array_klasses());
blk->do_oop(ik->adr_methods());
blk->do_oop(ik->adr_method_ordering());
blk->do_oop(ik->adr_local_interfaces());
blk->do_oop(ik->adr_transitive_interfaces());
blk->do_oop(ik->adr_fields());
blk->do_oop(ik->adr_constants());
blk->do_oop(ik->adr_class_loader());
blk->do_oop(ik->adr_protection_domain());
blk->do_oop(ik->adr_signers());
blk->do_oop(ik->adr_source_file_name());
blk->do_oop(ik->adr_source_debug_extension());
blk->do_oop(ik->adr_inner_classes());
blk->do_oop(ik->adr_implementor());
blk->do_oop(ik->adr_previous_version());
klassKlass::oop_oop_iterate(obj, blk);
if(ik->oop_map_cache() != NULL) ik->oop_map_cache()->oop_iterate(blk);
return size;
}
示例9: oop_adjust_pointers
int instanceKlassKlass::oop_adjust_pointers(oop obj) {
assert(obj->is_klass(),"must be a klass");
assert(klassOop(obj)->klass_part()->oop_is_instance(), "must be instance klass");
instanceKlass* ik = instanceKlass::cast(klassOop(obj));
ik->adjust_static_fields();
ik->vtable()->oop_adjust_pointers();
ik->itable()->oop_adjust_pointers();
MarkSweep::adjust_pointer(ik->adr_array_klasses());
MarkSweep::adjust_pointer(ik->adr_methods());
MarkSweep::adjust_pointer(ik->adr_method_ordering());
MarkSweep::adjust_pointer(ik->adr_local_interfaces());
MarkSweep::adjust_pointer(ik->adr_transitive_interfaces());
MarkSweep::adjust_pointer(ik->adr_fields());
MarkSweep::adjust_pointer(ik->adr_constants());
MarkSweep::adjust_pointer(ik->adr_class_loader());
MarkSweep::adjust_pointer(ik->adr_protection_domain());
MarkSweep::adjust_pointer(ik->adr_signers());
MarkSweep::adjust_pointer(ik->adr_source_file_name());
MarkSweep::adjust_pointer(ik->adr_source_debug_extension());
MarkSweep::adjust_pointer(ik->adr_inner_classes());
MarkSweep::adjust_pointer(ik->adr_implementor());
MarkSweep::adjust_pointer(ik->adr_previous_version());
if (ik->oop_map_cache() != NULL) {
ik->oop_map_cache()->oop_iterate(&MarkSweep::adjust_root_pointer_closure);
}
if (ik->jni_ids() != NULL) {
ik->jni_ids()->oops_do(&MarkSweep::adjust_root_pointer_closure);
}
return klassKlass::oop_adjust_pointers(obj);
}
示例10: oop_verify_on
void klassKlass::oop_verify_on(oop obj, outputStream* st) {
Klass::oop_verify_on(obj, st);
guarantee(obj->is_perm(), "should be in permspace");
guarantee(obj->is_klass(), "should be klass");
Klass* k = Klass::cast(klassOop(obj));
if (k->super() != NULL) {
guarantee(k->super()->is_perm(), "should be in permspace");
guarantee(k->super()->is_klass(), "should be klass");
}
klassOop ko = k->secondary_super_cache();
if( ko != NULL ) {
guarantee(ko->is_perm(), "should be in permspace");
guarantee(ko->is_klass(), "should be klass");
}
for( uint i = 0; i < primary_super_limit(); i++ ) {
oop ko = k->adr_primary_supers()[i]; // Cannot use normal accessor because it asserts
if( ko != NULL ) {
guarantee(ko->is_perm(), "should be in permspace");
guarantee(ko->is_klass(), "should be klass");
}
}
if (k->java_mirror() != NULL || (k->oop_is_instance() && instanceKlass::cast(klassOop(obj))->is_loaded())) {
guarantee(k->java_mirror() != NULL, "should be allocated");
guarantee(k->java_mirror()->is_perm(), "should be in permspace");
guarantee(k->java_mirror()->is_instance(), "should be instance");
}
if (k->name() != NULL) {
guarantee(Universe::heap()->is_in_permanent(k->name()),
"should be in permspace");
guarantee(k->name()->is_symbol(), "should be symbol");
}
}
示例11: markSymbol
PRIM_DECL_2(doubleByteArrayPrimitives::allocateSize, oop receiver, oop argument) {
PROLOGUE_2("allocateSize", receiver, argument)
assert(receiver->is_klass() && klassOop(receiver)->klass_part()->oop_is_doubleByteArray(),
"receiver must double byte array class");
if (!argument->is_smi())
markSymbol(vmSymbols::first_argument_has_wrong_type());
if (smiOop(argument)->value() < 0)
return markSymbol(vmSymbols::negative_size());
klassOop k = klassOop(receiver);
int ni_size = k->klass_part()->non_indexable_size();
int obj_size = ni_size + 1 + roundTo(smiOop(argument)->value() * 2, oopSize) / oopSize;
// allocate
doubleByteArrayOop obj = as_doubleByteArrayOop(Universe::allocate(obj_size, (memOop*)&k));
// header
memOop(obj)->initialize_header(true, k);
// instance variables
memOop(obj)->initialize_body(memOopDesc::header_size(), ni_size);
// indexables
oop* base = (oop*) obj->addr();
oop* end = base + obj_size;
// %optimized 'obj->set_length(size)'
base[ni_size] = argument;
// %optimized 'for (int index = 1; index <= size; index++)
// obj->doubleByte_at_put(index, 0)'
base = &base[ni_size+1];
while (base < end) *base++ = (oop) 0;
return obj;
}
示例12: oop_oop_iterate_m
int arrayKlassKlass::oop_oop_iterate_m(oop obj, OopClosure* blk, MemRegion mr) {
assert (obj->is_klass(), "must be klass");
arrayKlass* ak = arrayKlass::cast(klassOop(obj));
blk->do_oop(ak->adr_lower_dimension());
blk->do_oop(ak->adr_higher_dimension());
ak->vtable()->oop_oop_iterate_m(blk, mr);
return klassKlass::oop_oop_iterate_m(obj, blk, mr);
}
示例13: oop_set_partially_loaded
// The transitive_interfaces is the last field set when loading an object.
void instanceKlassKlass::oop_set_partially_loaded(oop obj) {
assert(obj->is_klass(), "object must be klass");
instanceKlass* ik = instanceKlass::cast(klassOop(obj));
// Set the layout helper to a place-holder value, until fuller initialization.
// (This allows asserts in oop_is_instance to succeed.)
ik->set_layout_helper(Klass::instance_layout_helper(0, true));
assert(ik->oop_is_instance(), "object must be instanceKlass");
assert(ik->transitive_interfaces() == NULL, "just checking");
ik->set_transitive_interfaces((objArrayOop) obj); // Temporarily set transitive_interfaces to point to self
}
示例14: oop_oop_iterate_m
int instanceKlassKlass::oop_oop_iterate_m(oop obj, OopClosure* blk,
MemRegion mr) {
assert(obj->is_klass(),"must be a klass");
assert(klassOop(obj)->klass_part()->oop_is_instance_slow(), "must be instance klass");
instanceKlass* ik = instanceKlass::cast(klassOop(obj));
// Get size before changing pointers.
// Don't call size() or oop_size() since that is a virtual call.
int size = ik->object_size();
ik->vtable()->oop_oop_iterate_m(blk, mr);
ik->itable()->oop_oop_iterate_m(blk, mr);
oop* adr;
adr = ik->adr_array_klasses();
if (mr.contains(adr)) blk->do_oop(adr);
adr = ik->adr_methods();
if (mr.contains(adr)) blk->do_oop(adr);
adr = ik->adr_method_ordering();
if (mr.contains(adr)) blk->do_oop(adr);
adr = ik->adr_local_interfaces();
if (mr.contains(adr)) blk->do_oop(adr);
adr = ik->adr_transitive_interfaces();
if (mr.contains(adr)) blk->do_oop(adr);
adr = ik->adr_fields();
if (mr.contains(adr)) blk->do_oop(adr);
adr = ik->adr_constants();
if (mr.contains(adr)) blk->do_oop(adr);
adr = ik->adr_class_loader();
if (mr.contains(adr)) blk->do_oop(adr);
adr = ik->adr_protection_domain();
if (mr.contains(adr)) blk->do_oop(adr);
adr = ik->adr_host_klass();
if (adr != NULL && mr.contains(adr)) blk->do_oop(adr);
adr = ik->adr_signers();
if (mr.contains(adr)) blk->do_oop(adr);
adr = ik->adr_inner_classes();
if (mr.contains(adr)) blk->do_oop(adr);
adr = ik->adr_implementor();
if (adr != NULL && mr.contains(adr)) blk->do_oop(adr);
adr = ik->adr_class_annotations();
if (mr.contains(adr)) blk->do_oop(adr);
adr = ik->adr_fields_annotations();
if (mr.contains(adr)) blk->do_oop(adr);
adr = ik->adr_methods_annotations();
if (mr.contains(adr)) blk->do_oop(adr);
adr = ik->adr_methods_parameter_annotations();
if (mr.contains(adr)) blk->do_oop(adr);
adr = ik->adr_methods_default_annotations();
if (mr.contains(adr)) blk->do_oop(adr);
klassKlass::oop_oop_iterate_m(obj, blk, mr);
if(ik->oop_map_cache() != NULL) ik->oop_map_cache()->oop_iterate(blk, mr);
return size;
}
示例15: oop_follow_contents
void arrayKlassKlass::oop_follow_contents(oop obj) {
assert (obj->is_klass(), "must be klass");
arrayKlass* ak = arrayKlass::cast(klassOop(obj));
MarkSweep::mark_and_push(ak->adr_lower_dimension() );
MarkSweep::mark_and_push(ak->adr_higher_dimension() );
{
HandleMark hm;
ak->vtable()->oop_follow_contents();
}
klassKlass::oop_follow_contents(obj);
}