Fixed bug where first call had wrong stack alignment

Tiny optimizations
This commit is contained in:
David Anderson 2005-08-17 15:57:11 +00:00
parent 85b7ac740b
commit 9eb36bd2bb
3 changed files with 7 additions and 6 deletions

Binary file not shown.

Binary file not shown.

View File

@ -221,12 +221,12 @@
; #define PUSH(v) ( stk-=sizeof(cell), *(cell *)(data+(int)stk)=v ) ; #define PUSH(v) ( stk-=sizeof(cell), *(cell *)(data+(int)stk)=v )
; ;
%macro _PUSH 1 %macro _PUSH 1
sub esi, 4 lea esi,[esi-4]
mov dword [esi], %1 mov dword [esi], %1
%endmacro %endmacro
%macro _PUSHMEM 1 %macro _PUSHMEM 1
sub esi, 4 lea esi,[esi-4]
mov ebp, dword %1 mov ebp, dword %1
mov dword [esi], ebp mov dword [esi], ebp
%endmacro %endmacro
@ -236,7 +236,7 @@
; ;
%macro _POP 1 %macro _POP 1
mov %1, dword [esi] mov %1, dword [esi]
add esi, 4 lea esi,[esi+4]
%endmacro %endmacro
@ -1021,7 +1021,7 @@ OP_RET:
j_ret: j_ret:
_POP ebx ; pop frame _POP ebx ; pop frame
add esi,4 ; pop extra param lea esi,[esi+4]
mov frm,ebx mov frm,ebx
add ebx,edi add ebx,edi
ret ret
@ -1936,7 +1936,8 @@ _amx_exec_jit:
add [esp+8],edi ; make STP absolute address for run-time checks add [esp+8],edi ; make STP absolute address for run-time checks
_POP ecx ; AMX pseudo-return address, ignored mov dword [esi], 0 ; zero this out, but we need to keep it so
; the stack frame is in tact
mov ecx,esp ; copy stack pointer mov ecx,esp ; copy stack pointer
; Call compiled code via CALL NEAR <address> ; Call compiled code via CALL NEAR <address>
call ebp call ebp