mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 08:27:46 +00:00
LibJIT: Emit unwindable stack frames
Flip the order from save-registers,enter and leave,restore-registers to enter,save-register and restore-registers,leave. This way the return address is next to the saved frame pointer like unwinding routines expect.
This commit is contained in:
parent
93908fcbcb
commit
77dc7c4d36
1 changed files with 4 additions and 4 deletions
|
@ -522,19 +522,19 @@ struct Assembler {
|
|||
|
||||
void enter()
|
||||
{
|
||||
push_callee_saved_registers();
|
||||
|
||||
push(Operand::Register(Reg::RBP));
|
||||
mov(Operand::Register(Reg::RBP), Operand::Register(Reg::RSP));
|
||||
|
||||
push_callee_saved_registers();
|
||||
}
|
||||
|
||||
void exit()
|
||||
{
|
||||
pop_callee_saved_registers();
|
||||
|
||||
// leave
|
||||
emit8(0xc9);
|
||||
|
||||
pop_callee_saved_registers();
|
||||
|
||||
// ret
|
||||
emit8(0xc3);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue