Mercurial > hg > graal-jvmci-8
diff src/cpu/zero/vm/cppInterpreter_zero.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 | 7f410b6ea66c |
children | da91efe96a93 |
line wrap: on
line diff
--- a/src/cpu/zero/vm/cppInterpreter_zero.cpp Mon Jul 23 13:04:59 2012 -0700 +++ b/src/cpu/zero/vm/cppInterpreter_zero.cpp Tue Jul 24 10:51:00 2012 -0700 @@ -646,16 +646,15 @@ oop method_type = (oop) p; // The MethodHandle is in the slot after the arguments - oop form = java_lang_invoke_MethodType::form(method_type); - int num_vmslots = java_lang_invoke_MethodTypeForm::vmslots(form); - assert(argument_slots == num_vmslots + 1, "should be"); + int num_vmslots = argument_slots - 1; oop method_handle = VMSLOTS_OBJECT(num_vmslots); // InvokeGeneric requires some extra shuffling oop mhtype = java_lang_invoke_MethodHandle::type(method_handle); bool is_exact = mhtype == method_type; if (!is_exact) { - if (method->intrinsic_id() == vmIntrinsics::_invokeExact) { + if (true || // FIXME + method->intrinsic_id() == vmIntrinsics::_invokeExact) { CALL_VM_NOCHECK_NOFIX( SharedRuntime::throw_WrongMethodTypeException( thread, method_type, mhtype)); @@ -670,8 +669,8 @@ // NB the x86 code for this (in methodHandles_x86.cpp, search for // "genericInvoker") is really really odd. I'm hoping it's trying // to accomodate odd VM/class library combinations I can ignore. - oop adapter = java_lang_invoke_MethodTypeForm::genericInvoker(form); - if (adapter == NULL) { + oop adapter = NULL; //FIXME: load the adapter from the CP cache + IF (adapter == NULL) { CALL_VM_NOCHECK_NOFIX( SharedRuntime::throw_WrongMethodTypeException( thread, method_type, mhtype)); @@ -761,7 +760,7 @@ return; } if (entry_kind != MethodHandles::_invokespecial_mh) { - int index = java_lang_invoke_DirectMethodHandle::vmindex(method_handle); + intptr_t index = java_lang_invoke_DirectMethodHandle::vmindex(method_handle); instanceKlass* rcvrKlass = (instanceKlass *) receiver->klass()->klass_part(); if (entry_kind == MethodHandles::_invokevirtual_mh) { @@ -1179,8 +1178,7 @@ intptr_t* CppInterpreter::calculate_unwind_sp(ZeroStack* stack, oop method_handle) { oop method_type = java_lang_invoke_MethodHandle::type(method_handle); - oop form = java_lang_invoke_MethodType::form(method_type); - int argument_slots = java_lang_invoke_MethodTypeForm::vmslots(form); + int argument_slots = java_lang_invoke_MethodType::ptype_slot_count(method_type); return stack->sp() + argument_slots; }