diff --git a/xpcom/reflect/xptcall/src/md/os2/xptcinvoke_vacpp.asm b/xpcom/reflect/xptcall/src/md/os2/xptcinvoke_vacpp.asm index a1472d607ae..6207cc6c876 100644 --- a/xpcom/reflect/xptcall/src/md/os2/xptcinvoke_vacpp.asm +++ b/xpcom/reflect/xptcall/src/md/os2/xptcinvoke_vacpp.asm @@ -36,9 +36,9 @@ COMMENT | -*- Mode: asm; tab-width: 8; c-basic-offset: 4 -*- conforming (<= 4 bytes, enum or pointer) parameters into eax, edx and ecx, and the four leftmost float types atop the FP stack. As "this" goes into eax, we only have to load edx and ecx (if there are two parameters). - Nonconforming parameters go on the stack. As the right-size space has - to be allocated at the proper place (order of parameters) in the stack - for each conforming parameter, we simply copy them all. | + Nonconforming parameters go on the stack. As the right-size space has + to be allocated at the proper place (order of parameters) in the stack + for each conforming parameter, we simply copy them all. | .486P @@ -47,37 +47,39 @@ COMMENT | -*- Mode: asm; tab-width: 8; c-basic-offset: 4 -*- .CODE - EXTERN OPTLINK invoke_copy_to_stack__FPUiUlP13nsXPTCVariant:PROC + EXTERN OPTLINK invoke_copy_to_stack__FPUiUlP13nsXPTCVariant:PROC - ; Optlink puts pStack in eax, count in edx, params in ecx -CallMethodFromVTable__FPvUiPUiT1T2iT6T3 PROC OPTLINK EXPORT pStack, count, params, + ; Optlink puts pStack in eax, count in edx, params in ecx +CallMethodFromVTable__FPvUiPUiT1T2iT6T3 PROC OPTLINK EXPORT pStack, count, params, that, index, ibytes, cpc, cpp, fpc, fpp - mov eax, esp ; set up value of pStack for copy call - sub eax, dword ptr [ibytes] ; make room for copied params - mov esp, eax ; adjust stack pointer accordingly - sub esp, 0Ch ; make room for three invoke_copy params - call invoke_copy_to_stack__FPUiUlP13nsXPTCVariant + mov eax, esp ; set up value of pStack for copy call + sub eax, dword ptr [ibytes] ; make room for copied params + mov esp, eax ; adjust stack pointer accordingly + sub esp, 0Ch ; make room for three invoke_copy params + call invoke_copy_to_stack__FPUiUlP13nsXPTCVariant - add esp, 0Ch ; reset esp - mov eax, dword ptr [that] ; get 'that' ("this" ptr) + add esp, 0Ch ; reset esp + mov eax, dword ptr [that] ; get 'that' ("this" ptr) mov edx, dword ptr [eax] - add eax, dword ptr [edx+24h]; adjust 'that' pointer - push eax ; push 'that' on stack - mov ebx, dword ptr [index] ; get index - shl ebx, 03h ; index *= 8 bytes per method - add ebx, 08h ; += 8 at head of vtable - add ebx, [eax] ; calculate address + mov ebx, dword ptr [index] ; get index + shl ebx, 03h ; index *= 8 bytes per method + add ebx, 08h ; += 8 at head of vtable + add ebx, [eax] ; calculate address + + mov ecx, dword ptr [ebx+04h] + add eax, ecx + push eax ;************************************** - ; Load fpparams into registers + ; Load fpparams into registers ;************************************** mov ecx, dword ptr [fpc] ; get fpcount cmp ecx, 0h ; check fp count je loadcp ; if no fpparams, goto 'loadcp' - loadfps: dec cl ; ecx-- + loadfps: dec cl ; ecx-- mov edx, ecx ; get fpparams array offset shl edx, 03h ; * 8 bytes per fp param add edx, dword ptr [fpp] ; add base array addr @@ -89,26 +91,25 @@ CallMethodFromVTable__FPvUiPUiT1T2iT6T3 PROC OPTLINK EXPORT pStack, count, param ;************************************* ; Load cparams into registers ;************************************* - loadcp: cmp dword ptr [cpc], 0h ; check param count - je done ; if no params, goto 'done' and call function - - mov edx, dword ptr [cpp] ; load params - cmp dword ptr [cpc], 01h ; check param count - je loadone ; only one param to load, goto loadone - - mov ecx, [edx + 04h] ; load 2nd param if present - - loadone: mov edx, [edx] ; load 1st param if present + loadcp: cmp dword ptr [cpc], 0h ; check param count + je done ; if no params, goto 'done' and call function + + mov edx, dword ptr [cpp] ; load params + cmp dword ptr [cpc], 01h ; check param count + je loadone ; only one param to load, goto loadone + + mov ecx, [edx + 04h] ; load 2nd param if present + + loadone: mov edx, [edx] ; load 1st param if present ;*********************** ; Call Function ;*********************** - done: call dword ptr [ebx] ; call method - add esp, dword ptr [ibytes] ; deflate stack by ibytes - add esp, 04h ; plus 4 - ret ; method rc in eax + done: call dword ptr [ebx] ; call method + add esp, dword ptr [ibytes] ; deflate stack by ibytes + add esp, 04h ; plus 4 + ret ; method rc in eax -CallMethodFromVTable__FPvUiPUiT1T2iT6T3 ENDP - - END +CallMethodFromVTable__FPvUiPUiT1T2iT6T3 ENDP + END