Mercurial > hg > graal-compiler
comparison src/share/vm/c1/c1_LIRGenerator.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 | e2fe93124108 |
children | 957c266d8bc5 09aad8452938 |
comparison
equal
deleted
inserted
replaced
6241:aba91a731143 | 6266:1d7922586cf6 |
---|---|
1938 __ null_check(value.result(), info); | 1938 __ null_check(value.result(), info); |
1939 } | 1939 } |
1940 } | 1940 } |
1941 | 1941 |
1942 | 1942 |
1943 void LIRGenerator::do_TypeCast(TypeCast* x) { | |
1944 LIRItem value(x->obj(), this); | |
1945 value.load_item(); | |
1946 // the result is the same as from the node we are casting | |
1947 set_result(x, value.result()); | |
1948 } | |
1949 | |
1950 | |
1943 void LIRGenerator::do_Throw(Throw* x) { | 1951 void LIRGenerator::do_Throw(Throw* x) { |
1944 LIRItem exception(x->exception(), this); | 1952 LIRItem exception(x->exception(), this); |
1945 exception.load_item(); | 1953 exception.load_item(); |
1946 set_no_result(x); | 1954 set_no_result(x); |
1947 LIR_Opr exception_opr = exception.result(); | 1955 LIR_Opr exception_opr = exception.result(); |
2765 assert(receiver->is_illegal() || receiver->is_equal(LIR_Assembler::receiverOpr()), "must match"); | 2773 assert(receiver->is_illegal() || receiver->is_equal(LIR_Assembler::receiverOpr()), "must match"); |
2766 | 2774 |
2767 // JSR 292 | 2775 // JSR 292 |
2768 // Preserve the SP over MethodHandle call sites. | 2776 // Preserve the SP over MethodHandle call sites. |
2769 ciMethod* target = x->target(); | 2777 ciMethod* target = x->target(); |
2770 if (target->is_method_handle_invoke()) { | 2778 bool is_method_handle_invoke = (// %%% FIXME: Are both of these relevant? |
2779 target->is_method_handle_intrinsic() || | |
2780 target->is_compiled_lambda_form()); | |
2781 if (is_method_handle_invoke) { | |
2771 info->set_is_method_handle_invoke(true); | 2782 info->set_is_method_handle_invoke(true); |
2772 __ move(FrameMap::stack_pointer(), FrameMap::method_handle_invoke_SP_save_opr()); | 2783 __ move(FrameMap::stack_pointer(), FrameMap::method_handle_invoke_SP_save_opr()); |
2773 } | 2784 } |
2774 | 2785 |
2775 switch (x->code()) { | 2786 switch (x->code()) { |
2841 break; | 2852 break; |
2842 } | 2853 } |
2843 | 2854 |
2844 // JSR 292 | 2855 // JSR 292 |
2845 // Restore the SP after MethodHandle call sites. | 2856 // Restore the SP after MethodHandle call sites. |
2846 if (target->is_method_handle_invoke()) { | 2857 if (is_method_handle_invoke) { |
2847 __ move(FrameMap::method_handle_invoke_SP_save_opr(), FrameMap::stack_pointer()); | 2858 __ move(FrameMap::method_handle_invoke_SP_save_opr(), FrameMap::stack_pointer()); |
2848 } | 2859 } |
2849 | 2860 |
2850 if (x->type()->is_float() || x->type()->is_double()) { | 2861 if (x->type()->is_float() || x->type()->is_double()) { |
2851 // Force rounding of results from non-strictfp when in strictfp | 2862 // Force rounding of results from non-strictfp when in strictfp |
3025 LIRItem value(x->recv(), this); | 3036 LIRItem value(x->recv(), this); |
3026 value.load_item(); | 3037 value.load_item(); |
3027 recv = new_register(T_OBJECT); | 3038 recv = new_register(T_OBJECT); |
3028 __ move(value.result(), recv); | 3039 __ move(value.result(), recv); |
3029 } | 3040 } |
3030 __ profile_call(x->method(), x->bci_of_invoke(), mdo, recv, tmp, x->known_holder()); | 3041 __ profile_call(x->method(), x->bci_of_invoke(), x->callee(), mdo, recv, tmp, x->known_holder()); |
3031 } | 3042 } |
3032 | 3043 |
3033 void LIRGenerator::do_ProfileInvoke(ProfileInvoke* x) { | 3044 void LIRGenerator::do_ProfileInvoke(ProfileInvoke* x) { |
3034 // We can safely ignore accessors here, since c2 will inline them anyway, | 3045 // We can safely ignore accessors here, since c2 will inline them anyway, |
3035 // accessors are also always mature. | 3046 // accessors are also always mature. |