2633 enc_class preserve_SP %{ |
2633 enc_class preserve_SP %{ |
2634 debug_only(int off0 = cbuf.code_size()); |
2634 debug_only(int off0 = cbuf.code_size()); |
2635 MacroAssembler _masm(&cbuf); |
2635 MacroAssembler _masm(&cbuf); |
2636 // RBP is preserved across all calls, even compiled calls. |
2636 // RBP is preserved across all calls, even compiled calls. |
2637 // Use it to preserve RSP in places where the callee might change the SP. |
2637 // Use it to preserve RSP in places where the callee might change the SP. |
2638 __ movptr(rbp, rsp); |
2638 __ movptr(rbp_mh_SP_save, rsp); |
2639 debug_only(int off1 = cbuf.code_size()); |
2639 debug_only(int off1 = cbuf.code_size()); |
2640 assert(off1 - off0 == preserve_SP_size(), "correct size prediction"); |
2640 assert(off1 - off0 == preserve_SP_size(), "correct size prediction"); |
2641 %} |
2641 %} |
2642 |
2642 |
2643 enc_class restore_SP %{ |
2643 enc_class restore_SP %{ |
2644 MacroAssembler _masm(&cbuf); |
2644 MacroAssembler _masm(&cbuf); |
2645 __ movptr(rsp, rbp); |
2645 __ movptr(rsp, rbp_mh_SP_save); |
2646 %} |
2646 %} |
2647 |
2647 |
2648 enc_class Java_Static_Call(method meth) |
2648 enc_class Java_Static_Call(method meth) |
2649 %{ |
2649 %{ |
2650 // JAVA STATIC CALL |
2650 // JAVA STATIC CALL |
12602 %} |
12602 %} |
12603 |
12603 |
12604 // Call Java Static Instruction (method handle version) |
12604 // Call Java Static Instruction (method handle version) |
12605 // Note: If this code changes, the corresponding ret_addr_offset() and |
12605 // Note: If this code changes, the corresponding ret_addr_offset() and |
12606 // compute_padding() functions will have to be adjusted. |
12606 // compute_padding() functions will have to be adjusted. |
12607 instruct CallStaticJavaHandle(method meth, rbp_RegP rbp) %{ |
12607 instruct CallStaticJavaHandle(method meth, rbp_RegP rbp_mh_SP_save) %{ |
12608 match(CallStaticJava); |
12608 match(CallStaticJava); |
12609 predicate(((CallStaticJavaNode*) n)->is_method_handle_invoke()); |
12609 predicate(((CallStaticJavaNode*) n)->is_method_handle_invoke()); |
12610 effect(USE meth); |
12610 effect(USE meth); |
12611 // RBP is saved by all callees (for interpreter stack correction). |
12611 // RBP is saved by all callees (for interpreter stack correction). |
12612 // We use it here for a similar purpose, in {preserve,restore}_SP. |
12612 // We use it here for a similar purpose, in {preserve,restore}_SP. |