src/share/vm/c1/c1_LIRGenerator.cpp

changeset 7951
8fd636dd1c91
parent 7944
8dddcd728302
parent 7854
e8260b6328fb
child 7994
04ff2f6cd0eb
child 8316
626f594dffa6
child 8368
32b682649973
equal deleted inserted replaced
7950:0e5f64fa55c9 7951:8fd636dd1c91
2893 // e) unlock receiver 2893 // e) unlock receiver
2894 // f) move receiver into receiver-register %o0 2894 // f) move receiver into receiver-register %o0
2895 // g) lock result registers and emit call operation 2895 // g) lock result registers and emit call operation
2896 // 2896 //
2897 // Before issuing a call, we must spill-save all values on stack 2897 // Before issuing a call, we must spill-save all values on stack
2898 // that are in caller-save register. "spill-save" moves thos registers 2898 // that are in caller-save register. "spill-save" moves those registers
2899 // either in a free callee-save register or spills them if no free 2899 // either in a free callee-save register or spills them if no free
2900 // callee save register is available. 2900 // callee save register is available.
2901 // 2901 //
2902 // The problem is where to invoke spill-save. 2902 // The problem is where to invoke spill-save.
2903 // - if invoked between e) and f), we may lock callee save 2903 // - if invoked between e) and f), we may lock callee save
2904 // register in "spill-save" that destroys the receiver register 2904 // register in "spill-save" that destroys the receiver register
2905 // before f) is executed 2905 // before f) is executed
2906 // - if we rearange the f) to be earlier, by loading %o0, it 2906 // - if we rearrange f) to be earlier (by loading %o0) it
2907 // may destroy a value on the stack that is currently in %o0 2907 // may destroy a value on the stack that is currently in %o0
2908 // and is waiting to be spilled 2908 // and is waiting to be spilled
2909 // - if we keep the receiver locked while doing spill-save, 2909 // - if we keep the receiver locked while doing spill-save,
2910 // we cannot spill it as it is spill-locked 2910 // we cannot spill it as it is spill-locked
2911 // 2911 //
2934 // emit invoke code 2934 // emit invoke code
2935 bool optimized = x->target_is_loaded() && x->target_is_final(); 2935 bool optimized = x->target_is_loaded() && x->target_is_final();
2936 assert(receiver->is_illegal() || receiver->is_equal(LIR_Assembler::receiverOpr()), "must match"); 2936 assert(receiver->is_illegal() || receiver->is_equal(LIR_Assembler::receiverOpr()), "must match");
2937 2937
2938 // JSR 292 2938 // JSR 292
2939 // Preserve the SP over MethodHandle call sites. 2939 // Preserve the SP over MethodHandle call sites, if needed.
2940 ciMethod* target = x->target(); 2940 ciMethod* target = x->target();
2941 bool is_method_handle_invoke = (// %%% FIXME: Are both of these relevant? 2941 bool is_method_handle_invoke = (// %%% FIXME: Are both of these relevant?
2942 target->is_method_handle_intrinsic() || 2942 target->is_method_handle_intrinsic() ||
2943 target->is_compiled_lambda_form()); 2943 target->is_compiled_lambda_form());
2944 if (is_method_handle_invoke) { 2944 if (is_method_handle_invoke) {
2945 info->set_is_method_handle_invoke(true); 2945 info->set_is_method_handle_invoke(true);
2946 __ move(FrameMap::stack_pointer(), FrameMap::method_handle_invoke_SP_save_opr()); 2946 if(FrameMap::method_handle_invoke_SP_save_opr() != LIR_OprFact::illegalOpr) {
2947 __ move(FrameMap::stack_pointer(), FrameMap::method_handle_invoke_SP_save_opr());
2948 }
2947 } 2949 }
2948 2950
2949 switch (x->code()) { 2951 switch (x->code()) {
2950 case Bytecodes::_invokestatic: 2952 case Bytecodes::_invokestatic:
2951 __ call_static(target, result_register, 2953 __ call_static(target, result_register,
2981 fatal(err_msg("unexpected bytecode: %s", Bytecodes::name(x->code()))); 2983 fatal(err_msg("unexpected bytecode: %s", Bytecodes::name(x->code())));
2982 break; 2984 break;
2983 } 2985 }
2984 2986
2985 // JSR 292 2987 // JSR 292
2986 // Restore the SP after MethodHandle call sites. 2988 // Restore the SP after MethodHandle call sites, if needed.
2987 if (is_method_handle_invoke) { 2989 if (is_method_handle_invoke
2990 && FrameMap::method_handle_invoke_SP_save_opr() != LIR_OprFact::illegalOpr) {
2988 __ move(FrameMap::method_handle_invoke_SP_save_opr(), FrameMap::stack_pointer()); 2991 __ move(FrameMap::method_handle_invoke_SP_save_opr(), FrameMap::stack_pointer());
2989 } 2992 }
2990 2993
2991 if (x->type()->is_float() || x->type()->is_double()) { 2994 if (x->type()->is_float() || x->type()->is_double()) {
2992 // Force rounding of results from non-strictfp when in strictfp 2995 // Force rounding of results from non-strictfp when in strictfp

mercurial