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
JitArm64: Implement memcheck #10162
JitArm64: Implement memcheck #10162
Conversation
e67392c
to
7f761da
Compare
| in_far_code = true; | ||
| SwitchToFarCode(); | ||
| fastmem_area->slowmem_code = GetCodePtr(); | ||
| m_handler_to_loc[handler] = GetCodePtr(); |
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.
You could save a few lines of code here by using if (!jo.memcheck) m_handler_to_loc[handler] = GetCodePtr();, however this would perform an empty map lookup. No clue which one is better...
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.
Hmm... I was thinking that the "A reusable slowmem handler was found" case would also need to be guarded by a jo.memcheck check. I suppose that that isn't actually necessary, because there is no code that is adding elements to m_handler_to_loc when we have jo.memcheck, but it feels like something that would be confusing to a first-time reader of the code. So I think I'd like to do it the way it currently is.
You can now specify an already allocated register for it to use as a temporary register, and it also supports being called while in farcode.
Fixes a problem introduced in the previous commit.
If a host register has been newly allocated for the destination guest register, and the load triggers an exception, we must make sure to not write the old value in the host register into ppcState. This commit achieves this by not marking the register as dirty until after the load is done.
Being able to preserve the address register is useful for the next commit, and W0 is the address register used for loads. Saving the address register used for stores, W1, was already supported.
Small optimization. If the caller already has an FPR that it isn't using, might as well pass it on to fpr.Flush.
7f761da
to
5490797
Compare
No description provided.