Mercurial > hg > truffle
comparison src/share/vm/ci/bcEscapeAnalyzer.cpp @ 6266:1d7922586cf6
7023639: JSR 292 method handle invocation needs a fast path for compiled code
6984705: JSR 292 method handle creation should not go through JNI
Summary: remove assembly code for JDK 7 chained method handles
Reviewed-by: jrose, twisti, kvn, mhaupt
Contributed-by: John Rose <john.r.rose@oracle.com>, Christian Thalinger <christian.thalinger@oracle.com>, Michael Haupt <michael.haupt@oracle.com>
author | twisti |
---|---|
date | Tue, 24 Jul 2012 10:51:00 -0700 |
parents | 5ed8f599a788 |
children | 7f813940ac35 |
comparison
equal
deleted
inserted
replaced
6241:aba91a731143 | 6266:1d7922586cf6 |
---|---|
236 ciInstanceKlass* callee_holder = ciEnv::get_instance_klass_for_declared_method_holder(holder); | 236 ciInstanceKlass* callee_holder = ciEnv::get_instance_klass_for_declared_method_holder(holder); |
237 ciInstanceKlass* actual_recv = callee_holder; | 237 ciInstanceKlass* actual_recv = callee_holder; |
238 | 238 |
239 // some methods are obviously bindable without any type checks so | 239 // some methods are obviously bindable without any type checks so |
240 // convert them directly to an invokespecial. | 240 // convert them directly to an invokespecial. |
241 if (target->is_loaded() && !target->is_abstract() && | 241 if (target->is_loaded() && !target->is_abstract() && target->can_be_statically_bound()) { |
242 target->can_be_statically_bound() && code == Bytecodes::_invokevirtual) { | 242 switch (code) { |
243 code = Bytecodes::_invokespecial; | 243 case Bytecodes::_invokevirtual: code = Bytecodes::_invokespecial; break; |
244 case Bytecodes::_invokehandle: code = Bytecodes::_invokestatic; break; | |
245 } | |
244 } | 246 } |
245 | 247 |
246 // compute size of arguments | 248 // compute size of arguments |
247 int arg_size = target->invoke_arg_size(code); | 249 int arg_size = target->invoke_arg_size(code); |
248 int arg_base = MAX2(state._stack_height - arg_size, 0); | 250 int arg_base = MAX2(state._stack_height - arg_size, 0); |
864 case Bytecodes::_invokedynamic: | 866 case Bytecodes::_invokedynamic: |
865 case Bytecodes::_invokeinterface: | 867 case Bytecodes::_invokeinterface: |
866 { bool will_link; | 868 { bool will_link; |
867 ciMethod* target = s.get_method(will_link); | 869 ciMethod* target = s.get_method(will_link); |
868 ciKlass* holder = s.get_declared_method_holder(); | 870 ciKlass* holder = s.get_declared_method_holder(); |
869 invoke(state, s.cur_bc(), target, holder); | 871 // Push appendix argument, if one. |
872 if (s.has_appendix()) { | |
873 state.apush(unknown_obj); | |
874 } | |
875 // Pass in raw bytecode because we need to see invokehandle instructions. | |
876 invoke(state, s.cur_bc_raw(), target, holder); | |
870 ciType* return_type = target->return_type(); | 877 ciType* return_type = target->return_type(); |
871 if (!return_type->is_primitive_type()) { | 878 if (!return_type->is_primitive_type()) { |
872 state.apush(unknown_obj); | 879 state.apush(unknown_obj); |
873 } else if (return_type->is_one_word()) { | 880 } else if (return_type->is_one_word()) { |
874 state.spush(); | 881 state.spush(); |