diff --git a/src/hotspot/cpu/aarch64/aarch64.ad b/src/hotspot/cpu/aarch64/aarch64.ad index 015bfabc2f7..b7eb2499589 100644 --- a/src/hotspot/cpu/aarch64/aarch64.ad +++ b/src/hotspot/cpu/aarch64/aarch64.ad @@ -1648,8 +1648,8 @@ int MachCallRuntimeNode::ret_addr_offset() { // for real runtime callouts it will be six instructions // see aarch64_enc_java_to_runtime // adr(rscratch2, retaddr) + // str(rscratch2, Address(rthread, JavaThread::last_Java_pc_offset())); // lea(rscratch1, RuntimeAddress(addr) - // stp(zr, rscratch2, Address(__ pre(sp, -2 * wordSize))) // blr(rscratch1) CodeBlob *cb = CodeCache::find_blob(_entry_point); if (cb) { @@ -3774,14 +3774,13 @@ encode %{ __ post_call_nop(); } else { Label retaddr; + // Make the anchor frame walkable __ adr(rscratch2, retaddr); + __ str(rscratch2, Address(rthread, JavaThread::last_Java_pc_offset())); __ lea(rscratch1, RuntimeAddress(entry)); - // Leave a breadcrumb for JavaFrameAnchor::capture_last_Java_pc() - __ stp(zr, rscratch2, Address(__ pre(sp, -2 * wordSize))); __ blr(rscratch1); __ bind(retaddr); __ post_call_nop(); - __ add(sp, sp, 2 * wordSize); } if (Compile::current()->max_vector_size() > 0) { __ reinitialize_ptrue();