1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
23 #include <rtl/alloc.h>
25 #include <com/sun/star/uno/genfunc.hxx>
26 #include "com/sun/star/uno/RuntimeException.hpp"
27 #include <sal/log.hxx>
29 #include <typelib/typedescription.hxx>
32 #include "cppinterfaceproxy.hxx"
34 #include "vtablefactory.hxx"
41 using namespace ::osl
;
42 using namespace ::com::sun::star::uno
;
47 static typelib_TypeClass
cpp2uno_call(
48 bridges::cpp_uno::shared::CppInterfaceProxy
* pThis
,
49 const typelib_TypeDescription
* pMemberTypeDescr
,
50 typelib_TypeDescriptionReference
* pReturnTypeRef
,
51 sal_Int32 nParams
, typelib_MethodParameter
* pParams
,
52 long r8
, void ** gpreg
, double *fpreg
, void ** ovrflw
,
53 sal_Int64
* pRegisterReturn
/* space for register return */ )
55 void ** startovrflw
= ovrflw
;
56 int nregs
= 0; //number of words passed in registers
58 #if OSL_DEBUG_LEVEL > 2
59 fprintf(stderr
, "cpp2uno_call\n");
62 typelib_TypeDescription
* pReturnTypeDescr
= 0;
64 TYPELIB_DANGER_GET( &pReturnTypeDescr
, pReturnTypeRef
);
66 void * pUnoReturn
= 0;
67 // complex return ptr: if != 0 && != pUnoReturn, reconversion need
68 void * pCppReturn
= 0;
72 if (hppa::isRegisterReturn(pReturnTypeRef
))
74 #if OSL_DEBUG_LEVEL > 2
75 fprintf(stderr
, "simple return\n");
77 pUnoReturn
= pRegisterReturn
; // direct way for simple types
81 #if OSL_DEBUG_LEVEL > 2
82 fprintf(stderr
, "complex return via r8\n");
84 pCppReturn
= (void *)r8
;
86 pUnoReturn
= (bridges::cpp_uno::shared::relatesToInterfaceType( pReturnTypeDescr
)
87 ? alloca( pReturnTypeDescr
->nSize
)
88 : pCppReturn
); // direct way
97 static_assert(sizeof(void *) == sizeof(sal_Int32
), "### unexpected size!");
99 void ** pUnoArgs
= (void **)alloca( 4 * sizeof(void *) * nParams
);
100 void ** pCppArgs
= pUnoArgs
+ nParams
;
101 // indices of values this have to be converted (interface conversion
103 sal_Int32
* pTempIndices
= (sal_Int32
*)(pUnoArgs
+ (2 * nParams
));
104 // type descriptions for reconversions
105 typelib_TypeDescription
** ppTempParamTypeDescr
=
106 (typelib_TypeDescription
**)(pUnoArgs
+ (3 * nParams
));
108 sal_Int32 nTempIndices
= 0;
109 bool bOverflowUsed
= false;
110 for ( sal_Int32 nPos
= 0; nPos
< nParams
; ++nPos
)
112 const typelib_MethodParameter
& rParam
= pParams
[nPos
];
113 typelib_TypeDescription
* pParamTypeDescr
= 0;
114 TYPELIB_DANGER_GET( &pParamTypeDescr
, rParam
.pTypeRef
);
116 if (!rParam
.bOut
&& bridges::cpp_uno::shared::isSimpleType( pParamTypeDescr
))
118 switch (pParamTypeDescr
->eTypeClass
)
120 case typelib_TypeClass_DOUBLE
:
121 if (nregs
< hppa::MAX_WORDS_IN_REGS
&& (nregs
& 1))
127 if (nregs
< hppa::MAX_WORDS_IN_REGS
-1)
130 pCppArgs
[nPos
] = pUnoArgs
[nPos
] = fpreg
;
137 if ((startovrflw
-ovrflw
) & 1)
139 pCppArgs
[nPos
] = pUnoArgs
[nPos
] = ((char*)ovrflw
- 4);
140 bOverflowUsed
= true;
142 if (bOverflowUsed
) ovrflw
-=2;
144 case typelib_TypeClass_FLOAT
:
145 if (nregs
< hppa::MAX_WORDS_IN_REGS
)
147 pCppArgs
[nPos
] = pUnoArgs
[nPos
] = fpreg
;
154 pCppArgs
[nPos
] = pUnoArgs
[nPos
] = ovrflw
;
155 bOverflowUsed
= true;
157 if (bOverflowUsed
) ovrflw
--;
159 case typelib_TypeClass_HYPER
:
160 case typelib_TypeClass_UNSIGNED_HYPER
:
161 if (nregs
< hppa::MAX_WORDS_IN_REGS
&& (nregs
& 1))
167 if (nregs
< hppa::MAX_WORDS_IN_REGS
-1)
169 pCppArgs
[nPos
] = pUnoArgs
[nPos
] = gpreg
;
176 if ((startovrflw
-ovrflw
) & 1)
178 pCppArgs
[nPos
] = pUnoArgs
[nPos
] = ((char*)ovrflw
- 4);
179 bOverflowUsed
= true;
181 if (bOverflowUsed
) ovrflw
-=2;
183 case typelib_TypeClass_BYTE
:
184 case typelib_TypeClass_BOOLEAN
:
185 if (nregs
< hppa::MAX_WORDS_IN_REGS
)
187 pCppArgs
[nPos
] = pUnoArgs
[nPos
] = ((char*)gpreg
+ 3);
194 pCppArgs
[nPos
] = pUnoArgs
[nPos
] = ((char*)ovrflw
+3);
195 bOverflowUsed
= true;
197 if (bOverflowUsed
) ovrflw
--;
199 case typelib_TypeClass_CHAR
:
200 case typelib_TypeClass_SHORT
:
201 case typelib_TypeClass_UNSIGNED_SHORT
:
202 if (nregs
< hppa::MAX_WORDS_IN_REGS
)
204 pCppArgs
[nPos
] = pUnoArgs
[nPos
] = ((char*)gpreg
+2);
211 pCppArgs
[nPos
] = pUnoArgs
[nPos
] = ((char*)ovrflw
+2);
212 bOverflowUsed
= true;
214 if (bOverflowUsed
) ovrflw
--;
216 case typelib_TypeClass_ENUM
:
217 case typelib_TypeClass_LONG
:
218 case typelib_TypeClass_UNSIGNED_LONG
:
220 if (nregs
< hppa::MAX_WORDS_IN_REGS
)
222 pCppArgs
[nPos
] = pUnoArgs
[nPos
] = gpreg
;
229 pCppArgs
[nPos
] = pUnoArgs
[nPos
] = ovrflw
;
230 bOverflowUsed
= true;
232 if (bOverflowUsed
) ovrflw
--;
236 TYPELIB_DANGER_RELEASE( pParamTypeDescr
);
238 else // ptr to complex value | ref
242 if (nregs
< hppa::MAX_WORDS_IN_REGS
)
244 pCppArgs
[nPos
] = pCppStack
= *gpreg
;
251 pCppArgs
[nPos
] = pCppStack
= *ovrflw
;
252 bOverflowUsed
= true;
254 if (bOverflowUsed
) ovrflw
--;
256 if (! rParam
.bIn
) // is pure out
258 // uno out is unconstructed mem!
259 pUnoArgs
[nPos
] = alloca( pParamTypeDescr
->nSize
);
260 pTempIndices
[nTempIndices
] = nPos
;
261 // will be released at reconversion
262 ppTempParamTypeDescr
[nTempIndices
++] = pParamTypeDescr
;
265 else if (bridges::cpp_uno::shared::relatesToInterfaceType(
268 uno_copyAndConvertData( pUnoArgs
[nPos
] = alloca( pParamTypeDescr
->nSize
),
269 pCppStack
, pParamTypeDescr
,
270 pThis
->getBridge()->getCpp2Uno() );
271 pTempIndices
[nTempIndices
] = nPos
; // has to be reconverted
272 // will be released at reconversion
273 ppTempParamTypeDescr
[nTempIndices
++] = pParamTypeDescr
;
277 pUnoArgs
[nPos
] = pCppStack
;
279 TYPELIB_DANGER_RELEASE( pParamTypeDescr
);
285 uno_Any aUnoExc
; // Any will be constructed by callee
286 uno_Any
* pUnoExc
= &aUnoExc
;
288 #if OSL_DEBUG_LEVEL > 2
289 fprintf(stderr
, "before dispatch\n");
291 // invoke uno dispatch call
292 (*pThis
->getUnoI()->pDispatcher
)(
293 pThis
->getUnoI(), pMemberTypeDescr
, pUnoReturn
, pUnoArgs
, &pUnoExc
);
295 #if OSL_DEBUG_LEVEL > 2
296 fprintf(stderr
, "after dispatch\n");
299 // in case an exception occurred...
302 // destruct temporary in/inout params
303 for ( ; nTempIndices
--; )
305 sal_Int32 nIndex
= pTempIndices
[nTempIndices
];
307 if (pParams
[nIndex
].bIn
) // is in/inout => was constructed
308 uno_destructData( pUnoArgs
[nIndex
],
309 ppTempParamTypeDescr
[nTempIndices
], 0 );
310 TYPELIB_DANGER_RELEASE( ppTempParamTypeDescr
[nTempIndices
] );
312 if (pReturnTypeDescr
)
313 TYPELIB_DANGER_RELEASE( pReturnTypeDescr
);
315 CPPU_CURRENT_NAMESPACE::raiseException( &aUnoExc
,
316 pThis
->getBridge()->getUno2Cpp() ); // has to destruct the any
318 return typelib_TypeClass_VOID
;
320 else // else no exception occurred...
323 for ( ; nTempIndices
--; )
325 sal_Int32 nIndex
= pTempIndices
[nTempIndices
];
326 typelib_TypeDescription
* pParamTypeDescr
=
327 ppTempParamTypeDescr
[nTempIndices
];
329 if (pParams
[nIndex
].bOut
) // inout/out
331 // convert and assign
332 uno_destructData( pCppArgs
[nIndex
], pParamTypeDescr
,
334 uno_copyAndConvertData( pCppArgs
[nIndex
], pUnoArgs
[nIndex
],
335 pParamTypeDescr
, pThis
->getBridge()->getUno2Cpp() );
337 // destroy temp uno param
338 uno_destructData( pUnoArgs
[nIndex
], pParamTypeDescr
, 0 );
340 TYPELIB_DANGER_RELEASE( pParamTypeDescr
);
343 if (pCppReturn
) // has complex return
345 if (pUnoReturn
!= pCppReturn
) // needs reconversion
347 uno_copyAndConvertData( pCppReturn
, pUnoReturn
,
348 pReturnTypeDescr
, pThis
->getBridge()->getUno2Cpp() );
349 // destroy temp uno return
350 uno_destructData( pUnoReturn
, pReturnTypeDescr
, 0 );
352 // complex return ptr is set to eax
353 *(void **)pRegisterReturn
= pCppReturn
;
355 if (pReturnTypeDescr
)
357 typelib_TypeClass eRet
=
358 (typelib_TypeClass
)pReturnTypeDescr
->eTypeClass
;
359 TYPELIB_DANGER_RELEASE( pReturnTypeDescr
);
363 return typelib_TypeClass_VOID
;
368 static typelib_TypeClass
cpp_mediate(
369 sal_Int32 nFunctionIndex
, sal_Int32 nVtableOffset
,
370 void ** gpreg
, double* fpreg
,
372 sal_Int64
* pRegisterReturn
/* space for register return */ )
375 void ** ovrflw
= (void**)(sp
);
376 #if OSL_DEBUG_LEVEL > 2
377 fprintf(stderr
, "cpp_mediate with\n");
378 fprintf(stderr
, "%x %x\n", nFunctionIndex
, nVtableOffset
);
379 fprintf(stderr
, "and %x %x\n", (long)(ovrflw
[0]), (long)(ovrflw
[-1]));
380 fprintf(stderr
, "and %x %x\n", (long)(ovrflw
[-2]), (long)(ovrflw
[-3]));
381 fprintf(stderr
, "and %x %x\n", (long)(ovrflw
[-4]), (long)(ovrflw
[-5]));
382 fprintf(stderr
, "and %x %x\n", (long)(ovrflw
[-6]), (long)(ovrflw
[-7]));
383 fprintf(stderr
, "and %x %x\n", (long)(ovrflw
[-8]), (long)(ovrflw
[-9]));
384 fprintf(stderr
, "and %x %x\n", (long)(ovrflw
[-10]), (long)(ovrflw
[-11]));
385 fprintf(stderr
, "and %x %x\n", (long)(ovrflw
[-12]), (long)(ovrflw
[-13]));
386 fprintf(stderr
, "and %x %x\n", (long)(ovrflw
[-14]), (long)(ovrflw
[-15]));
388 static_assert(sizeof(sal_Int32
)==sizeof(void *), "### unexpected!");
390 // gpreg: [ret *], this, [other gpr params]
391 // fpreg: [fpr params]
392 // ovrflw: [gpr or fpr params (properly aligned)]
395 if (nFunctionIndex
& 0x80000000 )
397 nFunctionIndex
&= 0x7fffffff;
399 #if OSL_DEBUG_LEVEL > 2
400 fprintf(stderr
, "pThis is gpreg[1]\n");
406 #if OSL_DEBUG_LEVEL > 2
407 fprintf(stderr
, "pThis is gpreg[0]\n");
411 pThis
= static_cast< char * >(pThis
) - nVtableOffset
;
413 bridges::cpp_uno::shared::CppInterfaceProxy
* pCppI
=
414 bridges::cpp_uno::shared::CppInterfaceProxy::castInterfaceToProxy(
417 typelib_InterfaceTypeDescription
* pTypeDescr
= pCppI
->getTypeDescr();
419 if (nFunctionIndex
>= pTypeDescr
->nMapFunctionIndexToMemberIndex
)
423 "illegal " << OUString::unacquired(&pTypeDescr
->aBase
.pTypeName
)
424 << " vtable index " << nFunctionIndex
<< "/"
425 << pTypeDescr
->nMapFunctionIndexToMemberIndex
);
426 throw RuntimeException(
427 ("illegal " + OUString::unacquired(&pTypeDescr
->aBase
.pTypeName
)
428 + " vtable index " + OUString::number(nFunctionIndex
) + "/"
429 + OUString::number(pTypeDescr
->nMapFunctionIndexToMemberIndex
)),
430 (XInterface
*)pCppI
);
433 // determine called method
434 assert(nFunctionIndex
< pTypeDescr
->nMapFunctionIndexToMemberIndex
);
435 sal_Int32 nMemberPos
=
436 pTypeDescr
->pMapFunctionIndexToMemberIndex
[nFunctionIndex
];
437 assert(nMemberPos
< pTypeDescr
->nAllMembers
);
439 TypeDescription
aMemberDescr( pTypeDescr
->ppAllMembers
[nMemberPos
] );
441 typelib_TypeClass eRet
;
442 switch (aMemberDescr
.get()->eTypeClass
)
444 case typelib_TypeClass_INTERFACE_ATTRIBUTE
:
446 if (pTypeDescr
->pMapMemberIndexToFunctionIndex
[nMemberPos
] ==
451 pCppI
, aMemberDescr
.get(),
452 ((typelib_InterfaceAttributeTypeDescription
*)aMemberDescr
.get())->pAttributeTypeRef
,
454 r8
, gpreg
, fpreg
, ovrflw
, pRegisterReturn
);
459 typelib_MethodParameter aParam
;
461 ((typelib_InterfaceAttributeTypeDescription
*)aMemberDescr
.get())->pAttributeTypeRef
;
462 aParam
.bIn
= sal_True
;
463 aParam
.bOut
= sal_False
;
466 pCppI
, aMemberDescr
.get(),
467 0, // indicates void return
469 r8
, gpreg
, fpreg
, ovrflw
, pRegisterReturn
);
473 case typelib_TypeClass_INTERFACE_METHOD
:
476 switch (nFunctionIndex
)
479 pCppI
->acquireProxy(); // non virtual call!
480 eRet
= typelib_TypeClass_VOID
;
483 pCppI
->releaseProxy(); // non virtual call!
484 eRet
= typelib_TypeClass_VOID
;
486 case 0: // queryInterface() opt
488 typelib_TypeDescription
* pTD
= 0;
489 TYPELIB_DANGER_GET(&pTD
,
490 reinterpret_cast<Type
*>(gpreg
[1])->getTypeLibType());
493 XInterface
* pInterface
= 0;
494 (*pCppI
->getBridge()->getCppEnv()->getRegisteredInterface
)(
495 pCppI
->getBridge()->getCppEnv(),
496 (void **)&pInterface
, pCppI
->getOid().pData
,
497 (typelib_InterfaceTypeDescription
*)pTD
);
502 reinterpret_cast< uno_Any
* >( r8
),
503 &pInterface
, pTD
, cpp_acquire
);
504 pInterface
->release();
505 TYPELIB_DANGER_RELEASE( pTD
);
506 *(void **)pRegisterReturn
= (void*)r8
;
507 eRet
= typelib_TypeClass_ANY
;
510 TYPELIB_DANGER_RELEASE( pTD
);
512 } // else perform queryInterface()
515 pCppI
, aMemberDescr
.get(),
516 ((typelib_InterfaceMethodTypeDescription
*)aMemberDescr
.get())->pReturnTypeRef
,
517 ((typelib_InterfaceMethodTypeDescription
*)aMemberDescr
.get())->nParams
,
518 ((typelib_InterfaceMethodTypeDescription
*)aMemberDescr
.get())->pParams
,
519 r8
, gpreg
, fpreg
, ovrflw
, pRegisterReturn
);
525 throw RuntimeException( "no member description found!", (XInterface
*)pCppI
);
534 * is called on incoming vtable calls
535 * (called by asm snippets)
538 sal_Int64
cpp_vtable_call( sal_uInt32 in0
, sal_uInt32 in1
, sal_uInt32 in2
, sal_uInt32 in3
, sal_uInt32 firstonstack
)
540 register sal_Int32 r21
asm("r21");
541 register sal_Int32 r22
asm("r22");
542 register sal_Int32 r28
asm("r28");
543 sal_Int32 functionIndex
= r21
;
544 sal_Int32 vtableOffset
= r22
;
547 long sp
= (long)&firstonstack
;
549 sal_uInt32 gpreg
[hppa::MAX_GPR_REGS
];
555 float fpreg
[hppa::MAX_SSE_REGS
]; //todo
556 register float f0
asm("fr4"); fpreg
[0] = f0
;
557 register float f1
asm("fr5"); fpreg
[1] = f1
;
558 register float f2
asm("fr6"); fpreg
[2] = f2
;
559 register float f3
asm("fr7"); fpreg
[3] = f3
;
561 double dpreg
[hppa::MAX_SSE_REGS
]; //todo
562 register double d0
asm("fr4"); dpreg
[0] = d0
;
563 register double d1
asm("fr5"); dpreg
[1] = d1
;
564 register double d2
asm("fr6"); dpreg
[2] = d2
;
565 register double d3
asm("fr7"); dpreg
[3] = d3
;
568 #if OSL_DEBUG_LEVEL > 2
569 fprintf(stderr
, "got to cpp_vtable_call with %x %x\n", functionIndex
, vtableOffset
);
570 for (int i
= 0; i
< hppa::MAX_GPR_REGS
; ++i
)
571 fprintf(stderr
, "reg %d is %d %x\n", i
, gpreg
[i
], gpreg
[i
]);
572 for (int i
= 0; i
< hppa::MAX_SSE_REGS
; ++i
)
573 fprintf(stderr
, "float reg %d is %f %x\n", i
, fpreg
[i
], ((long*)fpreg
)[i
]);
574 for (int i
= 0; i
< 4; ++i
)
575 fprintf(stderr
, "double reg %d is %f %llx\n", i
, dpreg
[i
], ((long long*)dpreg
)[i
]);
578 sal_Int64 nRegReturn
;
580 typelib_TypeClass aType
=
581 cpp_mediate( functionIndex
, vtableOffset
, (void**)gpreg
, dpreg
, sp
, r8
, &nRegReturn
);
585 case typelib_TypeClass_FLOAT
:
586 f0
= (*((float*)&nRegReturn
));
588 case typelib_TypeClass_DOUBLE
:
589 d0
= (*((double*)&nRegReturn
));
601 const int codeSnippetSize
= 44;
603 # define unldil(v) (((v & 0x7c) << 14) | ((v & 0x180) << 7) | ((v & 0x3) << 12) | ((v & 0xffe00) >> 8) | ((v & 0x100000) >> 20))
604 # define L21(v) unldil(((unsigned long)(v) >> 11) & 0x1fffff) //Left 21 bits
605 # define R11(v) (((unsigned long)(v) & 0x7FF) << 1) //Right 11 bits
607 unsigned char *codeSnippet(unsigned char* code
, sal_Int32 functionIndex
,
608 sal_Int32 vtableOffset
, bool bHasHiddenParam
)
611 functionIndex
|= 0x80000000;
613 unsigned char * p
= code
;
614 *(unsigned long*)&p
[0] = 0xeaa00000; // b,l 0x8,r21
615 *(unsigned long*)&p
[4] = 0xd6a01c1e; // depwi 0,31,2,r21
616 *(unsigned long*)&p
[8] = 0x4aa10040; // ldw 32(r21),r1
618 *(unsigned long*)&p
[12] = 0x22A00000 | L21(functionIndex
); // ldil L<functionIndex>,r21
619 *(unsigned long*)&p
[16] = 0x36B50000 | R11(functionIndex
); // ldo R<functionIndex>,r21
621 *(unsigned long*)&p
[20] = 0x22C00000 | L21(vtableOffset
); // ldil L<vtableOffset>,r22
622 *(unsigned long*)&p
[24] = 0x36D60000 | R11(vtableOffset
); // ldo R<vtableOffset>,r22
624 *(unsigned long*)&p
[28] = 0x0c201094; // ldw 0(r1),r20
625 *(unsigned long*)&p
[32] = 0xea80c000; // bv r0(r20)
626 *(unsigned long*)&p
[36] = 0x0c281093; // ldw 4(r1),r19
627 *(unsigned long*)&p
[40] = ((unsigned long)(cpp_vtable_call
) & ~2);
629 return code
+ codeSnippetSize
;
633 struct bridges::cpp_uno::shared::VtableFactory::Slot
{ void const * fn
; };
635 bridges::cpp_uno::shared::VtableFactory::Slot
*
636 bridges::cpp_uno::shared::VtableFactory::mapBlockToVtable(void * block
)
638 return static_cast< Slot
* >(block
) + 2;
641 std::size_t bridges::cpp_uno::shared::VtableFactory::getBlockSize(
644 return (slotCount
+ 2) * sizeof (Slot
) + slotCount
* codeSnippetSize
;
648 // Some dummy type whose RTTI is used in the synthesized proxy vtables to make uses of dynamic_cast
649 // on such proxy objects not crash:
653 bridges::cpp_uno::shared::VtableFactory::Slot
*
654 bridges::cpp_uno::shared::VtableFactory::initializeBlock(
655 void * block
, sal_Int32 slotCount
, sal_Int32
,
656 typelib_InterfaceTypeDescription
*)
658 Slot
* slots
= mapBlockToVtable(block
);
660 slots
[-1].fn
= &typeid(ProxyRtti
);
661 return slots
+ slotCount
;
664 unsigned char * bridges::cpp_uno::shared::VtableFactory::addLocalFunctions(
665 Slot
** slots
, unsigned char * code
, sal_PtrDiff writetoexecdiff
,
666 typelib_InterfaceTypeDescription
const * type
, sal_Int32 functionOffset
,
667 sal_Int32 functionCount
, sal_Int32 vtableOffset
)
669 (*slots
) -= functionCount
;
671 for (sal_Int32 i
= 0; i
< type
->nMembers
; ++i
)
673 typelib_TypeDescription
* member
= 0;
674 TYPELIB_DANGER_GET(&member
, type
->ppMembers
[i
]);
676 switch (member
->eTypeClass
)
678 case typelib_TypeClass_INTERFACE_ATTRIBUTE
:
680 (s
++)->fn
= code
+ writetoexecdiff
;
681 code
= codeSnippet(code
, functionOffset
++, vtableOffset
, false);
683 if (!reinterpret_cast<
684 typelib_InterfaceAttributeTypeDescription
* >(
687 (s
++)->fn
= code
+ writetoexecdiff
;
688 code
= codeSnippet(code
, functionOffset
++, vtableOffset
, false);
691 case typelib_TypeClass_INTERFACE_METHOD
:
693 (s
++)->fn
= code
+ writetoexecdiff
;
694 code
= codeSnippet(code
, functionOffset
++, vtableOffset
, false);
701 TYPELIB_DANGER_RELEASE(member
);
706 void bridges::cpp_uno::shared::VtableFactory::flushCode(
707 unsigned char const *beg
, unsigned char const *end
)
709 void *p
= (void*)((size_t)beg
& ~31);
713 asm volatile("fdc (%0)\n\t"
715 "fic,m %1(%%sr4, %0)\n\t"
716 "sync" : "+r"(p
) : "r"(stride
) : "memory");
720 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */