OpenJDK / bsd-port / jdk9 / hotspot
changeset 9139:cf43bef12125
8080650: Enable stubs to use frame pointers correctly
Summary: Change MacroAssembler::verified_entry() to set up RBP correctly when generating stub code.
Reviewed-by: kvn
author | zmajo |
---|---|
date | Thu, 15 Oct 2015 17:38:41 +0200 |
parents | 2abd2feb000b |
children | e012dfc7ba2c |
files | src/cpu/x86/vm/macroAssembler_x86.cpp src/cpu/x86/vm/x86_32.ad src/cpu/x86/vm/x86_64.ad |
diffstat | 3 files changed, 13 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/src/cpu/x86/vm/macroAssembler_x86.cpp Thu Oct 15 11:20:04 2015 +0000 +++ b/src/cpu/x86/vm/macroAssembler_x86.cpp Thu Oct 15 17:38:41 2015 +0200 @@ -6247,7 +6247,9 @@ // Save caller's stack pointer into RBP if the frame pointer is preserved. if (PreserveFramePointer) { movptr(rbp, rsp); - addptr(rbp, framesize + wordSize); + if (framesize > 0) { + addptr(rbp, framesize); + } } }
--- a/src/cpu/x86/vm/x86_32.ad Thu Oct 15 11:20:04 2015 +0000 +++ b/src/cpu/x86/vm/x86_32.ad Thu Oct 15 17:38:41 2015 +0200 @@ -580,7 +580,11 @@ st->print("MOV [ESP + #%d], EBP\t# Save EBP",framesize); if (PreserveFramePointer) { st->print("\n\t"); - st->print("MOV EBP, [ESP + #%d]\t# Save the caller's SP into EBP", (framesize + wordSize)); + st->print("MOV EBP, ESP\t# Save the caller's SP into EBP"); + if (framesize > 0) { + st->print("\n\t"); + st->print("ADD EBP, #%d", framesize); + } } }
--- a/src/cpu/x86/vm/x86_64.ad Thu Oct 15 11:20:04 2015 +0000 +++ b/src/cpu/x86/vm/x86_64.ad Thu Oct 15 17:38:41 2015 +0200 @@ -867,7 +867,11 @@ st->print("movq [rsp + #%d], rbp\t# Save rbp",framesize); if (PreserveFramePointer) { st->print("\n\t"); - st->print("movq rbp, [rsp + #%d]\t# Save the caller's SP into rbp", (framesize + wordSize)); + st->print("movq rbp, rsp\t# Save the caller's SP into rbp"); + if (framesize > 0) { + st->print("\n\t"); + st->print("addq rbp, #%d", framesize); + } } }