int typeArrayKlass::oop_oop_iterate_m(oop obj, OopClosure* blk, MemRegion mr) { assert(obj->is_typeArray(),"must be a type array"); typeArrayOop t = typeArrayOop(obj); // Performance tweak: We skip iterating over the klass pointer since we // know that Universe::typeArrayKlass never moves. return t->object_size(); }
inline int TypeArrayKlass::oop_oop_iterate_impl(oop obj, ExtendedOopClosure* closure) { assert(obj->is_typeArray(),"must be a type array"); typeArrayOop t = typeArrayOop(obj); // Performance tweak: We skip iterating over the klass pointer since we // know that Universe::TypeArrayKlass never moves. return t->object_size(); }
int typeArrayKlass::oop_adjust_pointers(oop obj) { assert(obj->is_typeArray(),"must be a type array"); typeArrayOop t = typeArrayOop(obj); // Performance tweak: We skip iterating over the klass pointer since we // know that Universe::typeArrayKlass never moves. return t->object_size(); }
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; }
inline void G1CMTask::process_grey_object(oop obj) { assert(scan || obj->is_typeArray(), "Skipping scan of grey non-typeArray"); assert(G1CMObjArrayProcessor::is_array_slice(obj) || _nextMarkBitMap->isMarked((HeapWord*) obj), "Any stolen object should be a slice or marked"); if (scan) { if (G1CMObjArrayProcessor::is_array_slice(obj)) { _words_scanned += _objArray_processor.process_slice(obj); } else if (G1CMObjArrayProcessor::should_be_sliced(obj)) { _words_scanned += _objArray_processor.process_obj(obj); } else { _words_scanned += obj->oop_iterate_size(_cm_oop_closure);; } } check_limits(); }
// Return true if oop represents an object that is "visible" // to the java world. static inline bool visible_oop(oop o) { // the sentinel for deleted handles isn't visible if (o == JNIHandles::deleted_handle()) { return false; } // instance if (o->is_instance()) { // instance objects are visible if (o->klass() != SystemDictionary::Class_klass()) { return true; } if (java_lang_Class::is_primitive(o)) { return true; } // java.lang.Classes are visible Klass* k = java_lang_Class::as_Klass(o); if (k->is_klass()) { // if it's a class for an object, an object array, or // primitive (type) array then it's visible. if (k->is_instance_klass()) { return true; } if (k->is_objArray_klass()) { return true; } if (k->is_typeArray_klass()) { return true; } } return false; } // object arrays are visible if they aren't system object arrays if (o->is_objArray()) { return true; } // type arrays are visible if (o->is_typeArray()) { return true; } // everything else (Method*s, ...) aren't visible return false; }; // end of visible_oop()
inline void G1CMTask::make_reference_grey(oop obj) { if (_cm->par_mark(obj)) { // No OrderAccess:store_load() is needed. It is implicit in the // CAS done in G1CMBitMap::parMark() call in the routine above. HeapWord* global_finger = _cm->finger(); // We only need to push a newly grey object on the mark // stack if it is in a section of memory the mark bitmap // scan has already examined. Mark bitmap scanning // maintains progress "fingers" for determining that. // // Notice that the global finger might be moving forward // concurrently. This is not a problem. In the worst case, we // mark the object while it is above the global finger and, by // the time we read the global finger, it has moved forward // past this object. In this case, the object will probably // be visited when a task is scanning the region and will also // be pushed on the stack. So, some duplicate work, but no // correctness problems. if (is_below_finger(obj, global_finger)) { if (obj->is_typeArray()) { // Immediately process arrays of primitive types, rather // than pushing on the mark stack. This keeps us from // adding humongous objects to the mark stack that might // be reclaimed before the entry is processed - see // selection of candidates for eager reclaim of humongous // objects. The cost of the additional type test is // mitigated by avoiding a trip through the mark stack, // by only doing a bookkeeping update and avoiding the // actual scan of the object - a typeArray contains no // references, and the metadata is built-in. process_grey_object<false>(obj); } else { push(obj); } } } }
int typeArrayKlass::oop_update_pointers(ParCompactionManager* cm, oop obj) { assert(obj->is_typeArray(),"must be a type array"); return typeArrayOop(obj)->object_size(); }
void typeArrayKlass::oop_push_contents(PSPromotionManager* pm, oop obj) { assert(obj->is_typeArray(),"must be a type array"); }
void typeArrayKlass::oop_follow_contents(ParCompactionManager* cm, oop obj) { assert(obj->is_typeArray(),"must be a type array"); // Performance tweak: We skip iterating over the klass pointer since we // know that Universe::typeArrayKlass never moves. }
int typeArrayKlass::oop_size(oop obj) const { assert(obj->is_typeArray(),"must be a type array"); typeArrayOop t = typeArrayOop(obj); return t->object_size(); }
void TypeArrayKlass::oop_push_contents(PSPromotionManager* pm, oop obj) { ShouldNotReachHere(); assert(obj->is_typeArray(),"must be a type array"); }