26#include <typelib/typeclass.h>
27#include <typelib/typedescription.h>
49 void * pAdjustedThisPtr, sal_Int32 nVtableIndex,
void * pRegisterReturn,
51 sal_Int32 * pStackLongs, sal_Int32 nStackLongs)
56 assert(pStackLongs && pAdjustedThisPtr);
57 assert(
sizeof (
void *) == 4 &&
sizeof (sal_Int32) == 4);
59 assert(nStackLongs && pStackLongs);
70 "and $0xfffffff0, %%esp\n\t"
72 "lea -4(,%%eax,4), %%eax\n\t"
75 "add %%eax, %%esp\n\t"
78 "mov %%eax, %%edx\n\t"
89 "mov 0(%%edx), %%edx\n\t"
92 "add %%eax, %%edx\n\t"
93 "mov 0(%%edx), %%edx\n\t"
100 :
"=m"(eax),
"=m"(edx),
"=m"(stackptr)
101 :
"m"(nStackLongs),
"m"(pStackLongs),
"m"(pAdjustedThisPtr),
"m"(nVtableIndex)
102 :
"eax",
"ecx",
"edx" );
103 switch( pReturnTypeDescr->eTypeClass )
105 case typelib_TypeClass_VOID:
107 case typelib_TypeClass_HYPER:
108 case typelib_TypeClass_UNSIGNED_HYPER:
109 static_cast<long*
>(pRegisterReturn)[1] = edx;
111 case typelib_TypeClass_LONG:
112 case typelib_TypeClass_UNSIGNED_LONG:
113 case typelib_TypeClass_CHAR:
114 case typelib_TypeClass_ENUM:
115 static_cast<long*
>(pRegisterReturn)[0] = eax;
117 case typelib_TypeClass_SHORT:
118 case typelib_TypeClass_UNSIGNED_SHORT:
119 *
static_cast<unsigned short*
>(pRegisterReturn) = eax;
121 case typelib_TypeClass_BOOLEAN:
122 case typelib_TypeClass_BYTE:
123 *
static_cast<unsigned char*
>(pRegisterReturn) = eax;
125 case typelib_TypeClass_FLOAT:
126 asm (
"fstps %0" : :
"m"(*
static_cast<char *
>(pRegisterReturn)) );
128 case typelib_TypeClass_DOUBLE:
129 asm (
"fstpl %0\n\t" : :
"m"(*
static_cast<char *
>(pRegisterReturn)) );
133#if defined (FREEBSD) || defined(NETBSD) || defined(OPENBSD) || defined(MACOSX) || \
135 sal_Int32
const nRetSize = pReturnTypeDescr->nSize;
136 if (bSimpleReturn && nRetSize <= 8 && nRetSize > 0)
139 static_cast<long *
>(pRegisterReturn)[1] = edx;
140 static_cast<long *
>(pRegisterReturn)[0] = eax;
struct _typelib_TypeDescription typelib_TypeDescription
void dummy_can_throw_anything(char const *)
void callVirtualMethod(void *pAdjustedThisPtr, sal_Int32 nVtableIndex, void *pRegisterReturn, typelib_TypeDescription *pReturnTypeDescr, bool bSimpleReturn, sal_Int32 *pStackLongs, sal_Int32 nStackLongs)