8204606: [Aarch64] SIGSEGVs caused by C1 because of improper register usage

Use correct registers for pasing arguments

Reviewed-by: adinn, smonteith
This commit is contained in:
Andrew Haley 2018-06-12 10:27:49 +00:00
parent dff9265409
commit 1b45cbb3d5
2 changed files with 9 additions and 6 deletions

View File

@ -73,19 +73,20 @@ void RangeCheckStub::emit_code(LIR_Assembler* ce) {
}
if (_index->is_cpu_register()) {
__ mov(r22, _index->as_register());
__ mov(rscratch1, _index->as_register());
} else {
__ mov(r22, _index->as_jint());
__ mov(rscratch1, _index->as_jint());
}
Runtime1::StubID stub_id;
if (_throw_index_out_of_bounds_exception) {
stub_id = Runtime1::throw_index_exception_id;
} else {
assert(_array != NULL, "sanity");
__ mov(r23, _array->as_pointer_register());
__ mov(rscratch2, _array->as_pointer_register());
stub_id = Runtime1::throw_range_check_failed_id;
}
__ far_call(RuntimeAddress(Runtime1::entry_for(stub_id)), NULL, rscratch2);
__ lea(lr, RuntimeAddress(Runtime1::entry_for(stub_id)));
__ blr(lr);
ce->add_call_info_here(_info);
ce->verify_oop_map(_info);
debug_only(__ should_not_reach_here());

View File

@ -323,7 +323,7 @@ void Runtime1::initialize_pd() {
// target: the entry point of the method that creates and posts the exception oop
// has_argument: true if the exception needs arguments (passed in r22 and r23)
// has_argument: true if the exception needs arguments (passed in rscratch1 and rscratch2)
OopMapSet* Runtime1::generate_exception_throw(StubAssembler* sasm, address target, bool has_argument) {
// make a frame and preserve the caller's caller-save registers
@ -332,7 +332,9 @@ OopMapSet* Runtime1::generate_exception_throw(StubAssembler* sasm, address targe
if (!has_argument) {
call_offset = __ call_RT(noreg, noreg, target);
} else {
call_offset = __ call_RT(noreg, noreg, target, r22, r23);
__ mov(c_rarg1, rscratch1);
__ mov(c_rarg2, rscratch2);
call_offset = __ call_RT(noreg, noreg, target);
}
OopMapSet* oop_maps = new OopMapSet();
oop_maps->add_gc_map(call_offset, oop_map);