This commit is contained in:
Zoltan Majo 2015-10-15 17:40:39 +00:00
commit ab88e9aa93
3 changed files with 13 additions and 3 deletions

View File

@ -6247,7 +6247,9 @@ void MacroAssembler::verified_entry(int framesize, int stack_bang_size, bool fp_
// 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);
}
}
}

View File

@ -580,7 +580,11 @@ void MachPrologNode::format(PhaseRegAlloc* ra_, outputStream* st) const {
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);
}
}
}

View File

@ -867,7 +867,11 @@ void MachPrologNode::format(PhaseRegAlloc* ra_, outputStream* st) const {
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);
}
}
}