8277964: ClassCastException with no stack trace is thrown with -Xcomp in method handle invocation

Reviewed-by: dlong, mchung, dholmes
This commit is contained in:
Vladimir Kozlov 2021-12-15 21:45:45 +00:00
parent 69b5d49e4f
commit d3408a46b7
7 changed files with 148 additions and 2 deletions

View file

@ -818,6 +818,18 @@ bool Method::can_be_statically_bound(InstanceKlass* context) const {
return (method_holder() == context) && can_be_statically_bound();
}
/**
* Returns false if this is one of specially treated methods for
* which we have to provide stack trace in throw in compiled code.
* Returns true otherwise.
*/
bool Method::can_omit_stack_trace() {
if (klass_name() == vmSymbols::sun_invoke_util_ValueConversions()) {
return false; // All methods in sun.invoke.util.ValueConversions
}
return true;
}
bool Method::is_accessor() const {
return is_getter() || is_setter();
}