532 // from the start of the call to the point where the return address |
532 // from the start of the call to the point where the return address |
533 // will point. |
533 // will point. |
534 // The "return address" is the address of the call instruction, plus 8. |
534 // The "return address" is the address of the call instruction, plus 8. |
535 |
535 |
536 int MachCallStaticJavaNode::ret_addr_offset() { |
536 int MachCallStaticJavaNode::ret_addr_offset() { |
537 return NativeCall::instruction_size; // call; delay slot |
537 int offset = NativeCall::instruction_size; // call; delay slot |
|
538 if (_method_handle_invoke) |
|
539 offset += 4; // restore SP |
|
540 return offset; |
538 } |
541 } |
539 |
542 |
540 int MachCallDynamicJavaNode::ret_addr_offset() { |
543 int MachCallDynamicJavaNode::ret_addr_offset() { |
541 int vtable_index = this->_vtable_index; |
544 int vtable_index = this->_vtable_index; |
542 if (vtable_index < 0) { |
545 if (vtable_index < 0) { |
2437 enc_class Java_To_Runtime (method meth) %{ // CALL Java_To_Runtime |
2440 enc_class Java_To_Runtime (method meth) %{ // CALL Java_To_Runtime |
2438 // CALL directly to the runtime |
2441 // CALL directly to the runtime |
2439 // The user of this is responsible for ensuring that R_L7 is empty (killed). |
2442 // The user of this is responsible for ensuring that R_L7 is empty (killed). |
2440 emit_call_reloc(cbuf, $meth$$method, relocInfo::runtime_call_type, |
2443 emit_call_reloc(cbuf, $meth$$method, relocInfo::runtime_call_type, |
2441 /*preserve_g2=*/true, /*force far call*/true); |
2444 /*preserve_g2=*/true, /*force far call*/true); |
|
2445 %} |
|
2446 |
|
2447 enc_class preserve_SP %{ |
|
2448 MacroAssembler _masm(&cbuf); |
|
2449 __ mov(SP, L7_mh_SP_save); |
|
2450 %} |
|
2451 |
|
2452 enc_class restore_SP %{ |
|
2453 MacroAssembler _masm(&cbuf); |
|
2454 __ mov(L7_mh_SP_save, SP); |
2442 %} |
2455 %} |
2443 |
2456 |
2444 enc_class Java_Static_Call (method meth) %{ // JAVA STATIC CALL |
2457 enc_class Java_Static_Call (method meth) %{ // JAVA STATIC CALL |
2445 // CALL to fixup routine. Fixup routine uses ScopeDesc info to determine |
2458 // CALL to fixup routine. Fixup routine uses ScopeDesc info to determine |
2446 // who we intended to call. |
2459 // who we intended to call. |
9211 // ============================================================================ |
9224 // ============================================================================ |
9212 // Call Instructions |
9225 // Call Instructions |
9213 // Call Java Static Instruction |
9226 // Call Java Static Instruction |
9214 instruct CallStaticJavaDirect( method meth ) %{ |
9227 instruct CallStaticJavaDirect( method meth ) %{ |
9215 match(CallStaticJava); |
9228 match(CallStaticJava); |
|
9229 predicate(! ((CallStaticJavaNode*)n)->is_method_handle_invoke()); |
9216 effect(USE meth); |
9230 effect(USE meth); |
9217 |
9231 |
9218 size(8); |
9232 size(8); |
9219 ins_cost(CALL_COST); |
9233 ins_cost(CALL_COST); |
9220 format %{ "CALL,static ; NOP ==> " %} |
9234 format %{ "CALL,static ; NOP ==> " %} |
9221 ins_encode( Java_Static_Call( meth ), call_epilog ); |
9235 ins_encode( Java_Static_Call( meth ), call_epilog ); |
|
9236 ins_pc_relative(1); |
|
9237 ins_pipe(simple_call); |
|
9238 %} |
|
9239 |
|
9240 // Call Java Static Instruction (method handle version) |
|
9241 instruct CallStaticJavaHandle(method meth, l7RegP l7_mh_SP_save) %{ |
|
9242 match(CallStaticJava); |
|
9243 predicate(((CallStaticJavaNode*)n)->is_method_handle_invoke()); |
|
9244 effect(USE meth, KILL l7_mh_SP_save); |
|
9245 |
|
9246 size(8); |
|
9247 ins_cost(CALL_COST); |
|
9248 format %{ "CALL,static/MethodHandle" %} |
|
9249 ins_encode(preserve_SP, Java_Static_Call(meth), restore_SP, call_epilog); |
9222 ins_pc_relative(1); |
9250 ins_pc_relative(1); |
9223 ins_pipe(simple_call); |
9251 ins_pipe(simple_call); |
9224 %} |
9252 %} |
9225 |
9253 |
9226 // Call Java Dynamic Instruction |
9254 // Call Java Dynamic Instruction |