Mercurial > hg > truffle
diff src/share/vm/opto/callGenerator.cpp @ 12966:b2ee5dc63353
8024070: C2 needs some form of type speculation
Summary: record unused type profile information with type system, propagate and use it.
Reviewed-by: kvn, twisti
author | roland |
---|---|
date | Wed, 23 Oct 2013 12:40:23 +0200 |
parents | 3213ba4d3dff |
children | e74074c34312 |
line wrap: on
line diff
--- a/src/share/vm/opto/callGenerator.cpp Wed Oct 23 10:00:39 2013 +0200 +++ b/src/share/vm/opto/callGenerator.cpp Wed Oct 23 12:40:23 2013 +0200 @@ -486,6 +486,8 @@ JVMState* new_jvms = DirectCallGenerator::generate(jvms, parent_parser); return new_jvms; } + + virtual bool is_string_late_inline() const { return true; } }; CallGenerator* CallGenerator::for_string_late_inline(ciMethod* method, CallGenerator* inline_cg) { @@ -773,7 +775,7 @@ ciMethod* target = oop_ptr->const_oop()->as_method_handle()->get_vmtarget(); guarantee(!target->is_method_handle_intrinsic(), "should not happen"); // XXX remove const int vtable_index = Method::invalid_vtable_index; - CallGenerator* cg = C->call_generator(target, vtable_index, false, jvms, true, PROB_ALWAYS, true, true); + CallGenerator* cg = C->call_generator(target, vtable_index, false, jvms, true, PROB_ALWAYS, NULL, true, true); assert(!cg->is_late_inline() || cg->is_mh_late_inline(), "no late inline here"); if (cg != NULL && cg->is_inline()) return cg; @@ -829,6 +831,7 @@ int vtable_index = Method::invalid_vtable_index; bool call_does_dispatch = false; + ciKlass* speculative_receiver_type = NULL; if (is_virtual_or_interface) { ciInstanceKlass* klass = target->holder(); Node* receiver_node = kit.argument(0); @@ -837,9 +840,12 @@ target = C->optimize_virtual_call(caller, jvms->bci(), klass, target, receiver_type, is_virtual, call_does_dispatch, vtable_index); // out-parameters + // We lack profiling at this call but type speculation may + // provide us with a type + speculative_receiver_type = receiver_type->speculative_type(); } - CallGenerator* cg = C->call_generator(target, vtable_index, call_does_dispatch, jvms, true, PROB_ALWAYS, true, true); + CallGenerator* cg = C->call_generator(target, vtable_index, call_does_dispatch, jvms, true, PROB_ALWAYS, speculative_receiver_type, true, true); assert(!cg->is_late_inline() || cg->is_mh_late_inline(), "no late inline here"); if (cg != NULL && cg->is_inline()) return cg;