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 register allocator to JIT #92

Closed
exjam opened this issue Nov 5, 2015 · 1 comment
Closed

Add register allocator to JIT #92

exjam opened this issue Nov 5, 2015 · 1 comment

Comments

@exjam
Copy link
Member

exjam commented Nov 5, 2015

Just a basic LRU thingy will do, currently we just move to/from memory and use fixed registers.

@exjam exjam added the feature label Nov 5, 2015
@brett19
Copy link
Member

brett19 commented Jun 28, 2016

I did this with the previous JIT code, and it improved performance considerably. The main gotchya's here are that some x64 instructions require specific registers, before we perform any KC calls, we must flush our local register cache to the CoreRegs* structure, this is because any KC could access or modify this variables, and additionally might switch Core's entirely, invalidating any of the shared cache without it having been flushed. In addition to this, any branches (into or outside of JIT) and any JIT fallback calls also must flush our local cache. It's worth mentioning as well that we will need to be cautious about where we allow interrupts to occur as well, since these will also force us to flush the cache.

As an aside, in the future when we want to do cross-block optimizations, especially surrounding JIT allocation.

@brett19 brett19 closed this as completed Jul 14, 2016
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

No branches or pull requests

2 participants