4396719: Mark Sweep stack overflow on deeply nested Object arrays

Use an explicit stack for object arrays and process them in chunks.

Reviewed-by: iveresov, apetrusenko
This commit is contained in:
John Coomes 2010-03-03 14:48:26 -08:00
parent 5fdec09798
commit 4f82340476
26 changed files with 419 additions and 182 deletions

View file

@ -314,24 +314,24 @@ void objArrayKlass::initialize(TRAPS) {
void objArrayKlass::oop_follow_contents(oop obj) {
assert (obj->is_array(), "obj must be array");
objArrayOop a = objArrayOop(obj);
a->follow_header();
ObjArrayKlass_OOP_ITERATE( \
a, p, \
/* we call mark_and_follow here to avoid excessive marking stack usage */ \
MarkSweep::mark_and_follow(p))
objArrayOop(obj)->follow_header();
if (UseCompressedOops) {
objarray_follow_contents<narrowOop>(obj, 0);
} else {
objarray_follow_contents<oop>(obj, 0);
}
}
#ifndef SERIALGC
void objArrayKlass::oop_follow_contents(ParCompactionManager* cm,
oop obj) {
assert (obj->is_array(), "obj must be array");
objArrayOop a = objArrayOop(obj);
a->follow_header(cm);
ObjArrayKlass_OOP_ITERATE( \
a, p, \
/* we call mark_and_follow here to avoid excessive marking stack usage */ \
PSParallelCompact::mark_and_follow(cm, p))
assert(obj->is_array(), "obj must be array");
objArrayOop(obj)->follow_header(cm);
if (UseCompressedOops) {
objarray_follow_contents<narrowOop>(cm, obj, 0);
} else {
objarray_follow_contents<oop>(cm, obj, 0);
}
}
#endif // SERIALGC