diff options
author | roland <none@none> | 2014-01-07 14:36:34 +0100 |
---|---|---|
committer | roland <none@none> | 2014-01-07 14:36:34 +0100 |
commit | 784f4f24936d8a267584befa87cceee9662815ea (patch) | |
tree | b5a80279c5d5aaff05ef2ba1b5bddfbd1fbd674f /src/share/vm/c1 | |
parent | 25b82605648144b1dc7c657a928e1693328eaddb (diff) |
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
Diffstat (limited to 'src/share/vm/c1')
-rw-r--r-- | src/share/vm/c1/c1_GraphBuilder.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/share/vm/c1/c1_GraphBuilder.cpp b/src/share/vm/c1/c1_GraphBuilder.cpp index 1bfd4bad4..8d7d4e36d 100644 --- a/src/share/vm/c1/c1_GraphBuilder.cpp +++ b/src/share/vm/c1/c1_GraphBuilder.cpp @@ -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)); } |