1.1 --- a/src/share/vm/ci/bcEscapeAnalyzer.cpp Mon Jul 23 13:04:59 2012 -0700 1.2 +++ b/src/share/vm/ci/bcEscapeAnalyzer.cpp Tue Jul 24 10:51:00 2012 -0700 1.3 @@ -238,9 +238,11 @@ 1.4 1.5 // some methods are obviously bindable without any type checks so 1.6 // convert them directly to an invokespecial. 1.7 - if (target->is_loaded() && !target->is_abstract() && 1.8 - target->can_be_statically_bound() && code == Bytecodes::_invokevirtual) { 1.9 - code = Bytecodes::_invokespecial; 1.10 + if (target->is_loaded() && !target->is_abstract() && target->can_be_statically_bound()) { 1.11 + switch (code) { 1.12 + case Bytecodes::_invokevirtual: code = Bytecodes::_invokespecial; break; 1.13 + case Bytecodes::_invokehandle: code = Bytecodes::_invokestatic; break; 1.14 + } 1.15 } 1.16 1.17 // compute size of arguments 1.18 @@ -866,7 +868,12 @@ 1.19 { bool will_link; 1.20 ciMethod* target = s.get_method(will_link); 1.21 ciKlass* holder = s.get_declared_method_holder(); 1.22 - invoke(state, s.cur_bc(), target, holder); 1.23 + // Push appendix argument, if one. 1.24 + if (s.has_appendix()) { 1.25 + state.apush(unknown_obj); 1.26 + } 1.27 + // Pass in raw bytecode because we need to see invokehandle instructions. 1.28 + invoke(state, s.cur_bc_raw(), target, holder); 1.29 ciType* return_type = target->return_type(); 1.30 if (!return_type->is_primitive_type()) { 1.31 state.apush(unknown_obj);