This commit is contained in:
Coleen Phillimore 2011-04-12 14:18:53 -07:00
commit 3c4d3002f2
30 changed files with 168 additions and 120 deletions

View file

@ -1431,32 +1431,41 @@ void java_lang_Throwable::fill_in_stack_trace(Handle throwable, TRAPS) {
}
}
#ifdef ASSERT
assert(st_method() == method && st.bci() == bci,
"Wrong stack trace");
st.next();
// vframeStream::method isn't GC-safe so store off a copy
// of the methodOop in case we GC.
if (!st.at_end()) {
st_method = st.method();
}
assert(st_method() == method && st.bci() == bci,
"Wrong stack trace");
st.next();
// vframeStream::method isn't GC-safe so store off a copy
// of the methodOop in case we GC.
if (!st.at_end()) {
st_method = st.method();
}
#endif
// the format of the stacktrace will be:
// - 1 or more fillInStackTrace frames for the exception class (skipped)
// - 0 or more <init> methods for the exception class (skipped)
// - rest of the stack
if (!skip_fillInStackTrace_check) {
// check "fillInStackTrace" only once, so we negate the flag
// after the first time check.
skip_fillInStackTrace_check = true;
if (method->name() == vmSymbols::fillInStackTrace_name()) {
if ((method->name() == vmSymbols::fillInStackTrace_name() ||
method->name() == vmSymbols::fillInStackTrace0_name()) &&
throwable->is_a(method->method_holder())) {
continue;
}
else {
skip_fillInStackTrace_check = true; // gone past them all
}
}
// skip <init> methods of the exceptions klass. If there is <init> methods
// that belongs to a superclass of the exception we are going to skipping
// them in stack trace. This is simlar to classic VM.
if (!skip_throwableInit_check) {
assert(skip_fillInStackTrace_check, "logic error in backtrace filtering");
// skip <init> methods of the exception class and superclasses
// This is simlar to classic VM.
if (method->name() == vmSymbols::object_initializer_name() &&
throwable->is_a(method->method_holder())) {
continue;
} else {
// if no "Throwable.init()" method found, we stop checking it next time.
// there are none or we've seen them all - either way stop checking
skip_throwableInit_check = true;
}
}