void constantPoolCacheKlass::oop_print_on(oop obj, outputStream* st) { assert(obj->is_constantPoolCache(), "obj must be constant pool cache"); constantPoolCacheOop cache = (constantPoolCacheOop)obj; // super print arrayKlass::oop_print_on(obj, st); // print constant pool cache entries for (int i = 0; i < cache->length(); i++) cache->entry_at(i)->print(st, i); }
void constantPoolCacheKlass::oop_follow_contents(oop obj) { assert(obj->is_constantPoolCache(), "obj must be constant pool cache"); constantPoolCacheOop cache = (constantPoolCacheOop)obj; // Performance tweak: We skip iterating over the klass pointer since we // know that Universe::constantPoolCacheKlassObj never moves. // gc of constant pool cache instance variables MarkSweep::mark_and_push((oop*)cache->constant_pool_addr()); // gc of constant pool cache entries int i = cache->length(); while (i-- > 0) cache->entry_at(i)->follow_contents(); }
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; }
int constantPoolCacheKlass::oop_oop_iterate(oop obj, OopClosure* blk) { assert(obj->is_constantPoolCache(), "obj must be constant pool cache"); constantPoolCacheOop cache = (constantPoolCacheOop)obj; // Get size before changing pointers. // Don't call size() or oop_size() since that is a virtual call. int size = cache->object_size(); // Performance tweak: We skip iterating over the klass pointer since we // know that Universe::constantPoolCacheKlassObj never moves. // iteration over constant pool cache instance variables blk->do_oop((oop*)cache->constant_pool_addr()); // iteration over constant pool cache entries for (int i = 0; i < cache->length(); i++) cache->entry_at(i)->oop_iterate(blk); return size; }
int constantPoolCacheKlass::oop_update_pointers(ParCompactionManager* cm, oop obj) { assert(obj->is_constantPoolCache(), "obj must be constant pool cache"); constantPoolCacheOop cache = (constantPoolCacheOop)obj; // Iteration over constant pool cache instance variables PSParallelCompact::adjust_pointer((oop*)cache->constant_pool_addr()); // iteration over constant pool cache entries for (int i = 0; i < cache->length(); ++i) { cache->entry_at(i)->update_pointers(); } return cache->object_size(); }
void constantPoolCacheKlass::oop_push_contents(PSPromotionManager* pm, oop obj) { assert(obj->is_constantPoolCache(), "should be constant pool"); if (ScavengeRootsInCode) { constantPoolCacheOop cache = (constantPoolCacheOop)obj; // during a scavenge, it is safe to inspect my pool, since it is perm constantPoolOop pool = cache->constant_pool(); assert(pool->is_constantPool(), "should be constant pool"); for (int i = 0; i < cache->length(); i++) { ConstantPoolCacheEntry* e = cache->entry_at(i); oop* p = (oop*)&e->_f1; if (PSScavenge::should_scavenge(p)) pm->claim_or_forward_depth(p); assert(!(e->is_vfinal() && PSScavenge::should_scavenge((oop*)&e->_f2)), "no live oops here"); } } }
int constantPoolCacheKlass::oop_update_pointers(ParCompactionManager* cm, oop obj, HeapWord* beg_addr, HeapWord* end_addr) { assert(obj->is_constantPoolCache(), "obj must be constant pool cache"); constantPoolCacheOop cache = (constantPoolCacheOop)obj; // Iteration over constant pool cache instance variables heapRef* p; p = (heapRef*)cache->constant_pool_addr(); PSParallelCompact::adjust_pointer(p, beg_addr, end_addr); // Iteration over constant pool cache entries for (int i = 0; i < cache->length(); ++i) { cache->entry_at(i)->update_pointers(beg_addr, end_addr); } return cache->object_size(); }
int constantPoolCacheKlass::oop_size(oop obj) const { assert(obj->is_constantPoolCache(), "must be constantPool"); return constantPoolCacheOop(obj)->object_size(); }
bool constantPoolCacheKlass::oop_is_conc_safe(oop obj) const { assert(obj->is_constantPoolCache(), "should be constant pool"); return constantPoolCacheOop(obj)->is_conc_safe(); }
void constantPoolCacheKlass::oop_copy_contents(PSPromotionManager* pm, oop obj) { assert(obj->is_constantPoolCache(), "should be constant pool"); }