8139674: aarch64: guarantee failure in TestOptionsWithRanges.java
Fix negative overflow in instruction field Reviewed-by: kvn, roland, adinn, aph
This commit is contained in:
parent
c1408bb0c8
commit
47040f764d
@ -1547,14 +1547,14 @@ void InterpreterMacroAssembler::profile_arguments_type(Register mdp, Register ca
|
|||||||
if (MethodData::profile_arguments()) {
|
if (MethodData::profile_arguments()) {
|
||||||
Label done;
|
Label done;
|
||||||
int off_to_args = in_bytes(TypeEntriesAtCall::args_data_offset());
|
int off_to_args = in_bytes(TypeEntriesAtCall::args_data_offset());
|
||||||
add(mdp, mdp, off_to_args);
|
|
||||||
|
|
||||||
for (int i = 0; i < TypeProfileArgsLimit; i++) {
|
for (int i = 0; i < TypeProfileArgsLimit; i++) {
|
||||||
if (i > 0 || MethodData::profile_return()) {
|
if (i > 0 || MethodData::profile_return()) {
|
||||||
// If return value type is profiled we may have no argument to profile
|
// If return value type is profiled we may have no argument to profile
|
||||||
ldr(tmp, Address(mdp, in_bytes(TypeEntriesAtCall::cell_count_offset())-off_to_args));
|
ldr(tmp, Address(mdp, in_bytes(TypeEntriesAtCall::cell_count_offset())));
|
||||||
sub(tmp, tmp, i*TypeStackSlotEntries::per_arg_count());
|
sub(tmp, tmp, i*TypeStackSlotEntries::per_arg_count());
|
||||||
cmp(tmp, TypeStackSlotEntries::per_arg_count());
|
cmp(tmp, TypeStackSlotEntries::per_arg_count());
|
||||||
|
add(rscratch1, mdp, off_to_args);
|
||||||
br(Assembler::LT, done);
|
br(Assembler::LT, done);
|
||||||
}
|
}
|
||||||
ldr(tmp, Address(callee, Method::const_offset()));
|
ldr(tmp, Address(callee, Method::const_offset()));
|
||||||
@ -1562,26 +1562,27 @@ void InterpreterMacroAssembler::profile_arguments_type(Register mdp, Register ca
|
|||||||
// stack offset o (zero based) from the start of the argument
|
// stack offset o (zero based) from the start of the argument
|
||||||
// list, for n arguments translates into offset n - o - 1 from
|
// list, for n arguments translates into offset n - o - 1 from
|
||||||
// the end of the argument list
|
// the end of the argument list
|
||||||
ldr(rscratch1, Address(mdp, in_bytes(TypeEntriesAtCall::stack_slot_offset(i))-off_to_args));
|
ldr(rscratch1, Address(mdp, in_bytes(TypeEntriesAtCall::stack_slot_offset(i))));
|
||||||
sub(tmp, tmp, rscratch1);
|
sub(tmp, tmp, rscratch1);
|
||||||
sub(tmp, tmp, 1);
|
sub(tmp, tmp, 1);
|
||||||
Address arg_addr = argument_address(tmp);
|
Address arg_addr = argument_address(tmp);
|
||||||
ldr(tmp, arg_addr);
|
ldr(tmp, arg_addr);
|
||||||
|
|
||||||
Address mdo_arg_addr(mdp, in_bytes(TypeEntriesAtCall::argument_type_offset(i))-off_to_args);
|
Address mdo_arg_addr(mdp, in_bytes(TypeEntriesAtCall::argument_type_offset(i)));
|
||||||
profile_obj_type(tmp, mdo_arg_addr);
|
profile_obj_type(tmp, mdo_arg_addr);
|
||||||
|
|
||||||
int to_add = in_bytes(TypeStackSlotEntries::per_arg_size());
|
int to_add = in_bytes(TypeStackSlotEntries::per_arg_size());
|
||||||
add(mdp, mdp, to_add);
|
|
||||||
off_to_args += to_add;
|
off_to_args += to_add;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (MethodData::profile_return()) {
|
if (MethodData::profile_return()) {
|
||||||
ldr(tmp, Address(mdp, in_bytes(TypeEntriesAtCall::cell_count_offset())-off_to_args));
|
ldr(tmp, Address(mdp, in_bytes(TypeEntriesAtCall::cell_count_offset())));
|
||||||
sub(tmp, tmp, TypeProfileArgsLimit*TypeStackSlotEntries::per_arg_count());
|
sub(tmp, tmp, TypeProfileArgsLimit*TypeStackSlotEntries::per_arg_count());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
add(rscratch1, mdp, off_to_args);
|
||||||
bind(done);
|
bind(done);
|
||||||
|
mov(mdp, rscratch1);
|
||||||
|
|
||||||
if (MethodData::profile_return()) {
|
if (MethodData::profile_return()) {
|
||||||
// We're right after the type profile for the last
|
// We're right after the type profile for the last
|
||||||
|
Loading…
x
Reference in New Issue
Block a user