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

src/share/vm/oops/constantPoolKlass.cpp

Print this page
rev 421 : [mq]: anonk.patch

*** 33,42 **** --- 33,43 ---- c->set_length(length); c->set_tags(NULL); c->set_cache(NULL); c->set_pool_holder(NULL); + c->set_flags(0); // only set to non-zero if constant pool is merged by RedefineClasses c->set_orig_length(0); // all fields are initialized; needed for GC // initialize tag array
*** 259,272 **** --- 260,295 ---- return cp->object_size(); } void constantPoolKlass::oop_copy_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_breadth(base); + } + } + } + } } 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); + } + } + } + } } #endif // SERIALGC #ifndef PRODUCT
*** 276,285 **** --- 299,313 ---- 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"); + st->cr(); + } // Temp. remove cache so we can do lookups with original indicies. constantPoolCacheHandle cache (THREAD, cp->cache()); cp->set_cache(NULL);
*** 300,310 **** --- 328,342 ---- 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));
*** 380,391 **** --- 412,427 ---- 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");
src/share/vm/oops/constantPoolKlass.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File