# HG changeset patch # User enevill # Date 1444923234 0 # Node ID 5b75aaed29fcdcb165b4987f4ba58552c04583c0 # Parent f50e867292b60b2e7ebd18b6b2ce218207dee126 8139674: aarch64: guarantee failure in TestOptionsWithRanges.java Summary: Fix negative overflow in instruction field Reviewed-by: kvn, roland, adinn, aph diff -r f50e867292b6 -r 5b75aaed29fc src/cpu/aarch64/vm/interp_masm_aarch64.cpp --- a/src/cpu/aarch64/vm/interp_masm_aarch64.cpp Tue Sep 29 17:01:37 2015 +0000 +++ b/src/cpu/aarch64/vm/interp_masm_aarch64.cpp Thu Oct 15 15:33:54 2015 +0000 @@ -1541,14 +1541,14 @@ if (MethodData::profile_arguments()) { Label done; int off_to_args = in_bytes(TypeEntriesAtCall::args_data_offset()); - add(mdp, mdp, off_to_args); for (int i = 0; i < TypeProfileArgsLimit; i++) { if (i > 0 || MethodData::profile_return()) { // 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()); cmp(tmp, TypeStackSlotEntries::per_arg_count()); + add(rscratch1, mdp, off_to_args); br(Assembler::LT, done); } ldr(tmp, Address(callee, Method::const_offset())); @@ -1556,26 +1556,27 @@ // stack offset o (zero based) from the start of the argument // list, for n arguments translates into offset n - o - 1 from // 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, 1); Address arg_addr = argument_address(tmp); 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); int to_add = in_bytes(TypeStackSlotEntries::per_arg_size()); - add(mdp, mdp, to_add); off_to_args += to_add; } 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()); } + add(rscratch1, mdp, off_to_args); bind(done); + mov(mdp, rscratch1); if (MethodData::profile_return()) { // We're right after the type profile for the last