mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-25 13:54:38 +02:00
8028064: tiered may collect wrong receiver type at virtual call
When unique callee is known at compile time, recorded class may be wrong Reviewed-by: kvn, iveresov
This commit is contained in:
parent
7c32ed31d2
commit
e9b5199781
1 changed files with 8 additions and 4 deletions
|
@ -4338,11 +4338,15 @@ void GraphBuilder::print_stats() {
|
|||
#endif // PRODUCT
|
||||
|
||||
void GraphBuilder::profile_call(ciMethod* callee, Value recv, ciKlass* known_holder, Values* obj_args, bool inlined) {
|
||||
// A default method's holder is an interface
|
||||
if (known_holder != NULL && known_holder->is_interface()) {
|
||||
assert(known_holder->is_instance_klass() && ((ciInstanceKlass*)known_holder)->has_default_methods(), "should be default method");
|
||||
known_holder = NULL;
|
||||
assert(known_holder == NULL || (known_holder->is_instance_klass() &&
|
||||
(!known_holder->is_interface() ||
|
||||
((ciInstanceKlass*)known_holder)->has_default_methods())), "should be default method");
|
||||
if (known_holder != NULL) {
|
||||
if (known_holder->exact_klass() == NULL) {
|
||||
known_holder = compilation()->cha_exact_type(known_holder);
|
||||
}
|
||||
}
|
||||
|
||||
append(new ProfileCall(method(), bci(), callee, recv, known_holder, obj_args, inlined));
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue