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

Add JIT heap free spaces checks to EE JIT #332

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Souzooka
Copy link
Contributor

No description provided.

//Need to check we have space on the heap before running any recompiled code
//Resetting the heap during recompilation wipes out the prologue/epilogue!
//Checks for maximum 5mb block size of space before continuing
if (!jit_heap.has_free_space(1024 * 1024 * 5))
Copy link
Owner

@PSI-Rockin PSI-Rockin Mar 15, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do not think this is the best place to make the JIT space check, especially considering how expensive the check is. We already have a flush_jit_cache variable that gets checked when EmotionEngine::run_jit is called.

Since only recompilation can decrease free space, a better course of action would be to do the space check inside the JIT's recompile_block method. When the check fails, we can set the flush_jit_cache variable in EmotionEngine, which will not only prevent the prologue/epilogue blocks from being trashed but also provide a speed boost compared to the current method in this PR.

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