# HG changeset patch # User roland # Date 1389101794 -3600 # Node ID 71131b418c039cc56d535776939b6376710df384 # Parent e9d7daf0d91b85493d9f5285c1ab22ef9d3a8005 8028064: tiered may collect wrong receiver type at virtual call Summary: when unique callee is known at compile time, recorded class may be wrong Reviewed-by: kvn, iveresov diff -r e9d7daf0d91b -r 71131b418c03 hotspot/src/share/vm/c1/c1_GraphBuilder.cpp --- a/hotspot/src/share/vm/c1/c1_GraphBuilder.cpp Tue Jan 07 12:38:22 2014 +0100 +++ b/hotspot/src/share/vm/c1/c1_GraphBuilder.cpp Tue Jan 07 14:36:34 2014 +0100 @@ -4338,11 +4338,15 @@ #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)); }