You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Directly embed deopt idx instead of return address
Summary:
On ARM there's no way to reliably recover where the return address is stored by the callee. They are free to first store some additional data and then setup the frame - for example they may initially save callee saved registers to ensure that the values in their frame that they care about are closer. We could do something unsafe like search the stack for our frame pointer and then gather the IP address from there but if a callee preserved register collided with our frame pointer we'd return incorrect results.
Instead this removes storing the return address for every call and instead stores the deopt index. This takes the same amount of instructions but we do it less as not every call is a deopt. We now typically generate:
```
mov x14, #1
str x14, [x19]
```
Instead of:
```
adr x13, #0xfffe3633032c
str x13, [x29, #0x10]
```
But for example we generate none of these for decref where we previously generated 2.
We could instead save an index which is the bytecode offset for each line number as that's what we really care about currently but the free-threaded work is going to drive us to actually care about the deopt index instead so we may as well just start there.
Reviewed By: alexmalyshev
Differential Revision: D97524722
fbshipit-source-id: 2fb51c6848451496f340ccee42548829705c26f7
0 commit comments