Improve Pike's machine-code ABI to be closer to the C-ABI.
Currently the Pike machine-code ABI for internal calls has the return address only in the pike_frame
. This causes external tools (like eg perf
) not getting the correct call-graph.
The configure option --with-mc-stack-frames
is intended to fix this albeit it is buggy, and does not handle tail calls and catch
-resumption correctly.
The issue with catch
-resumption is probably easiest to fix by having F_CATCH
and F_CATCH_AT
just not reuse the active catch context.
For the tail call case, it may be best to move allocation of the dummy stack frame to the caller (rather than the callee) (just as it already done for the pike_frame
). The issue then becomes how to detect when a new frame needs to be allocated, and on return how to detect which type of stack frame it was.