-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pass indirect call target in first register #436
Conversation
I agree this is a better approach than a thread-local in memory. |
d9fdc1a
to
6372a16
Compare
Rather than pass the indirect call target in a global static, this change passes the target in the first parameter register to the wrapper. The wrapper then shifts the remaining parameters so that the callee receives the correct parameters.
cbba2f1
to
07e8c3d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
I think at some point we'll want to generate scrub registers in GenCallAsm.cpp to avoid the redundant push/pops and avoid spilling the function pointer to the stack in indirect calls, but this is already better than what we currently do since it's only on a protected stack. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. I wish our handling of stack alignment were less ad-hoc.
Rather than pass the indirect call target in a global static, this change passes the target in the first parameter register to the wrapper. The wrapper then shifts the remaining parameters so that the callee receives the correct parameters.