-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
spu/arm64: clean up assembly code generation #12608
Conversation
Hi, you mention a "leak" but the affected code is called once during program initialization. (they are static variables) |
Neko told me to fix it after the SPU arm port was landed. Also, some of this code is called every time we branch to a new "function". We can run out of the 256MB allocated JIT memory in some games with large SPU code size as a result of the memory bloat (some Arm code here is a lot bigger than x86 versions in code size). |
@@ -1636,18 +1737,24 @@ void spu_recompiler_base::dispatch(spu_thread& spu, void*, u8* rip) | |||
|
|||
atomic_storage<u64>::release(*reinterpret_cast<u64*>(rip - 8), result); | |||
#elif defined(ARCH_ARM64) | |||
auto jump_instrs = build_function_asm<spu_function_t>("", [](native_asm& c, auto& args) |
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.
Oh I see, here is the leak. I think these are the only places where it should be changed. (bytecode is much less readable and is more difficult to work with)
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.
I see. I've removed the other changes.
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.
And keep the rebuild_ubertrampoline changes as well.
0f1dca9
to
cd03436
Compare
I also readded the |
Clean up asmjit usage so we don't unnecessarily allocate memory anymore for SPURecompiler functions.
Clean up asmjit usage so we don't unnecessarily allocate/leak memory anymore for SPURecompiler functions.
Tested with spurs test and 2 basic games and doesn't appear to cause any regressions.