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

JitArm64: Implement memcheck #10162

Merged
merged 13 commits into from Nov 21, 2021
Merged

Conversation

JosJuice
Copy link
Member

No description provided.

in_far_code = true;
SwitchToFarCode();
fastmem_area->slowmem_code = GetCodePtr();
m_handler_to_loc[handler] = GetCodePtr();
Copy link
Member

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...

Copy link
Member Author

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.
@JMC47 JMC47 merged commit d2ca103 into dolphin-emu:master Nov 21, 2021
10 checks passed
@JosJuice JosJuice deleted the jitarm64-memcheck branch November 21, 2021 08:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants