1.1 --- a/src/share/vm/oops/constantPoolKlass.cpp Mon Mar 21 18:38:00 2011 -0700 1.2 +++ b/src/share/vm/oops/constantPoolKlass.cpp Tue Mar 22 13:36:33 2011 -0700 1.3 @@ -285,10 +285,11 @@ 1.4 void constantPoolKlass::oop_push_contents(PSPromotionManager* pm, oop obj) { 1.5 assert(obj->is_constantPool(), "should be constant pool"); 1.6 constantPoolOop cp = (constantPoolOop) obj; 1.7 - if (AnonymousClasses && cp->has_pseudo_string() && cp->tags() != NULL) { 1.8 - oop* base = (oop*)cp->base(); 1.9 - for (int i = 0; i < cp->length(); ++i, ++base) { 1.10 + if (cp->tags() != NULL && 1.11 + (!JavaObjectsInPerm || (AnonymousClasses && cp->has_pseudo_string()))) { 1.12 + for (int i = 1; i < cp->length(); ++i) { 1.13 if (cp->tag_at(i).is_string()) { 1.14 + oop* base = cp->obj_at_addr_raw(i); 1.15 if (PSScavenge::should_scavenge(base)) { 1.16 pm->claim_or_forward_depth(base); 1.17 } 1.18 @@ -460,7 +461,8 @@ 1.19 if (cp->tag_at(i).is_string()) { 1.20 if (!cp->has_pseudo_string()) { 1.21 if (entry.is_oop()) { 1.22 - guarantee(entry.get_oop()->is_perm(), "should be in permspace"); 1.23 + guarantee(!JavaObjectsInPerm || entry.get_oop()->is_perm(), 1.24 + "should be in permspace"); 1.25 guarantee(entry.get_oop()->is_instance(), "should be instance"); 1.26 } 1.27 } else {