Simplify inline exit frames. #345
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.