本文整理汇总了C++中oop::is_constantPool方法的典型用法代码示例。如果您正苦于以下问题:C++ oop::is_constantPool方法的具体用法?C++ oop::is_constantPool怎么用?C++ oop::is_constantPool使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类oop
的用法示例。
在下文中一共展示了oop::is_constantPool方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: oop_oop_iterate_m
int constantPoolKlass::oop_oop_iterate_m(oop obj, OopClosure* blk, MemRegion mr) {
assert (obj->is_constantPool(), "obj must be constant pool");
// Performance tweak: We skip iterating over the klass pointer since we
// know that Universe::constantPoolKlassObj never moves.
constantPoolOop cp = (constantPoolOop) obj;
// Get size before changing pointers.
// Don't call size() or oop_size() since that is a virtual call.
int size = cp->object_size();
// If the tags array is null we are in the middle of allocating this constant
// pool.
if (cp->tags() != NULL) {
oop* base = (oop*)cp->base();
for (int i = 0; i < cp->length(); i++) {
if (mr.contains(base)) {
if (cp->is_pointer_entry(i)) {
blk->do_oop(base);
}
}
base++;
}
}
oop* addr;
addr = cp->tags_addr();
blk->do_oop(addr);
addr = cp->cache_addr();
blk->do_oop(addr);
addr = cp->pool_holder_addr();
blk->do_oop(addr);
return size;
}
示例2: oop_adjust_pointers
int constantPoolKlass::oop_adjust_pointers(oop obj) {
assert (obj->is_constantPool(), "obj must be constant pool");
constantPoolOop cp = (constantPoolOop) obj;
// Get size before changing pointers.
// Don't call size() or oop_size() since that is a virtual call.
int size = cp->object_size();
// Performance tweak: We skip iterating over the klass pointer since we
// know that Universe::constantPoolKlassObj never moves.
// If the tags array is null we are in the middle of allocating this constant
// pool.
if (cp->tags() != NULL) {
oop* base = (oop*)cp->base();
for (int i = 0; i< cp->length(); i++) {
if (cp->is_pointer_entry(i)) {
MarkSweep::adjust_pointer(base);
}
base++;
}
}
MarkSweep::adjust_pointer(cp->tags_addr());
MarkSweep::adjust_pointer(cp->cache_addr());
MarkSweep::adjust_pointer(cp->pool_holder_addr());
return size;
}
示例3: assert
int
constantPoolKlass::oop_update_pointers(ParCompactionManager* cm, oop obj,
HeapWord* beg_addr, HeapWord* end_addr) {
assert (obj->is_constantPool(), "obj must be constant pool");
constantPoolOop cp = (constantPoolOop) obj;
// If the tags array is null we are in the middle of allocating this constant
// pool.
if (cp->tags() != NULL) {
oop* base = (oop*)cp->base();
oop* const beg_oop = MAX2((oop*)beg_addr, base);
oop* const end_oop = MIN2((oop*)end_addr, base + cp->length());
const size_t beg_idx = pointer_delta(beg_oop, base, sizeof(oop*));
const size_t end_idx = pointer_delta(end_oop, base, sizeof(oop*));
for (size_t cur_idx = beg_idx; cur_idx < end_idx; ++cur_idx, ++base) {
if (cp->is_pointer_entry(int(cur_idx))) {
PSParallelCompact::adjust_pointer(base);
}
}
}
oop* p;
p = cp->tags_addr();
PSParallelCompact::adjust_pointer(p, beg_addr, end_addr);
p = cp->cache_addr();
PSParallelCompact::adjust_pointer(p, beg_addr, end_addr);
p = cp->pool_holder_addr();
PSParallelCompact::adjust_pointer(p, beg_addr, end_addr);
return cp->object_size();
}
示例4: do_object
void do_object(oop obj) {
// Mark String objects referenced by constant pool entries.
if (obj->is_constantPool()) {
constantPoolOop pool = constantPoolOop(obj);
pool->shared_strings_iterate(&mark_objects);
return;
}
}
示例5: oop_verify_on
void constantPoolKlass::oop_verify_on(oop obj, outputStream* st) {
Klass::oop_verify_on(obj, st);
guarantee(obj->is_constantPool(), "object must be constant pool");
constantPoolOop cp = constantPoolOop(obj);
guarantee(cp->is_perm(), "should be in permspace");
if (!cp->partially_loaded()) {
oop* base = (oop*)cp->base();
for (int i = 0; i< cp->length(); i++) {
if (cp->tag_at(i).is_klass()) {
guarantee((*base)->is_perm(), "should be in permspace");
guarantee((*base)->is_klass(), "should be klass");
}
if (cp->tag_at(i).is_unresolved_klass()) {
guarantee((*base)->is_perm(), "should be in permspace");
guarantee((*base)->is_symbol() || (*base)->is_klass(),
"should be symbol or klass");
}
if (cp->tag_at(i).is_symbol()) {
guarantee((*base)->is_perm(), "should be in permspace");
guarantee((*base)->is_symbol(), "should be symbol");
}
if (cp->tag_at(i).is_unresolved_string()) {
guarantee((*base)->is_perm(), "should be in permspace");
guarantee((*base)->is_symbol() || (*base)->is_instance(),
"should be symbol or instance");
}
if (cp->tag_at(i).is_string()) {
if (!cp->has_pseudo_string()) {
guarantee((*base)->is_perm(), "should be in permspace");
guarantee((*base)->is_instance(), "should be instance");
} else {
// can be non-perm, can be non-instance (array)
}
}
base++;
}
guarantee(cp->tags()->is_perm(), "should be in permspace");
guarantee(cp->tags()->is_typeArray(), "should be type array");
if (cp->cache() != NULL) {
// Note: cache() can be NULL before a class is completely setup or
// in temporary constant pools used during constant pool merging
guarantee(cp->cache()->is_perm(), "should be in permspace");
guarantee(cp->cache()->is_constantPoolCache(), "should be constant pool cache");
}
if (cp->pool_holder() != NULL) {
// Note: pool_holder() can be NULL in temporary constant pools
// used during constant pool merging
guarantee(cp->pool_holder()->is_perm(), "should be in permspace");
guarantee(cp->pool_holder()->is_klass(), "should be klass");
}
}
}
示例6: 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;
}
示例7: oop_push_contents
void constantPoolKlass::oop_push_contents(PSPromotionManager* pm, oop obj) {
assert(obj->is_constantPool(), "should be constant pool");
constantPoolOop cp = (constantPoolOop) obj;
if (AnonymousClasses && cp->has_pseudo_string() && cp->tags() != NULL) {
oop* base = (oop*)cp->base();
for (int i = 0; i < cp->length(); ++i, ++base) {
if (cp->tag_at(i).is_string()) {
if (PSScavenge::should_scavenge(base)) {
pm->claim_or_forward_depth(base);
}
}
}
}
}
示例8: preload_and_initialize_all_classes
// CompileTheWorld support. Preload all classes loaded references in the passed in constantpool
void constantPoolKlass::preload_and_initialize_all_classes(oop obj, TRAPS) {
guarantee(obj->is_constantPool(), "object must be constant pool");
constantPoolHandle cp(THREAD, (constantPoolOop)obj);
guarantee(!cp->partially_loaded(), "must be fully loaded");
for (int i = 0; i< cp->length(); i++) {
if (cp->tag_at(i).is_unresolved_klass()) {
// This will force loading of the class
klassOop klass = cp->klass_at(i, CHECK);
if (klass->is_instance()) {
// Force initialization of class
instanceKlass::cast(klass)->initialize(CHECK);
}
}
}
}
示例9: oop_update_pointers
int constantPoolKlass::oop_update_pointers(ParCompactionManager* cm, oop obj) {
assert (obj->is_constantPool(), "obj must be constant pool");
constantPoolOop cp = (constantPoolOop) obj;
// If the tags array is null we are in the middle of allocating this constant
// pool.
if (cp->tags() != NULL) {
oop* base = (oop*)cp->base();
for (int i = 0; i < cp->length(); ++i, ++base) {
if (cp->is_pointer_entry(i)) {
PSParallelCompact::adjust_pointer(base);
}
}
}
PSParallelCompact::adjust_pointer(cp->tags_addr());
PSParallelCompact::adjust_pointer(cp->cache_addr());
PSParallelCompact::adjust_pointer(cp->pool_holder_addr());
return cp->object_size();
}
示例10: oop_follow_contents
void constantPoolKlass::oop_follow_contents(oop obj) {
assert (obj->is_constantPool(), "obj must be constant pool");
constantPoolOop cp = (constantPoolOop) obj;
// Performance tweak: We skip iterating over the klass pointer since we
// know that Universe::constantPoolKlassObj never moves.
// If the tags array is null we are in the middle of allocating this constant pool
if (cp->tags() != NULL) {
// gc of constant pool contents
oop* base = (oop*)cp->base();
for (int i = 0; i < cp->length(); i++) {
if (cp->is_pointer_entry(i)) {
if (*base != NULL) MarkSweep::mark_and_push(base);
}
base++;
}
// gc of constant pool instance variables
MarkSweep::mark_and_push(cp->tags_addr());
MarkSweep::mark_and_push(cp->cache_addr());
MarkSweep::mark_and_push(cp->pool_holder_addr());
}
}
示例11: oop_size
int constantPoolKlass::oop_size(oop obj) const {
assert(obj->is_constantPool(), "must be constantPool");
return constantPoolOop(obj)->object_size();
}
示例12: oop_set_partially_loaded
void constantPoolKlass::oop_set_partially_loaded(oop obj) {
assert(obj->is_constantPool(), "object must be constant pool");
constantPoolOop cp = constantPoolOop(obj);
assert(cp->pool_holder() == NULL, "just checking");
cp->set_pool_holder((klassOop) cp); // Temporarily set pool holder to point to self
}
示例13: oop_partially_loaded
bool constantPoolKlass::oop_partially_loaded(oop obj) const {
assert(obj->is_constantPool(), "object must be constant pool");
constantPoolOop cp = constantPoolOop(obj);
return cp->tags() == NULL || cp->pool_holder() == (klassOop) cp; // Check whether pool holder points to self
}
示例14: oop_print_on
void constantPoolKlass::oop_print_on(oop obj, outputStream* st) {
EXCEPTION_MARK;
oop anObj;
assert(obj->is_constantPool(), "must be constantPool");
Klass::oop_print_on(obj, st);
constantPoolOop cp = constantPoolOop(obj);
if (cp->flags() != 0) {
st->print(" - flags : 0x%x", cp->flags());
if (cp->has_pseudo_string()) st->print(" has_pseudo_string");
if (cp->has_invokedynamic()) st->print(" has_invokedynamic");
st->cr();
}
// Temp. remove cache so we can do lookups with original indicies.
constantPoolCacheHandle cache (THREAD, cp->cache());
cp->set_cache(NULL);
for (int index = 1; index < cp->length(); index++) { // Index 0 is unused
st->print(" - %3d : ", index);
cp->tag_at(index).print_on(st);
st->print(" : ");
switch (cp->tag_at(index).value()) {
case JVM_CONSTANT_Class :
{ anObj = cp->klass_at(index, CATCH);
anObj->print_value_on(st);
st->print(" {0x%lx}", (address)anObj);
}
break;
case JVM_CONSTANT_Fieldref :
case JVM_CONSTANT_Methodref :
case JVM_CONSTANT_InterfaceMethodref :
st->print("klass_index=%d", cp->klass_ref_index_at(index));
st->print(" name_and_type_index=%d", cp->name_and_type_ref_index_at(index));
break;
case JVM_CONSTANT_UnresolvedString :
case JVM_CONSTANT_String :
if (cp->is_pseudo_string_at(index)) {
anObj = cp->pseudo_string_at(index);
} else {
anObj = cp->string_at(index, CATCH);
}
anObj->print_value_on(st);
st->print(" {0x%lx}", (address)anObj);
break;
case JVM_CONSTANT_Integer :
st->print("%d", cp->int_at(index));
break;
case JVM_CONSTANT_Float :
st->print("%f", cp->float_at(index));
break;
case JVM_CONSTANT_Long :
st->print_jlong(cp->long_at(index));
index++; // Skip entry following eigth-byte constant
break;
case JVM_CONSTANT_Double :
st->print("%lf", cp->double_at(index));
index++; // Skip entry following eigth-byte constant
break;
case JVM_CONSTANT_NameAndType :
st->print("name_index=%d", cp->name_ref_index_at(index));
st->print(" signature_index=%d", cp->signature_ref_index_at(index));
break;
case JVM_CONSTANT_Utf8 :
cp->symbol_at(index)->print_value_on(st);
break;
case JVM_CONSTANT_UnresolvedClass : // fall-through
case JVM_CONSTANT_UnresolvedClassInError: {
// unresolved_klass_at requires lock or safe world.
oop entry = *cp->obj_at_addr(index);
entry->print_value_on(st);
}
break;
default:
ShouldNotReachHere();
break;
}
st->cr();
}
st->cr();
// Restore cache
cp->set_cache(cache());
}
示例15: oop_is_conc_safe
bool constantPoolKlass::oop_is_conc_safe(oop obj) const {
assert(obj->is_constantPool(), "must be constantPool");
return constantPoolOop(obj)->is_conc_safe();
}