mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 15:24:43 +02:00
8076456: Remove unnecessary oopDesc::klass() calls
Reviewed-by: pliden, jmasa
This commit is contained in:
parent
232a59cb40
commit
66fc45f602
4 changed files with 12 additions and 13 deletions
|
@ -180,7 +180,7 @@ ParCompactionManager::gc_thread_compaction_manager(int index) {
|
||||||
void InstanceKlass::oop_pc_follow_contents(oop obj, ParCompactionManager* cm) {
|
void InstanceKlass::oop_pc_follow_contents(oop obj, ParCompactionManager* cm) {
|
||||||
assert(obj != NULL, "can't follow the content of NULL object");
|
assert(obj != NULL, "can't follow the content of NULL object");
|
||||||
|
|
||||||
PSParallelCompact::follow_klass(cm, obj->klass());
|
PSParallelCompact::follow_klass(cm, this);
|
||||||
// Only mark the header and let the scan of the meta-data mark
|
// Only mark the header and let the scan of the meta-data mark
|
||||||
// everything else.
|
// everything else.
|
||||||
|
|
||||||
|
@ -301,9 +301,9 @@ void ObjArrayKlass::oop_pc_follow_contents(oop obj, ParCompactionManager* cm) {
|
||||||
PSParallelCompact::follow_klass(cm, this);
|
PSParallelCompact::follow_klass(cm, this);
|
||||||
|
|
||||||
if (UseCompressedOops) {
|
if (UseCompressedOops) {
|
||||||
oop_pc_follow_contents_specialized<narrowOop>(this, obj, 0, cm);
|
oop_pc_follow_contents_specialized<narrowOop>(objArrayOop(obj), 0, cm);
|
||||||
} else {
|
} else {
|
||||||
oop_pc_follow_contents_specialized<oop>(this, obj, 0, cm);
|
oop_pc_follow_contents_specialized<oop>(objArrayOop(obj), 0, cm);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -56,15 +56,14 @@ inline void ParCompactionManager::follow_contents(oop obj) {
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class T>
|
template <class T>
|
||||||
inline void oop_pc_follow_contents_specialized(ObjArrayKlass* klass, oop obj, int index, ParCompactionManager* cm) {
|
inline void oop_pc_follow_contents_specialized(objArrayOop obj, int index, ParCompactionManager* cm) {
|
||||||
objArrayOop a = objArrayOop(obj);
|
const size_t len = size_t(obj->length());
|
||||||
const size_t len = size_t(a->length());
|
|
||||||
const size_t beg_index = size_t(index);
|
const size_t beg_index = size_t(index);
|
||||||
assert(beg_index < len || len == 0, "index too large");
|
assert(beg_index < len || len == 0, "index too large");
|
||||||
|
|
||||||
const size_t stride = MIN2(len - beg_index, ObjArrayMarkingStride);
|
const size_t stride = MIN2(len - beg_index, ObjArrayMarkingStride);
|
||||||
const size_t end_index = beg_index + stride;
|
const size_t end_index = beg_index + stride;
|
||||||
T* const base = (T*)a->base();
|
T* const base = (T*)obj->base();
|
||||||
T* const beg = base + beg_index;
|
T* const beg = base + beg_index;
|
||||||
T* const end = base + end_index;
|
T* const end = base + end_index;
|
||||||
|
|
||||||
|
@ -74,15 +73,15 @@ inline void oop_pc_follow_contents_specialized(ObjArrayKlass* klass, oop obj, in
|
||||||
}
|
}
|
||||||
|
|
||||||
if (end_index < len) {
|
if (end_index < len) {
|
||||||
cm->push_objarray(a, end_index); // Push the continuation.
|
cm->push_objarray(obj, end_index); // Push the continuation.
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void ParCompactionManager::follow_contents(objArrayOop obj, int index) {
|
inline void ParCompactionManager::follow_contents(objArrayOop obj, int index) {
|
||||||
if (UseCompressedOops) {
|
if (UseCompressedOops) {
|
||||||
oop_pc_follow_contents_specialized<narrowOop>((ObjArrayKlass*)obj->klass(), obj, index, this);
|
oop_pc_follow_contents_specialized<narrowOop>(obj, index, this);
|
||||||
} else {
|
} else {
|
||||||
oop_pc_follow_contents_specialized<oop>((ObjArrayKlass*)obj->klass(), obj, index, this);
|
oop_pc_follow_contents_specialized<oop>(obj, index, this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -68,7 +68,7 @@ void MarkSweep::follow_class_loader(ClassLoaderData* cld) {
|
||||||
|
|
||||||
void InstanceKlass::oop_ms_follow_contents(oop obj) {
|
void InstanceKlass::oop_ms_follow_contents(oop obj) {
|
||||||
assert(obj != NULL, "can't follow the content of NULL object");
|
assert(obj != NULL, "can't follow the content of NULL object");
|
||||||
MarkSweep::follow_klass(obj->klass());
|
MarkSweep::follow_klass(this);
|
||||||
|
|
||||||
oop_oop_iterate_oop_maps<true>(obj, &MarkSweep::mark_and_push_closure);
|
oop_oop_iterate_oop_maps<true>(obj, &MarkSweep::mark_and_push_closure);
|
||||||
}
|
}
|
||||||
|
|
|
@ -152,7 +152,7 @@ INLINE void InstanceKlass::oop_oop_iterate_oop_maps_bounded(oop obj, OopClosureT
|
||||||
template <bool nv, class OopClosureType>
|
template <bool nv, class OopClosureType>
|
||||||
INLINE int InstanceKlass::oop_oop_iterate(oop obj, OopClosureType* closure) {
|
INLINE int InstanceKlass::oop_oop_iterate(oop obj, OopClosureType* closure) {
|
||||||
if (Devirtualizer<nv>::do_metadata(closure)) {
|
if (Devirtualizer<nv>::do_metadata(closure)) {
|
||||||
Devirtualizer<nv>::do_klass(closure, obj->klass());
|
Devirtualizer<nv>::do_klass(closure, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
oop_oop_iterate_oop_maps<nv>(obj, closure);
|
oop_oop_iterate_oop_maps<nv>(obj, closure);
|
||||||
|
@ -176,7 +176,7 @@ template <bool nv, class OopClosureType>
|
||||||
INLINE int InstanceKlass::oop_oop_iterate_bounded(oop obj, OopClosureType* closure, MemRegion mr) {
|
INLINE int InstanceKlass::oop_oop_iterate_bounded(oop obj, OopClosureType* closure, MemRegion mr) {
|
||||||
if (Devirtualizer<nv>::do_metadata(closure)) {
|
if (Devirtualizer<nv>::do_metadata(closure)) {
|
||||||
if (mr.contains(obj)) {
|
if (mr.contains(obj)) {
|
||||||
Devirtualizer<nv>::do_klass(closure, obj->klass());
|
Devirtualizer<nv>::do_klass(closure, this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue