No bug
r=mkaply, pedemonte, sr=blizzard, a=asa for drivers AWESOME xptcstubs rewrite from Jeff Jones. Incredibly elegant. Allows us to fully optimize our build. git-svn-id: svn://10.0.0.236/trunk@97468 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -208,8 +208,7 @@ XPTC_InvokeByIndex(nsISupports *that, PRUint32 index,
|
||||
int result = NS_OK;
|
||||
|
||||
// Find size in bytes necessary for call and load param structs
|
||||
// Always allocate at least space for one additional parameter on the stack
|
||||
ibytes = 4 * (invoke_count_words(paramcount, params)+1);
|
||||
ibytes = 4 * invoke_count_words(paramcount, params);
|
||||
|
||||
// XXXX DO REST FROM xptcall_vacpp.asm
|
||||
// pStack = get_stack() + ibytes;
|
||||
|
||||
@@ -53,6 +53,7 @@ COMMENT | -*- Mode: asm; tab-width: 8; c-basic-offset: 4 -*-
|
||||
CallMethodFromVTable__FPvUiPUiT1T2iT6T3 PROC OPTLINK EXPORT pStack, count, params,
|
||||
that, index, ibytes, cpc, cpp, fpc, fpp
|
||||
|
||||
push ebx
|
||||
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
|
||||
@@ -108,6 +109,7 @@ CallMethodFromVTable__FPvUiPUiT1T2iT6T3 PROC OPTLINK EXPORT pStack, count, pa
|
||||
done: call dword ptr [ebx] ; call method
|
||||
add esp, dword ptr [ibytes] ; deflate stack by ibytes
|
||||
add esp, 04h ; plus 4
|
||||
pop ebx;
|
||||
ret ; method rc in eax
|
||||
|
||||
CallMethodFromVTable__FPvUiPUiT1T2iT6T3 ENDP
|
||||
|
||||
@@ -35,11 +35,13 @@ extern nsresult SetEntryFromIndex(int stubidx);
|
||||
|
||||
#ifdef XP_OS2_VACPP
|
||||
nsresult
|
||||
#else
|
||||
static nsresult
|
||||
#endif
|
||||
PrepareAndDispatch( nsXPTCStubBase *self, PRUint32 methodIndex,
|
||||
PRUint32 *args)
|
||||
#else
|
||||
static nsresult
|
||||
PrepareAndDispatch( nsXPTCStubBase *self, PRUint32 methodIndex,
|
||||
PRUint32 *args)
|
||||
#endif
|
||||
{
|
||||
#define PARAM_BUFFER_COUNT 16
|
||||
|
||||
@@ -64,6 +66,20 @@ PrepareAndDispatch( nsXPTCStubBase *self, PRUint32 methodIndex,
|
||||
|
||||
paramCount = info->GetParamCount();
|
||||
|
||||
/* If paramCount is > 0, write out the EDX pointer to the
|
||||
space on the stack args[0]. args[-4] is the space on
|
||||
the stack where it was pushed */
|
||||
if (paramCount) {
|
||||
args[0] = args[-4];
|
||||
}
|
||||
|
||||
/* If paramCount is > 1, write out the ECX pointer to the
|
||||
space on the stack args[1]. args[-3] is the space on
|
||||
the stack where it was pushed */
|
||||
if (paramCount > 1) {
|
||||
args[1] = args[-3];
|
||||
}
|
||||
|
||||
// setup variant array pointer
|
||||
if(paramCount > PARAM_BUFFER_COUNT)
|
||||
dispatchParams = new nsXPTCMiniVariant[paramCount];
|
||||
@@ -115,15 +131,9 @@ PrepareAndDispatch( nsXPTCStubBase *self, PRUint32 methodIndex,
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
#ifdef XP_OS2_VACPP
|
||||
|
||||
#define STUB_ENTRY(n) \
|
||||
nsresult nsXPTCStubBase::Stub##n() \
|
||||
{ \
|
||||
nsresult result = SetEntryFromIndex(n); \
|
||||
return result; \
|
||||
}
|
||||
#define STUB_ENTRY(n)
|
||||
|
||||
#else
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user