Skip to content
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

jit: Discard unused regs before a syscall #7545

Merged
merged 1 commit into from
Mar 1, 2015

Conversation

unknownbrackets
Copy link
Collaborator

This is a pretty minor optimization, though.

-[Unknown]

@hrydgard
Copy link
Owner

hrydgard commented Mar 1, 2015

Seems fine, but I'm worried about even more of these issues where games rely on the contents of registers (or stack, but that's separate), violating the calling convention. Discarding these would seem to reduce the likelyhood of getting the "right" values in the registers by a bit...

@unknownbrackets
Copy link
Collaborator Author

Well, right after the syscall we will fill the values with 0xDEADBEEF anyway (which is what the system does, at least for kernel funcs / actual syscalls.) The only reg this is not true for is V1, but that's only if the syscall doesn't use it. I can remove V1. I guess V0 also if there are any void funcs.

-[Unknown]

@hrydgard
Copy link
Owner

hrydgard commented Mar 1, 2015

Right, thanks for the 0xDEADBEEF reminder.. drop V0 and V1 and I'll merge.

This is a pretty minor optimization, though.
@unknownbrackets
Copy link
Collaborator Author

Okay, done. Also added HI/LO (these are also filled with DEADBEEF.)

-[Unknown]

hrydgard added a commit that referenced this pull request Mar 1, 2015
jit: Discard unused regs before a syscall
@hrydgard hrydgard merged commit 993fec4 into hrydgard:master Mar 1, 2015
@unknownbrackets unknownbrackets deleted the jit-minor branch March 1, 2015 19:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants