Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Simplify inline exit frames. #345
When invoking C++ from JIT code, we need to construct an "exit frame"
Notably, this means there is a small inline helper function every time
This patch makes additional improves to the inline-exit path by also
asherkin left a comment
This has indeed massively improved breakpad stack walking, and the stack layout is a lot easier to grok, thanks! Tested the new unbound native error path and that all seems fine too.
Does the x64 JIT need the same additions before this can be merged? I'll take a look into the Emscripten build failure.
When invoking C++ from JIT code, we need to construct an "exit frame" so that FrameIterator can recover a stack trace. The normal way of creating an exit frame is implicitly, via a call. The call pushes a return address, and the new prologue configures the frame pointer and stores it in the Environment. Notably, this means there is a small inline helper function every time we transition to C++. For performance-sensitive code, like native calls, this is not ideal. Instead we create an "inline" exit frame. Instead of calling, we derive the return address at compile-time, push it, and thus avoid the call instructions. This patch makes additional improves to the inline-exit path by also eliding "leave" instructions. It also preserves ebp, which should improve stack walking by Breakpad.