2873 // e) unlock receiver |
2873 // e) unlock receiver |
2874 // f) move receiver into receiver-register %o0 |
2874 // f) move receiver into receiver-register %o0 |
2875 // g) lock result registers and emit call operation |
2875 // g) lock result registers and emit call operation |
2876 // |
2876 // |
2877 // Before issuing a call, we must spill-save all values on stack |
2877 // Before issuing a call, we must spill-save all values on stack |
2878 // that are in caller-save register. "spill-save" moves thos registers |
2878 // that are in caller-save register. "spill-save" moves those registers |
2879 // either in a free callee-save register or spills them if no free |
2879 // either in a free callee-save register or spills them if no free |
2880 // callee save register is available. |
2880 // callee save register is available. |
2881 // |
2881 // |
2882 // The problem is where to invoke spill-save. |
2882 // The problem is where to invoke spill-save. |
2883 // - if invoked between e) and f), we may lock callee save |
2883 // - if invoked between e) and f), we may lock callee save |
2884 // register in "spill-save" that destroys the receiver register |
2884 // register in "spill-save" that destroys the receiver register |
2885 // before f) is executed |
2885 // before f) is executed |
2886 // - if we rearange the f) to be earlier, by loading %o0, it |
2886 // - if we rearrange f) to be earlier (by loading %o0) it |
2887 // may destroy a value on the stack that is currently in %o0 |
2887 // may destroy a value on the stack that is currently in %o0 |
2888 // and is waiting to be spilled |
2888 // and is waiting to be spilled |
2889 // - if we keep the receiver locked while doing spill-save, |
2889 // - if we keep the receiver locked while doing spill-save, |
2890 // we cannot spill it as it is spill-locked |
2890 // we cannot spill it as it is spill-locked |
2891 // |
2891 // |
2914 // emit invoke code |
2914 // emit invoke code |
2915 bool optimized = x->target_is_loaded() && x->target_is_final(); |
2915 bool optimized = x->target_is_loaded() && x->target_is_final(); |
2916 assert(receiver->is_illegal() || receiver->is_equal(LIR_Assembler::receiverOpr()), "must match"); |
2916 assert(receiver->is_illegal() || receiver->is_equal(LIR_Assembler::receiverOpr()), "must match"); |
2917 |
2917 |
2918 // JSR 292 |
2918 // JSR 292 |
2919 // Preserve the SP over MethodHandle call sites. |
2919 // Preserve the SP over MethodHandle call sites, if needed. |
2920 ciMethod* target = x->target(); |
2920 ciMethod* target = x->target(); |
2921 bool is_method_handle_invoke = (// %%% FIXME: Are both of these relevant? |
2921 bool is_method_handle_invoke = (// %%% FIXME: Are both of these relevant? |
2922 target->is_method_handle_intrinsic() || |
2922 target->is_method_handle_intrinsic() || |
2923 target->is_compiled_lambda_form()); |
2923 target->is_compiled_lambda_form()); |
2924 if (is_method_handle_invoke) { |
2924 if (is_method_handle_invoke) { |
2925 info->set_is_method_handle_invoke(true); |
2925 info->set_is_method_handle_invoke(true); |
2926 __ move(FrameMap::stack_pointer(), FrameMap::method_handle_invoke_SP_save_opr()); |
2926 if(FrameMap::method_handle_invoke_SP_save_opr() != LIR_OprFact::illegalOpr) { |
|
2927 __ move(FrameMap::stack_pointer(), FrameMap::method_handle_invoke_SP_save_opr()); |
|
2928 } |
2927 } |
2929 } |
2928 |
2930 |
2929 switch (x->code()) { |
2931 switch (x->code()) { |
2930 case Bytecodes::_invokestatic: |
2932 case Bytecodes::_invokestatic: |
2931 __ call_static(target, result_register, |
2933 __ call_static(target, result_register, |
2961 fatal(err_msg("unexpected bytecode: %s", Bytecodes::name(x->code()))); |
2963 fatal(err_msg("unexpected bytecode: %s", Bytecodes::name(x->code()))); |
2962 break; |
2964 break; |
2963 } |
2965 } |
2964 |
2966 |
2965 // JSR 292 |
2967 // JSR 292 |
2966 // Restore the SP after MethodHandle call sites. |
2968 // Restore the SP after MethodHandle call sites, if needed. |
2967 if (is_method_handle_invoke) { |
2969 if (is_method_handle_invoke |
|
2970 && FrameMap::method_handle_invoke_SP_save_opr() != LIR_OprFact::illegalOpr) { |
2968 __ move(FrameMap::method_handle_invoke_SP_save_opr(), FrameMap::stack_pointer()); |
2971 __ move(FrameMap::method_handle_invoke_SP_save_opr(), FrameMap::stack_pointer()); |
2969 } |
2972 } |
2970 |
2973 |
2971 if (x->type()->is_float() || x->type()->is_double()) { |
2974 if (x->type()->is_float() || x->type()->is_double()) { |
2972 // Force rounding of results from non-strictfp when in strictfp |
2975 // Force rounding of results from non-strictfp when in strictfp |