< prev index next >
src/share/vm/runtime/relocator.cpp
Print this page
rev 11179 : 8140594: Various minor code improvements (compiler)
Reviewed-by: thartmann
*** 610,621 ****
change_jumps(bci, delta);
// In case we have shrunken a tableswitch/lookupswitch statement, we store the last
// bytes that get overwritten. We have to copy the bytes after the change_jumps method
// has been called, since it is likely to update last offset in a tableswitch/lookupswitch
! if (delta < 0) {
! assert(delta>=-3, "we cannot overwrite more than 3 bytes");
memcpy(_overwrite, addr_at(bci + ilen + delta), -delta);
}
memmove(addr_at(next_bci + delta), addr_at(next_bci), code_length() - next_bci);
set_code_length(code_length() + delta);
--- 610,621 ----
change_jumps(bci, delta);
// In case we have shrunken a tableswitch/lookupswitch statement, we store the last
// bytes that get overwritten. We have to copy the bytes after the change_jumps method
// has been called, since it is likely to update last offset in a tableswitch/lookupswitch
! assert(delta >= -3, "We cannot overwrite more than 3 bytes.");
! if (delta < 0 && delta >= -3) {
memcpy(_overwrite, addr_at(bci + ilen + delta), -delta);
}
memmove(addr_at(next_bci + delta), addr_at(next_bci), code_length() - next_bci);
set_code_length(code_length() + delta);
< prev index next >