src/share/vm/oops/constantPoolKlass.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File 7043040 Cdiff src/share/vm/oops/constantPoolKlass.cpp

src/share/vm/oops/constantPoolKlass.cpp

Print this page

        

*** 283,296 **** } void constantPoolKlass::oop_push_contents(PSPromotionManager* pm, oop obj) { assert(obj->is_constantPool(), "should be constant pool"); constantPoolOop cp = (constantPoolOop) obj; ! if (cp->tags() != NULL && ! (!JavaObjectsInPerm || (EnableInvokeDynamic && cp->has_pseudo_string()))) { for (int i = 1; i < cp->length(); ++i) { ! if (cp->tag_at(i).is_string()) { oop* base = cp->obj_at_addr_raw(i); if (PSScavenge::should_scavenge(base)) { pm->claim_or_forward_depth(base); } } --- 283,295 ---- } void constantPoolKlass::oop_push_contents(PSPromotionManager* pm, oop obj) { assert(obj->is_constantPool(), "should be constant pool"); constantPoolOop cp = (constantPoolOop) obj; ! if (cp->tags() != NULL) { for (int i = 1; i < cp->length(); ++i) { ! if (cp->is_pointer_entry(i)) { oop* base = cp->obj_at_addr_raw(i); if (PSScavenge::should_scavenge(base)) { pm->claim_or_forward_depth(base); } }
*** 340,349 **** --- 339,353 ---- anObj = cp->string_at(index, CATCH); } anObj->print_value_on(st); st->print(" {0x%lx}", (address)anObj); 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 : st->print("%d", cp->int_at(index)); break; case JVM_CONSTANT_Float : st->print("%f", cp->float_at(index));
*** 430,476 **** 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()) { for (int i = 0; i< cp->length(); i++) { CPSlot entry = cp->slot_at(i); ! if (cp->tag_at(i).is_klass()) { if (entry.is_oop()) { guarantee(entry.get_oop()->is_perm(), "should be in permspace"); guarantee(entry.get_oop()->is_klass(), "should be klass"); } ! } ! if (cp->tag_at(i).is_unresolved_klass()) { if (entry.is_oop()) { guarantee(entry.get_oop()->is_perm(), "should be in permspace"); guarantee(entry.get_oop()->is_klass(), "should be klass"); } ! } ! if (cp->tag_at(i).is_symbol()) { guarantee(entry.get_symbol()->refcount() != 0, "should have nonzero reference count"); ! } ! if (cp->tag_at(i).is_unresolved_string()) { if (entry.is_oop()) { guarantee(entry.get_oop()->is_perm(), "should be in permspace"); guarantee(entry.get_oop()->is_instance(), "should be instance"); } else { guarantee(entry.get_symbol()->refcount() != 0, "should have nonzero reference count"); } ! } ! if (cp->tag_at(i).is_string()) { if (!cp->has_pseudo_string()) { if (entry.is_oop()) { guarantee(!JavaObjectsInPerm || entry.get_oop()->is_perm(), "should be in permspace"); guarantee(entry.get_oop()->is_instance(), "should be instance"); } } else { // can be non-perm, can be non-instance (array) } } - // FIXME: verify JSR 292 tags JVM_CONSTANT_MethodHandle, etc. } 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 --- 434,480 ---- 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()) { for (int i = 0; i< cp->length(); i++) { + constantTag tag = cp->tag_at(i); CPSlot entry = cp->slot_at(i); ! if (tag.is_klass()) { if (entry.is_oop()) { guarantee(entry.get_oop()->is_perm(), "should be in permspace"); guarantee(entry.get_oop()->is_klass(), "should be klass"); } ! } else if (tag.is_unresolved_klass()) { if (entry.is_oop()) { guarantee(entry.get_oop()->is_perm(), "should be in permspace"); guarantee(entry.get_oop()->is_klass(), "should be klass"); } ! } else if (tag.is_symbol()) { guarantee(entry.get_symbol()->refcount() != 0, "should have nonzero reference count"); ! } else if (tag.is_unresolved_string()) { if (entry.is_oop()) { guarantee(entry.get_oop()->is_perm(), "should be in permspace"); guarantee(entry.get_oop()->is_instance(), "should be instance"); } else { guarantee(entry.get_symbol()->refcount() != 0, "should have nonzero reference count"); } ! } else if (tag.is_string()) { if (!cp->has_pseudo_string()) { if (entry.is_oop()) { guarantee(!JavaObjectsInPerm || entry.get_oop()->is_perm(), "should be in permspace"); guarantee(entry.get_oop()->is_instance(), "should be instance"); } } else { // 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"); } } 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
src/share/vm/oops/constantPoolKlass.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File