8075957: Reduce calls to the GC specific object visitors in oopDesc

Reviewed-by: brutisso, mgerdin, pliden
This commit is contained in:
Stefan Karlsson 2015-03-26 11:28:19 +01:00
parent 602b7d79e9
commit ba1d121fe0
26 changed files with 82 additions and 76 deletions

View file

@ -64,18 +64,22 @@ void MarkSweep::follow_class_loader(ClassLoaderData* cld) {
MarkSweep::follow_cld_closure.do_cld(cld);
}
void MarkSweep::follow_array(objArrayOop array, int index) {
ObjArrayKlass* k = (ObjArrayKlass*)array->klass();
k->oop_follow_contents(array, index);
}
void MarkSweep::follow_stack() {
do {
while (!_marking_stack.is_empty()) {
oop obj = _marking_stack.pop();
assert (obj->is_gc_marked(), "p must be marked");
obj->follow_contents();
follow_object(obj);
}
// Process ObjArrays one at a time to avoid marking stack bloat.
if (!_objarray_stack.is_empty()) {
ObjArrayTask task = _objarray_stack.pop();
ObjArrayKlass* k = (ObjArrayKlass*)task.obj()->klass();
k->oop_follow_contents(task.obj(), task.index());
follow_array(objArrayOop(task.obj()), task.index());
}
} while (!_marking_stack.is_empty() || !_objarray_stack.is_empty());
}