< prev index next >

src/cpu/aarch64/vm/sharedRuntime_aarch64.cpp

Print this page
rev 8300 : 8079564: Use FP register as proper frame pointer in JIT compiled code on aarch64
Summary: Add support for PreserveFramePointer for debug/profile
Reviewed-by: duke


2978   // Callee-saved registers will be the same as the frame above (i.e.,
2979   // handle_exception_stub), since they were restored when we got the
2980   // exception.
2981 
2982   OopMapSet* oop_maps = new OopMapSet();
2983 
2984   oop_maps->add_gc_map(the_pc - start, new OopMap(SimpleRuntimeFrame::framesize, 0));
2985 
2986   __ reset_last_Java_frame(false, true);
2987 
2988   // Restore callee-saved registers
2989 
2990   // rfp is an implicitly saved callee saved register (i.e. the calling
2991   // convention will save restore it in prolog/epilog) Other than that
2992   // there are no callee save registers now that adapter frames are gone.
2993   // and we dont' expect an arg reg save area
2994   __ ldp(rfp, r3, Address(__ post(sp, 2 * wordSize)));
2995 
2996   // r0: exception handler
2997 
2998   // Restore SP from BP if the exception PC is a MethodHandle call site.
2999   __ ldrw(rscratch1, Address(rthread, JavaThread::is_method_handle_return_offset()));
3000   // n.b. Intel uses special register rbp_mh_SP_save here but we will
3001   // just hard wire rfp
3002   __ cmpw(rscratch1, zr);
3003   // the obvious way to conditionally copy rfp to sp if NE
3004   // Label skip;
3005   // __ br(Assembler::EQ, skip);
3006   // __ mov(sp, rfp);
3007   // __ bind(skip);
3008   // same but branchless
3009   __ mov(rscratch1, sp);
3010   __ csel(rscratch1, rfp, rscratch1, Assembler::NE);
3011   __ mov(sp, rscratch1);
3012 
3013   // We have a handler in r0 (could be deopt blob).
3014   __ mov(r8, r0);
3015 
3016   // Get the exception oop
3017   __ ldr(r0, Address(rthread, JavaThread::exception_oop_offset()));
3018   // Get the exception pc in case we are deoptimized
3019   __ ldr(r4, Address(rthread, JavaThread::exception_pc_offset()));
3020 #ifdef ASSERT
3021   __ str(zr, Address(rthread, JavaThread::exception_handler_pc_offset()));
3022   __ str(zr, Address(rthread, JavaThread::exception_pc_offset()));
3023 #endif
3024   // Clear the exception oop so GC no longer processes it as a root.
3025   __ str(zr, Address(rthread, JavaThread::exception_oop_offset()));
3026 
3027   // r0: exception oop
3028   // r8:  exception handler
3029   // r4: exception pc
3030   // Jump to handler
3031 
3032   __ br(r8);


2978   // Callee-saved registers will be the same as the frame above (i.e.,
2979   // handle_exception_stub), since they were restored when we got the
2980   // exception.
2981 
2982   OopMapSet* oop_maps = new OopMapSet();
2983 
2984   oop_maps->add_gc_map(the_pc - start, new OopMap(SimpleRuntimeFrame::framesize, 0));
2985 
2986   __ reset_last_Java_frame(false, true);
2987 
2988   // Restore callee-saved registers
2989 
2990   // rfp is an implicitly saved callee saved register (i.e. the calling
2991   // convention will save restore it in prolog/epilog) Other than that
2992   // there are no callee save registers now that adapter frames are gone.
2993   // and we dont' expect an arg reg save area
2994   __ ldp(rfp, r3, Address(__ post(sp, 2 * wordSize)));
2995 
2996   // r0: exception handler
2997 















2998   // We have a handler in r0 (could be deopt blob).
2999   __ mov(r8, r0);
3000 
3001   // Get the exception oop
3002   __ ldr(r0, Address(rthread, JavaThread::exception_oop_offset()));
3003   // Get the exception pc in case we are deoptimized
3004   __ ldr(r4, Address(rthread, JavaThread::exception_pc_offset()));
3005 #ifdef ASSERT
3006   __ str(zr, Address(rthread, JavaThread::exception_handler_pc_offset()));
3007   __ str(zr, Address(rthread, JavaThread::exception_pc_offset()));
3008 #endif
3009   // Clear the exception oop so GC no longer processes it as a root.
3010   __ str(zr, Address(rthread, JavaThread::exception_oop_offset()));
3011 
3012   // r0: exception oop
3013   // r8:  exception handler
3014   // r4: exception pc
3015   // Jump to handler
3016 
3017   __ br(r8);
< prev index next >