mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-21 11:34:38 +02:00
7043040: JSR292: JRuby bench/shootout/binarytrees.ruby-2.ruby SEGV: constantPoolKlass::oop_follow_contents
Reviewed-by: kvn, ysr
This commit is contained in:
parent
70dfd21e87
commit
249ae52324
1 changed files with 17 additions and 13 deletions
|
@ -285,10 +285,9 @@ int constantPoolKlass::oop_update_pointers(ParCompactionManager* cm, oop obj) {
|
||||||
void constantPoolKlass::oop_push_contents(PSPromotionManager* pm, oop obj) {
|
void constantPoolKlass::oop_push_contents(PSPromotionManager* pm, oop obj) {
|
||||||
assert(obj->is_constantPool(), "should be constant pool");
|
assert(obj->is_constantPool(), "should be constant pool");
|
||||||
constantPoolOop cp = (constantPoolOop) obj;
|
constantPoolOop cp = (constantPoolOop) obj;
|
||||||
if (cp->tags() != NULL &&
|
if (cp->tags() != NULL) {
|
||||||
(!JavaObjectsInPerm || (EnableInvokeDynamic && cp->has_pseudo_string()))) {
|
|
||||||
for (int i = 1; i < cp->length(); ++i) {
|
for (int i = 1; i < cp->length(); ++i) {
|
||||||
if (cp->tag_at(i).is_string()) {
|
if (cp->is_pointer_entry(i)) {
|
||||||
oop* base = cp->obj_at_addr_raw(i);
|
oop* base = cp->obj_at_addr_raw(i);
|
||||||
if (PSScavenge::should_scavenge(base)) {
|
if (PSScavenge::should_scavenge(base)) {
|
||||||
pm->claim_or_forward_depth(base);
|
pm->claim_or_forward_depth(base);
|
||||||
|
@ -342,6 +341,11 @@ void constantPoolKlass::oop_print_on(oop obj, outputStream* st) {
|
||||||
anObj->print_value_on(st);
|
anObj->print_value_on(st);
|
||||||
st->print(" {0x%lx}", (address)anObj);
|
st->print(" {0x%lx}", (address)anObj);
|
||||||
break;
|
break;
|
||||||
|
case JVM_CONSTANT_Object :
|
||||||
|
anObj = cp->object_at(index);
|
||||||
|
anObj->print_value_on(st);
|
||||||
|
st->print(" {0x%lx}", (address)anObj);
|
||||||
|
break;
|
||||||
case JVM_CONSTANT_Integer :
|
case JVM_CONSTANT_Integer :
|
||||||
st->print("%d", cp->int_at(index));
|
st->print("%d", cp->int_at(index));
|
||||||
break;
|
break;
|
||||||
|
@ -432,23 +436,21 @@ void constantPoolKlass::oop_verify_on(oop obj, outputStream* st) {
|
||||||
guarantee(cp->is_perm(), "should be in permspace");
|
guarantee(cp->is_perm(), "should be in permspace");
|
||||||
if (!cp->partially_loaded()) {
|
if (!cp->partially_loaded()) {
|
||||||
for (int i = 0; i< cp->length(); i++) {
|
for (int i = 0; i< cp->length(); i++) {
|
||||||
|
constantTag tag = cp->tag_at(i);
|
||||||
CPSlot entry = cp->slot_at(i);
|
CPSlot entry = cp->slot_at(i);
|
||||||
if (cp->tag_at(i).is_klass()) {
|
if (tag.is_klass()) {
|
||||||
if (entry.is_oop()) {
|
if (entry.is_oop()) {
|
||||||
guarantee(entry.get_oop()->is_perm(), "should be in permspace");
|
guarantee(entry.get_oop()->is_perm(), "should be in permspace");
|
||||||
guarantee(entry.get_oop()->is_klass(), "should be klass");
|
guarantee(entry.get_oop()->is_klass(), "should be klass");
|
||||||
}
|
}
|
||||||
}
|
} else if (tag.is_unresolved_klass()) {
|
||||||
if (cp->tag_at(i).is_unresolved_klass()) {
|
|
||||||
if (entry.is_oop()) {
|
if (entry.is_oop()) {
|
||||||
guarantee(entry.get_oop()->is_perm(), "should be in permspace");
|
guarantee(entry.get_oop()->is_perm(), "should be in permspace");
|
||||||
guarantee(entry.get_oop()->is_klass(), "should be klass");
|
guarantee(entry.get_oop()->is_klass(), "should be klass");
|
||||||
}
|
}
|
||||||
}
|
} else if (tag.is_symbol()) {
|
||||||
if (cp->tag_at(i).is_symbol()) {
|
|
||||||
guarantee(entry.get_symbol()->refcount() != 0, "should have nonzero reference count");
|
guarantee(entry.get_symbol()->refcount() != 0, "should have nonzero reference count");
|
||||||
}
|
} else if (tag.is_unresolved_string()) {
|
||||||
if (cp->tag_at(i).is_unresolved_string()) {
|
|
||||||
if (entry.is_oop()) {
|
if (entry.is_oop()) {
|
||||||
guarantee(entry.get_oop()->is_perm(), "should be in permspace");
|
guarantee(entry.get_oop()->is_perm(), "should be in permspace");
|
||||||
guarantee(entry.get_oop()->is_instance(), "should be instance");
|
guarantee(entry.get_oop()->is_instance(), "should be instance");
|
||||||
|
@ -456,8 +458,7 @@ void constantPoolKlass::oop_verify_on(oop obj, outputStream* st) {
|
||||||
else {
|
else {
|
||||||
guarantee(entry.get_symbol()->refcount() != 0, "should have nonzero reference count");
|
guarantee(entry.get_symbol()->refcount() != 0, "should have nonzero reference count");
|
||||||
}
|
}
|
||||||
}
|
} else if (tag.is_string()) {
|
||||||
if (cp->tag_at(i).is_string()) {
|
|
||||||
if (!cp->has_pseudo_string()) {
|
if (!cp->has_pseudo_string()) {
|
||||||
if (entry.is_oop()) {
|
if (entry.is_oop()) {
|
||||||
guarantee(!JavaObjectsInPerm || entry.get_oop()->is_perm(),
|
guarantee(!JavaObjectsInPerm || entry.get_oop()->is_perm(),
|
||||||
|
@ -467,8 +468,11 @@ void constantPoolKlass::oop_verify_on(oop obj, outputStream* st) {
|
||||||
} else {
|
} else {
|
||||||
// can be non-perm, can be non-instance (array)
|
// can be non-perm, can be non-instance (array)
|
||||||
}
|
}
|
||||||
|
} else if (tag.is_object()) {
|
||||||
|
assert(entry.get_oop()->is_oop(), "should be some valid oop");
|
||||||
|
} else {
|
||||||
|
assert(!cp->is_pointer_entry(i), "unhandled oop type in constantPoolKlass::verify_on");
|
||||||
}
|
}
|
||||||
// FIXME: verify JSR 292 tags JVM_CONSTANT_MethodHandle, etc.
|
|
||||||
}
|
}
|
||||||
guarantee(cp->tags()->is_perm(), "should be in permspace");
|
guarantee(cp->tags()->is_perm(), "should be in permspace");
|
||||||
guarantee(cp->tags()->is_typeArray(), "should be type array");
|
guarantee(cp->tags()->is_typeArray(), "should be type array");
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue