< prev index next >
src/hotspot/cpu/sparc/interp_masm_sparc.cpp
Print this page
rev 49800 : 8201593: Print array length in ArrayIndexOutOfBoundsException.
*** 893,904 ****
Label index_ok;
cmp(index, tmp);
throw_if_not_1_icc( lessUnsigned, index_ok );
if (index_shift > 0) delayed()->sll(index, index_shift, index);
else delayed()->add(array, index, res); // addr - const offset in index
// convention: move aberrant index into G3_scratch for exception message
! mov(index, G3_scratch);
throw_if_not_2( Interpreter::_throw_ArrayIndexOutOfBoundsException_entry, G4_scratch, index_ok);
// add offset if didn't do it in delay slot
if (index_shift > 0) add(array, index, res); // addr - const offset in index
}
--- 893,906 ----
Label index_ok;
cmp(index, tmp);
throw_if_not_1_icc( lessUnsigned, index_ok );
if (index_shift > 0) delayed()->sll(index, index_shift, index);
else delayed()->add(array, index, res); // addr - const offset in index
+ // Pass the array to create more detailed exceptions.
// convention: move aberrant index into G3_scratch for exception message
! mov(index, Otos_i);
! mov(array, G3_scratch);
throw_if_not_2( Interpreter::_throw_ArrayIndexOutOfBoundsException_entry, G4_scratch, index_ok);
// add offset if didn't do it in delay slot
if (index_shift > 0) add(array, index, res); // addr - const offset in index
}
< prev index next >