570 case T_BOOLEAN: // Save shorter types as int. Do we need sign extension at restore??
571 case T_BYTE:
572 case T_CHAR:
573 case T_SHORT:
574 case T_INT:
575 __ reg2mem_opt(Z_RET, memaddr, false);
576 break;
577 case T_OBJECT: // Save pointer types as long.
578 case T_ARRAY:
579 case T_ADDRESS:
580 case T_VOID:
581 case T_LONG:
582 __ reg2mem_opt(Z_RET, memaddr);
583 break;
584 case T_FLOAT:
585 __ freg2mem_opt(Z_FRET, memaddr, false);
586 break;
587 case T_DOUBLE:
588 __ freg2mem_opt(Z_FRET, memaddr);
589 break;
590 }
591 }
592
593 void SharedRuntime::restore_native_result(MacroAssembler *masm,
594 BasicType ret_type,
595 int frame_slots) {
596 Address memaddr(Z_SP, frame_slots * VMRegImpl::stack_slot_size);
597
598 switch (ret_type) {
599 case T_BOOLEAN: // Restore shorter types as int. Do we need sign extension at restore??
600 case T_BYTE:
601 case T_CHAR:
602 case T_SHORT:
603 case T_INT:
604 __ mem2reg_opt(Z_RET, memaddr, false);
605 break;
606 case T_OBJECT: // Restore pointer types as long.
607 case T_ARRAY:
608 case T_ADDRESS:
609 case T_VOID:
610 case T_LONG:
611 __ mem2reg_opt(Z_RET, memaddr);
612 break;
613 case T_FLOAT:
614 __ mem2freg_opt(Z_FRET, memaddr, false);
615 break;
616 case T_DOUBLE:
617 __ mem2freg_opt(Z_FRET, memaddr);
618 break;
619 }
620 }
621
622 // ---------------------------------------------------------------------------
623 // Read the array of BasicTypes from a signature, and compute where the
624 // arguments should go. Values in the VMRegPair regs array refer to 4-byte
625 // quantities. Values less than VMRegImpl::stack0 are registers, those above
626 // refer to 4-byte stack slots. All stack slots are based off of the stack pointer
627 // as framesizes are fixed.
628 // VMRegImpl::stack0 refers to the first slot 0(sp).
629 // VMRegImpl::stack0+1 refers to the memory word 4-byes higher. Registers
630 // up to RegisterImpl::number_of_registers are the 64-bit integer registers.
631
632 // Note: the INPUTS in sig_bt are in units of Java argument words, which are
633 // either 32-bit or 64-bit depending on the build. The OUTPUTS are in 32-bit
634 // units regardless of build.
635
636 // The Java calling convention is a "shifted" version of the C ABI.
637 // By skipping the first C ABI register we can call non-static jni methods
|
570 case T_BOOLEAN: // Save shorter types as int. Do we need sign extension at restore??
571 case T_BYTE:
572 case T_CHAR:
573 case T_SHORT:
574 case T_INT:
575 __ reg2mem_opt(Z_RET, memaddr, false);
576 break;
577 case T_OBJECT: // Save pointer types as long.
578 case T_ARRAY:
579 case T_ADDRESS:
580 case T_VOID:
581 case T_LONG:
582 __ reg2mem_opt(Z_RET, memaddr);
583 break;
584 case T_FLOAT:
585 __ freg2mem_opt(Z_FRET, memaddr, false);
586 break;
587 case T_DOUBLE:
588 __ freg2mem_opt(Z_FRET, memaddr);
589 break;
590 default:
591 ShouldNotReachHere();
592 break;
593 }
594 }
595
596 void SharedRuntime::restore_native_result(MacroAssembler *masm,
597 BasicType ret_type,
598 int frame_slots) {
599 Address memaddr(Z_SP, frame_slots * VMRegImpl::stack_slot_size);
600
601 switch (ret_type) {
602 case T_BOOLEAN: // Restore shorter types as int. Do we need sign extension at restore??
603 case T_BYTE:
604 case T_CHAR:
605 case T_SHORT:
606 case T_INT:
607 __ mem2reg_opt(Z_RET, memaddr, false);
608 break;
609 case T_OBJECT: // Restore pointer types as long.
610 case T_ARRAY:
611 case T_ADDRESS:
612 case T_VOID:
613 case T_LONG:
614 __ mem2reg_opt(Z_RET, memaddr);
615 break;
616 case T_FLOAT:
617 __ mem2freg_opt(Z_FRET, memaddr, false);
618 break;
619 case T_DOUBLE:
620 __ mem2freg_opt(Z_FRET, memaddr);
621 break;
622 default:
623 ShouldNotReachHere();
624 break;
625 }
626 }
627
628 // ---------------------------------------------------------------------------
629 // Read the array of BasicTypes from a signature, and compute where the
630 // arguments should go. Values in the VMRegPair regs array refer to 4-byte
631 // quantities. Values less than VMRegImpl::stack0 are registers, those above
632 // refer to 4-byte stack slots. All stack slots are based off of the stack pointer
633 // as framesizes are fixed.
634 // VMRegImpl::stack0 refers to the first slot 0(sp).
635 // VMRegImpl::stack0+1 refers to the memory word 4-byes higher. Registers
636 // up to RegisterImpl::number_of_registers are the 64-bit integer registers.
637
638 // Note: the INPUTS in sig_bt are in units of Java argument words, which are
639 // either 32-bit or 64-bit depending on the build. The OUTPUTS are in 32-bit
640 // units regardless of build.
641
642 // The Java calling convention is a "shifted" version of the C ABI.
643 // By skipping the first C ABI register we can call non-static jni methods
|