767 transition(vtos, atos);
768
769 locals_index_wide(Z_tmp_1);
770 __ mem2reg_opt(Z_tos, aaddress(_masm, Z_tmp_1));
771 }
772
773 void TemplateTable::index_check(Register array, Register index, unsigned int shift) {
774 assert_different_registers(Z_R1_scratch, array, index);
775
776 // Check array.
777 __ null_check(array, Z_R0_scratch, arrayOopDesc::length_offset_in_bytes());
778
779 // Sign extend index for use by indexed load.
780 __ z_lgfr(index, index);
781
782 // Check index.
783 Label index_ok;
784 __ z_cl(index, Address(array, arrayOopDesc::length_offset_in_bytes()));
785 __ z_brl(index_ok);
786 __ lgr_if_needed(Z_ARG3, index); // See generate_ArrayIndexOutOfBounds_handler().
787 // Give back the array to create more detailed exceptions.
788 __ lgr_if_needed(Z_ARG2, array); // See generate_ArrayIndexOutOfBounds_handler().
789 __ load_absolute_address(Z_R1_scratch,
790 Interpreter::_throw_ArrayIndexOutOfBoundsException_entry);
791 __ z_bcr(Assembler::bcondAlways, Z_R1_scratch);
792 __ bind(index_ok);
793
794 if (shift > 0)
795 __ z_sllg(index, index, shift);
796 }
797
798 void TemplateTable::iaload() {
799 transition(itos, itos);
800
801 __ pop_ptr(Z_tmp_1); // array
802 // Index is in Z_tos.
803 Register index = Z_tos;
804 index_check(Z_tmp_1, index, LogBytesPerInt); // Kills Z_ARG3.
805 // Load the value.
806 __ mem2reg_opt(Z_tos,
807 Address(Z_tmp_1, index, arrayOopDesc::base_offset_in_bytes(T_INT)),
|
767 transition(vtos, atos);
768
769 locals_index_wide(Z_tmp_1);
770 __ mem2reg_opt(Z_tos, aaddress(_masm, Z_tmp_1));
771 }
772
773 void TemplateTable::index_check(Register array, Register index, unsigned int shift) {
774 assert_different_registers(Z_R1_scratch, array, index);
775
776 // Check array.
777 __ null_check(array, Z_R0_scratch, arrayOopDesc::length_offset_in_bytes());
778
779 // Sign extend index for use by indexed load.
780 __ z_lgfr(index, index);
781
782 // Check index.
783 Label index_ok;
784 __ z_cl(index, Address(array, arrayOopDesc::length_offset_in_bytes()));
785 __ z_brl(index_ok);
786 __ lgr_if_needed(Z_ARG3, index); // See generate_ArrayIndexOutOfBounds_handler().
787 // Pass the array to create more detailed exceptions.
788 __ lgr_if_needed(Z_ARG2, array); // See generate_ArrayIndexOutOfBounds_handler().
789 __ load_absolute_address(Z_R1_scratch,
790 Interpreter::_throw_ArrayIndexOutOfBoundsException_entry);
791 __ z_bcr(Assembler::bcondAlways, Z_R1_scratch);
792 __ bind(index_ok);
793
794 if (shift > 0)
795 __ z_sllg(index, index, shift);
796 }
797
798 void TemplateTable::iaload() {
799 transition(itos, itos);
800
801 __ pop_ptr(Z_tmp_1); // array
802 // Index is in Z_tos.
803 Register index = Z_tos;
804 index_check(Z_tmp_1, index, LogBytesPerInt); // Kills Z_ARG3.
805 // Load the value.
806 __ mem2reg_opt(Z_tos,
807 Address(Z_tmp_1, index, arrayOopDesc::base_offset_in_bytes(T_INT)),
|