# HG changeset patch # User zmajo # Date 1444923521 -7200 # Node ID faef2a23732962101fe1678caed4939ce124df1c # Parent a2969911663ab29c71a61aa3403e53243ad89923 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 diff -r a2969911663a -r faef2a237329 src/cpu/x86/vm/macroAssembler_x86.cpp --- a/src/cpu/x86/vm/macroAssembler_x86.cpp Wed Oct 21 11:34:08 2015 -0700 +++ b/src/cpu/x86/vm/macroAssembler_x86.cpp Thu Oct 15 17:38:41 2015 +0200 @@ -6143,7 +6143,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); + } } } diff -r a2969911663a -r faef2a237329 src/cpu/x86/vm/x86_32.ad --- a/src/cpu/x86/vm/x86_32.ad Wed Oct 21 11:34:08 2015 -0700 +++ b/src/cpu/x86/vm/x86_32.ad Thu Oct 15 17:38:41 2015 +0200 @@ -566,7 +566,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); + } } } diff -r a2969911663a -r faef2a237329 src/cpu/x86/vm/x86_64.ad --- a/src/cpu/x86/vm/x86_64.ad Wed Oct 21 11:34:08 2015 -0700 +++ b/src/cpu/x86/vm/x86_64.ad Thu Oct 15 17:38:41 2015 +0200 @@ -863,7 +863,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); + } } }