< prev index next >

src/hotspot/cpu/arm/templateTable_arm.cpp

Print this page
rev 49973 : 8201593: Print array length in ArrayIndexOutOfBoundsException.
Reviewed-by: dholmes, mdoerr, smonteith


 729   __ ldr(R0_tos, local);
 730 }
 731 
 732 void TemplateTable::index_check(Register array, Register index) {
 733   // Pop ptr into array
 734   __ pop_ptr(array);
 735   index_check_without_pop(array, index);
 736 }
 737 
 738 void TemplateTable::index_check_without_pop(Register array, Register index) {
 739   assert_different_registers(array, index, Rtemp);
 740   // check array
 741   __ null_check(array, Rtemp, arrayOopDesc::length_offset_in_bytes());
 742   // check index
 743   __ ldr_s32(Rtemp, Address(array, arrayOopDesc::length_offset_in_bytes()));
 744   __ cmp_32(index, Rtemp);
 745   if (index != R4_ArrayIndexOutOfBounds_index) {
 746     // convention with generate_ArrayIndexOutOfBounds_handler()
 747     __ mov(R4_ArrayIndexOutOfBounds_index, index, hs);
 748   }

 749   __ b(Interpreter::_throw_ArrayIndexOutOfBoundsException_entry, hs);
 750 }
 751 
 752 
 753 void TemplateTable::iaload() {
 754   transition(itos, itos);
 755   const Register Rarray = R1_tmp;
 756   const Register Rindex = R0_tos;
 757 
 758   index_check(Rarray, Rindex);
 759   __ ldr_s32(R0_tos, get_array_elem_addr(T_INT, Rarray, Rindex, Rtemp));
 760 }
 761 
 762 
 763 void TemplateTable::laload() {
 764   transition(itos, ltos);
 765   const Register Rarray = R1_tmp;
 766   const Register Rindex = R0_tos;
 767 
 768   index_check(Rarray, Rindex);




 729   __ ldr(R0_tos, local);
 730 }
 731 
 732 void TemplateTable::index_check(Register array, Register index) {
 733   // Pop ptr into array
 734   __ pop_ptr(array);
 735   index_check_without_pop(array, index);
 736 }
 737 
 738 void TemplateTable::index_check_without_pop(Register array, Register index) {
 739   assert_different_registers(array, index, Rtemp);
 740   // check array
 741   __ null_check(array, Rtemp, arrayOopDesc::length_offset_in_bytes());
 742   // check index
 743   __ ldr_s32(Rtemp, Address(array, arrayOopDesc::length_offset_in_bytes()));
 744   __ cmp_32(index, Rtemp);
 745   if (index != R4_ArrayIndexOutOfBounds_index) {
 746     // convention with generate_ArrayIndexOutOfBounds_handler()
 747     __ mov(R4_ArrayIndexOutOfBounds_index, index, hs);
 748   }
 749   __ mov(R1, array, hs);
 750   __ b(Interpreter::_throw_ArrayIndexOutOfBoundsException_entry, hs);
 751 }
 752 
 753 
 754 void TemplateTable::iaload() {
 755   transition(itos, itos);
 756   const Register Rarray = R1_tmp;
 757   const Register Rindex = R0_tos;
 758 
 759   index_check(Rarray, Rindex);
 760   __ ldr_s32(R0_tos, get_array_elem_addr(T_INT, Rarray, Rindex, Rtemp));
 761 }
 762 
 763 
 764 void TemplateTable::laload() {
 765   transition(itos, ltos);
 766   const Register Rarray = R1_tmp;
 767   const Register Rindex = R0_tos;
 768 
 769   index_check(Rarray, Rindex);


< prev index next >