8201593: Print array length in ArrayIndexOutOfBoundsException

Reviewed-by: dholmes, mdoerr, smonteith, shade, rriggs
This commit is contained in:
Goetz Lindenmaier 2018-05-07 09:11:21 +02:00
parent b812ae6e51
commit ac3043c692
34 changed files with 675 additions and 142 deletions

View file

@ -757,11 +757,14 @@ void TemplateTable::index_check_without_pop(Register array, Register index) {
assert(rbx != array, "different registers");
__ movl(rbx, index);
}
__ jump_cc(Assembler::aboveEqual,
ExternalAddress(Interpreter::_throw_ArrayIndexOutOfBoundsException_entry));
Label skip;
__ jccb(Assembler::below, skip);
// Pass array to create more detailed exceptions.
__ mov(NOT_LP64(rax) LP64_ONLY(c_rarg1), array);
__ jump(ExternalAddress(Interpreter::_throw_ArrayIndexOutOfBoundsException_entry));
__ bind(skip);
}
void TemplateTable::iaload() {
transition(itos, itos);
// rax: index