27#include <com/sun/star/uno/genfunc.hxx>
30#include <typelib/typedescription.hxx>
64 cmp eax, typelib_TypeClass_FLOAT
66 cmp eax, typelib_TypeClass_DOUBLE
68 cmp eax, typelib_TypeClass_HYPER
70 cmp eax, typelib_TypeClass_UNSIGNED_HYPER
94 unsigned char * code, sal_Int32 functionIndex, sal_Int32 vtableOffset)
96 unsigned char *
p =
code;
97 static_assert(
sizeof (sal_Int32) == 4,
"boo");
100 *
reinterpret_cast< sal_Int32 *
>(
p) = functionIndex;
101 p +=
sizeof (sal_Int32);
104 *
reinterpret_cast< sal_Int32 *
>(
p) = vtableOffset;
105 p +=
sizeof (sal_Int32);
108 *
reinterpret_cast< sal_Int32 *
>(
p)
110 p +=
sizeof (sal_Int32);
122 return static_cast< Slot *
>(block) + 1;
141struct RttiClassHierarchyDescriptor;
143#pragma warning (push)
144#pragma warning (disable: 4324)
146struct alignas(16) RttiBaseClassDescriptor {
147 sal_uInt32
n0 =
reinterpret_cast<sal_uInt32
>(&
typeid(ProxyRtti));
150 sal_uInt32
n3 = 0xFFFFFFFF;
152 sal_uInt32
n5 = 0x40;
154 RttiBaseClassDescriptor(RttiClassHierarchyDescriptor
const *
chd):
155 n6(reinterpret_cast<sal_uInt32>(
chd)) {}
158struct alignas(4) RttiBaseClassArray {
161 RttiBaseClassArray(RttiBaseClassDescriptor
const *
bcd):
n0(reinterpret_cast<sal_uInt32>(
bcd))
165struct alignas(4) RttiClassHierarchyDescriptor {
170 RttiClassHierarchyDescriptor(RttiBaseClassArray
const *
bca):
171 n3(reinterpret_cast<sal_uInt32>(
bca)) {}
174struct alignas(16) RttiCompleteObjectLocator {
178 sal_uInt32
n3 =
reinterpret_cast<sal_uInt32
>(&
typeid(ProxyRtti));
180 RttiCompleteObjectLocator(RttiClassHierarchyDescriptor
const *
chd):
181 n4(reinterpret_cast<sal_uInt32>(
chd)) {}
185 RttiBaseClassDescriptor
bcd;
186 RttiBaseClassArray
bca;
187 RttiClassHierarchyDescriptor
chd;
188 RttiCompleteObjectLocator
col;
198 void * block, sal_Int32 slotCount, sal_Int32,
199 typelib_InterfaceTypeDescription *)
203 Slot * slots = mapBlockToVtable(block);
204 slots[-1].fn = &rtti.col;
205 return slots + slotCount;
209 Slot ** slots,
unsigned char * code,
210 typelib_InterfaceTypeDescription
const *, sal_Int32 functionOffset,
211 sal_Int32 functionCount, sal_Int32 vtableOffset)
213 (*slots) -= functionCount;
215 for (sal_Int32 i = 0;
i < functionCount; ++
i) {
223 unsigned char const *,
224 unsigned char const *)
static Slot * mapBlockToVtable(void *block)
Given a pointer to a block, turn it into a vtable pointer.
static void flushCode(unsigned char const *begin, unsigned char const *end)
Flush all the generated code snippets of a vtable, on platforms that require it.
static unsigned char * addLocalFunctions(Slot **slots, unsigned char *code, sal_PtrDiff writetoexecdiff, typelib_InterfaceTypeDescription const *type, sal_Int32 functionOffset, sal_Int32 functionCount, sal_Int32 vtableOffset)
Fill the vtable slots corresponding to all local (i.e., not inherited) functions of a given interface...
static Slot * initializeBlock(void *block, sal_Int32 slotCount, sal_Int32 vtableNumber, typelib_InterfaceTypeDescription *type)
Initialize a raw vtable block.
static std::size_t getBlockSize(sal_Int32 slotCount)
Calculate the size of a raw vtable block.
void cpp_vtable_call(sal_Int32 func, sal_Int32 offset, void **pStack)
is called on incoming vtable calls (called by asm snippets)
const int codeSnippetSize
static unsigned char * codeSnippet(unsigned char *code, sal_Int32 nFunctionIndex, sal_Int32 nVtableOffset, bool bHasHiddenParam)
typelib_TypeClass __cdecl cpp_mediate(void **pCallStack, const sal_Int32 nFunctionIndex, const sal_Int32 nVtableOffset, sal_Int64 *const pRegisterReturn)
RttiClassHierarchyDescriptor chd
RttiCompleteObjectLocator col
RttiBaseClassDescriptor bcd
static __declspec(naked) void copyConstruct()