1.1 --- a/src/share/vm/opto/callGenerator.cpp Wed Oct 23 10:00:39 2013 +0200 1.2 +++ b/src/share/vm/opto/callGenerator.cpp Wed Oct 23 12:40:23 2013 +0200 1.3 @@ -486,6 +486,8 @@ 1.4 JVMState* new_jvms = DirectCallGenerator::generate(jvms, parent_parser); 1.5 return new_jvms; 1.6 } 1.7 + 1.8 + virtual bool is_string_late_inline() const { return true; } 1.9 }; 1.10 1.11 CallGenerator* CallGenerator::for_string_late_inline(ciMethod* method, CallGenerator* inline_cg) { 1.12 @@ -773,7 +775,7 @@ 1.13 ciMethod* target = oop_ptr->const_oop()->as_method_handle()->get_vmtarget(); 1.14 guarantee(!target->is_method_handle_intrinsic(), "should not happen"); // XXX remove 1.15 const int vtable_index = Method::invalid_vtable_index; 1.16 - CallGenerator* cg = C->call_generator(target, vtable_index, false, jvms, true, PROB_ALWAYS, true, true); 1.17 + CallGenerator* cg = C->call_generator(target, vtable_index, false, jvms, true, PROB_ALWAYS, NULL, true, true); 1.18 assert(!cg->is_late_inline() || cg->is_mh_late_inline(), "no late inline here"); 1.19 if (cg != NULL && cg->is_inline()) 1.20 return cg; 1.21 @@ -829,6 +831,7 @@ 1.22 int vtable_index = Method::invalid_vtable_index; 1.23 bool call_does_dispatch = false; 1.24 1.25 + ciKlass* speculative_receiver_type = NULL; 1.26 if (is_virtual_or_interface) { 1.27 ciInstanceKlass* klass = target->holder(); 1.28 Node* receiver_node = kit.argument(0); 1.29 @@ -837,9 +840,12 @@ 1.30 target = C->optimize_virtual_call(caller, jvms->bci(), klass, target, receiver_type, 1.31 is_virtual, 1.32 call_does_dispatch, vtable_index); // out-parameters 1.33 + // We lack profiling at this call but type speculation may 1.34 + // provide us with a type 1.35 + speculative_receiver_type = receiver_type->speculative_type(); 1.36 } 1.37 1.38 - CallGenerator* cg = C->call_generator(target, vtable_index, call_does_dispatch, jvms, true, PROB_ALWAYS, true, true); 1.39 + CallGenerator* cg = C->call_generator(target, vtable_index, call_does_dispatch, jvms, true, PROB_ALWAYS, speculative_receiver_type, true, true); 1.40 assert(!cg->is_late_inline() || cg->is_mh_late_inline(), "no late inline here"); 1.41 if (cg != NULL && cg->is_inline()) 1.42 return cg;