mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 14:19:46 -06:00
Fix stack misalignment issues.
- Call ABI_AlignStack even on x86-64. - Have ABI_AlignStack respect the difference in current alignment between the root JIT function, which has a prolog, and ProtectFunction thunks, which do not. This was causing many games to crash on start on OS X. Since this might otherwise mean changing the stack pointer before every call... - Have one prolog/epilog function rather than two (one of which definitely did not do what it was thought to do), and make it actually work like a normal one, so that the stack frame shows up properly in the debugger. There should be no performance impact.
This commit is contained in:
@ -217,7 +217,7 @@ void VertexLoader::CompileVertexTranslator()
|
||||
PanicAlert("Trying to recompile a vertex translator");
|
||||
|
||||
m_compiledCode = GetCodePtr();
|
||||
ABI_EmitPrologue(4);
|
||||
ABI_PushAllCalleeSavedRegsAndAdjustStack();
|
||||
|
||||
// Start loop here
|
||||
const u8 *loop_start = GetCodePtr();
|
||||
@ -499,7 +499,8 @@ void VertexLoader::CompileVertexTranslator()
|
||||
#endif
|
||||
|
||||
J_CC(CC_NZ, loop_start, true);
|
||||
ABI_EmitEpilogue(4);
|
||||
ABI_PopAllCalleeSavedRegsAndAdjustStack();
|
||||
RET();
|
||||
#endif
|
||||
m_NativeFmt->Initialize(vtx_decl);
|
||||
}
|
||||
|
Reference in New Issue
Block a user