LibreOffice Module bridges (master) 1
gcc3_linux_mips64/uno2cpp.cxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
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/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
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 .
18 */
19
20#include <sal/config.h>
21
22#include <exception>
23#include <malloc.h>
24#include <cstring>
25#include <typeinfo>
26
27#include <com/sun/star/uno/Exception.hpp>
28#include <com/sun/star/uno/RuntimeException.hpp>
29#include <com/sun/star/uno/genfunc.hxx>
31#include <uno/data.h>
32
33#include "bridge.hxx"
34#include "types.hxx"
35#include "unointerfaceproxy.hxx"
36#include "vtables.hxx"
37
38#include "share.hxx"
39
40//#define BRDEBUG
41#ifdef BRDEBUG
42#include <stdio.h>
43#endif
44
45#define INSERT_FLOAT_DOUBLE( pSV, nr, pFPR, pDS ) \
46 if ( nr < MAX_FP_REGS ) \
47 pFPR[nr++] = *reinterpret_cast<double *>( pSV ); \
48 else \
49 *pDS++ = *reinterpret_cast<sal_uInt64 *>( pSV ); // verbatim!
50
51#define INSERT_INT64( pSV, nr, pGPR, pDS ) \
52 if ( nr < MAX_GP_REGS ) \
53 pGPR[nr++] = *reinterpret_cast<sal_Int64 *>( pSV ); \
54 else \
55 *pDS++ = *reinterpret_cast<sal_Int64 *>( pSV );
56
57#define INSERT_INT32( pSV, nr, pGPR, pDS ) \
58 if ( nr < MAX_GP_REGS ) \
59 pGPR[nr++] = *reinterpret_cast<sal_Int32 *>( pSV ); \
60 else \
61 *pDS++ = *reinterpret_cast<sal_Int32 *>( pSV );
62
63#define INSERT_INT16( pSV, nr, pGPR, pDS ) \
64 if ( nr < MAX_GP_REGS ) \
65 pGPR[nr++] = *reinterpret_cast<sal_Int16 *>( pSV ); \
66 else \
67 *pDS++ = *reinterpret_cast<sal_Int16 *>( pSV );
68
69#define INSERT_UINT16( pSV, nr, pGPR, pDS ) \
70 if ( nr < MAX_GP_REGS ) \
71 pGPR[nr++] = *reinterpret_cast<sal_uInt16 *>( pSV ); \
72 else \
73 *pDS++ = *reinterpret_cast<sal_uInt16 *>( pSV );
74
75#define INSERT_INT8( pSV, nr, pGPR, pDS ) \
76 if ( nr < MAX_GP_REGS ) \
77 pGPR[nr++] = *reinterpret_cast<sal_Int8 *>( pSV ); \
78 else \
79 *pDS++ = *reinterpret_cast<sal_Int8 *>( pSV );
80
81using namespace ::com::sun::star::uno;
82
83namespace
84{
85
86 bool isReturnInFPR(const typelib_TypeDescription * pTypeDescr, sal_uInt32 & nSize)
87 {
88 const typelib_CompoundTypeDescription *p =
89 reinterpret_cast<const typelib_CompoundTypeDescription*>( pTypeDescr );
90
91 for (sal_Int32 i = 0; i < p->nMembers; ++i)
92 {
93 typelib_TypeDescriptionReference *pTypeInStruct = p->ppTypeRefs[ i ];
94
95 switch (pTypeInStruct->eTypeClass)
96 {
97 case typelib_TypeClass_STRUCT:
98 case typelib_TypeClass_EXCEPTION:
99 {
101 TYPELIB_DANGER_GET(&t, pTypeInStruct);
102 bool isFPR = isReturnInFPR(t, nSize);
103 TYPELIB_DANGER_RELEASE(t);
104 if (!isFPR)
105 return false;
106 }
107 break;
108 case typelib_TypeClass_FLOAT:
109 case typelib_TypeClass_DOUBLE:
110 if (nSize >= 16)
111 return false;
112 nSize += 8;
113 break;
114 default:
115 return false;
116 }
117 }
118 return true;
119 }
120
121 void fillReturn(const typelib_TypeDescription * pTypeDescr,
122 sal_Int64 * gret, double * fret, void * pRegisterReturn)
123 {
124 sal_uInt32 nSize = 0;
125 if (isReturnInFPR(pTypeDescr, nSize))
126 {
127 reinterpret_cast<double *>( pRegisterReturn )[0] = fret[0];
128 reinterpret_cast<double *>( pRegisterReturn )[1] = fret[1];
129 }
130 else
131 {
132 reinterpret_cast<sal_Int64 *>( pRegisterReturn )[0] = gret[0];
133 reinterpret_cast<sal_Int64 *>( pRegisterReturn )[1] = gret[1];
134 }
135 }
136
137 static void callVirtualMethod(
138 void * pAdjustedThisPtr,
139 sal_Int32 nVtableIndex,
140 void * pRegisterReturn,
141 typelib_TypeDescriptionReference * pReturnTypeRef,
142 bool bSimpleReturn,
143 sal_uInt64 *pStack,
144 sal_uInt32 nStack,
145 sal_uInt64 *pGPR,
146 double *pFPR,
147 sal_uInt32 nREG)
148 {
149 // Should not happen, but...
150 static_assert(MAX_GP_REGS == MAX_FP_REGS, "must be the same size");
151 if ( nREG > MAX_GP_REGS )
152 nREG = MAX_GP_REGS;
153
154 // Get pointer to method
155 sal_uInt64 pMethod = *((sal_uInt64 *)pAdjustedThisPtr);
156 pMethod += 8 * nVtableIndex;
157 void *mfunc = (void *) *((sal_uInt64 *)pMethod);
158#ifdef BRDEBUG
159 fprintf(stderr, "calling function %p\n", mfunc);
160#endif
161
162 // Load parameters to stack, if necessary
163 sal_uInt64* pCallStack = NULL;
164 if ( nStack )
165 {
166 // 16-bytes aligned
167 sal_uInt32 nStackBytes = ( ( nStack + 1 ) >> 1 ) * 16;
168 pCallStack = (sal_uInt64 *) __builtin_alloca( nStackBytes );
169 std::memcpy( pCallStack, pStack, nStackBytes );
170 }
171
172 sal_Int64 gret[2];
173 double fret[2];
174 asm volatile (
175 ".set push \n\t"
176 ".set mips64 \n\t"
177 // Fill the general purpose registers
178 "ld $4, 0(%[gpr]) \n\t"
179 "ld $5, 8(%[gpr]) \n\t"
180 "ld $6, 16(%[gpr]) \n\t"
181 "ld $7, 24(%[gpr]) \n\t"
182 "ld $8, 32(%[gpr]) \n\t"
183 "ld $9, 40(%[gpr]) \n\t"
184 "ld $10, 48(%[gpr]) \n\t"
185 "ld $11, 56(%[gpr]) \n\t"
186 // Fill the floating pointer registers
187 "ldc1 $f12, 0(%[fpr]) \n\t"
188 "ldc1 $f13, 8(%[fpr]) \n\t"
189 "ldc1 $f14, 16(%[fpr]) \n\t"
190 "ldc1 $f15, 24(%[fpr]) \n\t"
191 "ldc1 $f16, 32(%[fpr]) \n\t"
192 "ldc1 $f17, 40(%[fpr]) \n\t"
193 "ldc1 $f18, 48(%[fpr]) \n\t"
194 "ldc1 $f19, 56(%[fpr]) \n\t"
195 // Perform the call
196 "jalr %[mfunc] \n\t"
197 // Fill the return values
198 "move %[gret1], $2 \n\t"
199 "move %[gret2], $3 \n\t"
200 "mov.d %[fret1], $f0 \n\t"
201 "mov.d %[fret2], $f2 \n\t"
202 ".set pop \n\t"
203 :[gret1]"=r"(gret[0]), [gret2]"=r"(gret[1]),
204 [fret1]"=f"(fret[0]), [fret2]"=f"(fret[1])
205 :[gpr]"r"(pGPR), [fpr]"r"(pFPR), [mfunc]"c"(mfunc),
206 [stack]"m"(pCallStack) // dummy input to prevent the compiler from optimizing the alloca out
207 :"$2", "$3", "$4", "$5", "$6", "$7", "$8",
208 "$9", "$10", "$11", "$31",
209 "$f0", "$f2", "$f12", "$f13", "$f14", "$f15",
210 "$f16", "$f17", "$f18", "$f19", "memory"
211 );
212
213 switch (pReturnTypeRef->eTypeClass)
214 {
215 case typelib_TypeClass_HYPER:
216 case typelib_TypeClass_UNSIGNED_HYPER:
217 case typelib_TypeClass_LONG:
218 case typelib_TypeClass_UNSIGNED_LONG:
219 case typelib_TypeClass_ENUM:
220 case typelib_TypeClass_CHAR:
221 case typelib_TypeClass_SHORT:
222 case typelib_TypeClass_UNSIGNED_SHORT:
223 case typelib_TypeClass_BOOLEAN:
224 case typelib_TypeClass_BYTE:
225 *reinterpret_cast<sal_Int64 *>( pRegisterReturn ) = gret[0];
226 break;
227 case typelib_TypeClass_FLOAT:
228 case typelib_TypeClass_DOUBLE:
229 *reinterpret_cast<double *>( pRegisterReturn ) = fret[0];
230 break;
231 case typelib_TypeClass_STRUCT:
232 case typelib_TypeClass_EXCEPTION:
233 {
234 sal_Int32 const nRetSize = pReturnTypeRef->pType->nSize;
235 if (bSimpleReturn && nRetSize <= 16 && nRetSize > 0)
236 {
237 typelib_TypeDescription * pTypeDescr = 0;
238 TYPELIB_DANGER_GET( &pTypeDescr, pReturnTypeRef );
239 fillReturn(pTypeDescr, gret, fret, pRegisterReturn);
240 TYPELIB_DANGER_RELEASE( pTypeDescr );
241 }
242 break;
243 }
244 default:
245#ifdef BRDEBUG
246 fprintf(stderr,"unhandled return type %u\n", pReturnTypeRef->eTypeClass);
247#endif
248 break;
249 }
250 }
251
252
253 static void cpp_call(
256 typelib_TypeDescriptionReference * pReturnTypeRef,
257 sal_Int32 nParams, typelib_MethodParameter * pParams,
258 void * pUnoReturn, void * pUnoArgs[], uno_Any ** ppUnoExc )
259 {
260 // max space for: [complex ret ptr], values|ptr ...
261 sal_uInt64 *pStack = (sal_uInt64 *)__builtin_alloca( ((nParams+3) * sizeof(sal_Int64)) );
262 sal_uInt64 *pStackStart = pStack;
263
264 sal_uInt64 pGPR[MAX_GP_REGS];
265 double pFPR[MAX_FP_REGS];
266 sal_uInt32 nREG = 0;
267
268#ifdef BRDEBUG
269 fprintf(stderr, "in cpp_call\n");
270#endif
271
272 // return
273 typelib_TypeDescription * pReturnTypeDescr = 0;
274 TYPELIB_DANGER_GET( &pReturnTypeDescr, pReturnTypeRef );
275 assert(pReturnTypeDescr);
276
277 void * pCppReturn = 0; // if != 0 && != pUnoReturn, needs reconversion
278
279 bool bSimpleReturn = true;
280 if (pReturnTypeDescr)
281 {
283 {
284 bSimpleReturn = false;
285 // complex return via ptr
286 pCppReturn = bridges::cpp_uno::shared::relatesToInterfaceType( pReturnTypeDescr )?
287 __builtin_alloca( pReturnTypeDescr->nSize ) : pUnoReturn;
288 INSERT_INT64( &pCppReturn, nREG, pGPR, pStack );
289 }
290 else
291 {
292 pCppReturn = pUnoReturn; // direct way for simple types
293 }
294 }
295
296 // push this
297 void* pAdjustedThisPtr = reinterpret_cast< void **>( pThis->getCppI() ) + aVtableSlot.offset;
298 INSERT_INT64( &pAdjustedThisPtr, nREG, pGPR, pStack );
299
300 // args
301 void ** pCppArgs = (void **)alloca( 3 * sizeof(void *) * nParams );
302 // indices of values this have to be converted (interface conversion cpp<=>uno)
303 sal_Int32 * pTempIndices = (sal_Int32 *)(pCppArgs + nParams);
304 // type descriptions for reconversions
305 typelib_TypeDescription ** ppTempParamTypeDescr = (typelib_TypeDescription **)(pCppArgs + (2 * nParams));
306
307 sal_Int32 nTempIndices = 0;
308
309 for ( sal_Int32 nPos = 0; nPos < nParams; ++nPos )
310 {
311 const typelib_MethodParameter & rParam = pParams[nPos];
312 typelib_TypeDescription * pParamTypeDescr = 0;
313 TYPELIB_DANGER_GET( &pParamTypeDescr, rParam.pTypeRef );
314
315 if (!rParam.bOut && bridges::cpp_uno::shared::isSimpleType( pParamTypeDescr ))
316 {
317 uno_copyAndConvertData( pCppArgs[nPos] = alloca( 8 ), pUnoArgs[nPos], pParamTypeDescr,
318 pThis->getBridge()->getUno2Cpp() );
319
320 switch (pParamTypeDescr->eTypeClass)
321 {
322 case typelib_TypeClass_LONG:
323 case typelib_TypeClass_UNSIGNED_LONG:
324 case typelib_TypeClass_ENUM:
325 INSERT_INT32( pCppArgs[nPos], nREG, pGPR, pStack );
326 break;
327 case typelib_TypeClass_CHAR:
328 case typelib_TypeClass_SHORT:
329 INSERT_INT16( pCppArgs[nPos], nREG, pGPR, pStack );
330 break;
331 case typelib_TypeClass_UNSIGNED_SHORT:
332 INSERT_UINT16( pCppArgs[nPos], nREG, pGPR, pStack );
333 break;
334 case typelib_TypeClass_BOOLEAN:
335 case typelib_TypeClass_BYTE:
336 INSERT_INT8( pCppArgs[nPos], nREG, pGPR, pStack );
337 break;
338 case typelib_TypeClass_FLOAT:
339 case typelib_TypeClass_DOUBLE:
340 INSERT_FLOAT_DOUBLE( pCppArgs[nPos], nREG, pFPR, pStack );
341 break;
342 case typelib_TypeClass_HYPER:
343 case typelib_TypeClass_UNSIGNED_HYPER:
344 INSERT_INT64( pCppArgs[nPos], nREG, pGPR, pStack );
345 break;
346 default:
347 break;
348 }
349
350 // no longer needed
351 TYPELIB_DANGER_RELEASE( pParamTypeDescr );
352 }
353 else // ptr to complex value | ref
354 {
355 if (! rParam.bIn) // is pure out
356 {
357 // cpp out is constructed mem, uno out is not!
359 pCppArgs[nPos] = alloca( pParamTypeDescr->nSize ),
360 pParamTypeDescr );
361 pTempIndices[nTempIndices] = nPos; // default constructed for cpp call
362 // will be released at reconversion
363 ppTempParamTypeDescr[nTempIndices++] = pParamTypeDescr;
364 }
365 // is in/inout
366 else if (bridges::cpp_uno::shared::relatesToInterfaceType( pParamTypeDescr ))
367 {
369 pCppArgs[nPos] = alloca( pParamTypeDescr->nSize ),
370 pUnoArgs[nPos], pParamTypeDescr, pThis->getBridge()->getUno2Cpp() );
371
372 pTempIndices[nTempIndices] = nPos; // has to be reconverted
373 // will be released at reconversion
374 ppTempParamTypeDescr[nTempIndices++] = pParamTypeDescr;
375 }
376 else // direct way
377 {
378 pCppArgs[nPos] = pUnoArgs[nPos];
379 // no longer needed
380 TYPELIB_DANGER_RELEASE( pParamTypeDescr );
381 }
382 INSERT_INT64( &(pCppArgs[nPos]), nREG, pGPR, pStack );
383 }
384 }
385
386 try
387 {
388 try {
390 pAdjustedThisPtr, aVtableSlot.index,
391 pCppReturn, pReturnTypeRef, bSimpleReturn,
392 pStackStart, ( pStack - pStackStart ),
393 pGPR, pFPR, nREG);
394 } catch (css::uno::Exception &) {
395 throw;
396 } catch (std::exception & e) {
397 throw css::uno::RuntimeException(
398 "C++ code threw " + o3tl::runtimeToOUString(typeid(e).name()) + ": "
399 + o3tl::runtimeToOUString(e.what()));
400 } catch (...) {
401 throw css::uno::RuntimeException("C++ code threw unknown exception");
402 }
403 // NO exception occurred...
404 *ppUnoExc = 0;
405
406 // reconvert temporary params
407 for ( ; nTempIndices--; )
408 {
409 sal_Int32 nIndex = pTempIndices[nTempIndices];
410 typelib_TypeDescription * pParamTypeDescr = ppTempParamTypeDescr[nTempIndices];
411
412 if (pParams[nIndex].bIn)
413 {
414 if (pParams[nIndex].bOut) // inout
415 {
416 uno_destructData( pUnoArgs[nIndex], pParamTypeDescr, 0 ); // destroy uno value
417 uno_copyAndConvertData( pUnoArgs[nIndex], pCppArgs[nIndex], pParamTypeDescr,
418 pThis->getBridge()->getCpp2Uno() );
419 }
420 }
421 else // pure out
422 {
423 uno_copyAndConvertData( pUnoArgs[nIndex], pCppArgs[nIndex], pParamTypeDescr,
424 pThis->getBridge()->getCpp2Uno() );
425 }
426 // destroy temp cpp param => cpp: every param was constructed
427 uno_destructData( pCppArgs[nIndex], pParamTypeDescr, cpp_release );
428
429 TYPELIB_DANGER_RELEASE( pParamTypeDescr );
430 }
431 // return value
432 if (pCppReturn && pUnoReturn != pCppReturn)
433 {
434 uno_copyAndConvertData( pUnoReturn, pCppReturn, pReturnTypeDescr,
435 pThis->getBridge()->getCpp2Uno() );
436 uno_destructData( pCppReturn, pReturnTypeDescr, cpp_release );
437 }
438 }
439 catch (...)
440 {
441 // fill uno exception
443
444 // temporary params
445 for ( ; nTempIndices--; )
446 {
447 sal_Int32 nIndex = pTempIndices[nTempIndices];
448 // destroy temp cpp param => cpp: every param was constructed
449 uno_destructData( pCppArgs[nIndex], ppTempParamTypeDescr[nTempIndices], cpp_release );
450 TYPELIB_DANGER_RELEASE( ppTempParamTypeDescr[nTempIndices] );
451 }
452 // return type
453 if (pReturnTypeDescr)
454 TYPELIB_DANGER_RELEASE( pReturnTypeDescr );
455 }
456 }
457
458}
459
460
461namespace bridges::cpp_uno::shared {
462
464 uno_Interface * pUnoI, const typelib_TypeDescription * pMemberDescr,
465 void * pReturn, void * pArgs[], uno_Any ** ppException )
466{
467 // is my surrogate
469 = static_cast< bridges::cpp_uno::shared::UnoInterfaceProxy *> (pUnoI);
470 //typelib_InterfaceTypeDescription * pTypeDescr = pThis->pTypeDescr;
471
472#ifdef BRDEBUG
473 fprintf(stderr, "in dispatch\n");
474#endif
475
476 switch (pMemberDescr->eTypeClass)
477 {
478 case typelib_TypeClass_INTERFACE_ATTRIBUTE:
479 {
480
481 VtableSlot aVtableSlot(
483 reinterpret_cast<
484 typelib_InterfaceAttributeTypeDescription const * >(
485 pMemberDescr)));
486
487 if (pReturn)
488 {
489 // dependent dispatch
490 cpp_call(
491 pThis, aVtableSlot,
492 ((typelib_InterfaceAttributeTypeDescription *)pMemberDescr)->pAttributeTypeRef,
493 0, 0, // no params
494 pReturn, pArgs, ppException );
495 }
496 else
497 {
498 // is SET
499 typelib_MethodParameter aParam;
500 aParam.pTypeRef =
501 ((typelib_InterfaceAttributeTypeDescription *)pMemberDescr)->pAttributeTypeRef;
502 aParam.bIn = sal_True;
503 aParam.bOut = sal_False;
504
505 typelib_TypeDescriptionReference * pReturnTypeRef = 0;
506 OUString aVoidName("void");
508 &pReturnTypeRef, typelib_TypeClass_VOID, aVoidName.pData );
509
510 // dependent dispatch
511 aVtableSlot.index += 1; //get then set method
512 cpp_call(
513 pThis, aVtableSlot,
514 pReturnTypeRef,
515 1, &aParam,
516 pReturn, pArgs, ppException );
517
519 }
520
521 break;
522 }
523 case typelib_TypeClass_INTERFACE_METHOD:
524 {
525
526 VtableSlot aVtableSlot(
528 reinterpret_cast<
529 typelib_InterfaceMethodTypeDescription const * >(
530 pMemberDescr)));
531 switch (aVtableSlot.index)
532 {
533 // standard calls
534 case 1: // acquire uno interface
535 (*pUnoI->acquire)( pUnoI );
536 *ppException = 0;
537 break;
538 case 2: // release uno interface
539 (*pUnoI->release)( pUnoI );
540 *ppException = 0;
541 break;
542 case 0: // queryInterface() opt
543 {
544 typelib_TypeDescription * pTD = 0;
545 TYPELIB_DANGER_GET( &pTD, reinterpret_cast< Type * >( pArgs[0] )->getTypeLibType() );
546 if (pTD)
547 {
548 uno_Interface * pInterface = 0;
549 (*pThis->pBridge->getUnoEnv()->getRegisteredInterface)(pThis->pBridge->getUnoEnv(),
550 (void **)&pInterface, pThis->oid.pData,
551 (typelib_InterfaceTypeDescription *)pTD );
552
553 if (pInterface)
554 {
555 ::uno_any_construct(
556 reinterpret_cast< uno_Any * >( pReturn ),
557 &pInterface, pTD, 0 );
558 (*pInterface->release)( pInterface );
559 TYPELIB_DANGER_RELEASE( pTD );
560 *ppException = 0;
561 break;
562 }
563 TYPELIB_DANGER_RELEASE( pTD );
564 }
565 } // else perform queryInterface()
566 default:
567 // dependent dispatch
568 cpp_call(
569 pThis, aVtableSlot,
570 ((typelib_InterfaceMethodTypeDescription *)pMemberDescr)->pReturnTypeRef,
571 ((typelib_InterfaceMethodTypeDescription *)pMemberDescr)->nParams,
572 ((typelib_InterfaceMethodTypeDescription *)pMemberDescr)->pParams,
573 pReturn, pArgs, ppException );
574 }
575 break;
576 }
577 default:
578 {
579 ::com::sun::star::uno::RuntimeException aExc(
580 "illegal member type description!",
582
583 Type const & rExcType = cppu::UnoType<decltype(aExc)>::get();
584 // binary identical null reference
585 ::uno_type_any_construct( *ppException, &aExc, rExcType.getTypeLibType(), 0 );
586 }
587 }
588}
589
590}
591
592/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
XPropertyListType t
uno_Mapping * getUno2Cpp()
Definition: bridge.hxx:73
uno_ExtEnvironment * getUnoEnv()
Definition: bridge.hxx:70
uno_Mapping * getCpp2Uno()
Definition: bridge.hxx:72
A uno proxy wrapping a cpp interface.
com::sun::star::uno::XInterface * getCppI()
void SAL_CALL uno_destructData(void *pValue, typelib_TypeDescription *pTypeDescr, uno_ReleaseFunc release) SAL_THROW_EXTERN_C()
void SAL_CALL uno_constructData(void *pMem, typelib_TypeDescription *pTypeDescr) SAL_THROW_EXTERN_C()
void SAL_CALL uno_copyAndConvertData(void *pDest, void *pSource, typelib_TypeDescription *pTypeDescr, uno_Mapping *mapping) SAL_THROW_EXTERN_C()
char const * name
void callVirtualMethod(void *pThis, sal_uInt32 nVtableIndex, void *pRegisterReturn, typelib_TypeDescription *pReturnTypeDescr, bool bRegisterReturn, sal_uInt32 *pStack, sal_uInt32 nStack, sal_uInt32 *pGPR, double *pFPR) __attribute__((noinline))
#define MAX_FP_REGS
#define MAX_GP_REGS
#define INSERT_INT32(pSV, nr, pGPR, pDS)
#define INSERT_FLOAT_DOUBLE(pSV, nr, pFPR, pDS)
#define INSERT_INT8(pSV, nr, pGPR, pDS)
#define INSERT_INT16(pSV, nr, pGPR, pDS)
#define INSERT_INT64(pSV, nr, pGPR, pDS)
#define INSERT_UINT16(pSV, nr, pGPR, pDS)
static void cpp_call(bridges::cpp_uno::shared::UnoInterfaceProxy *pThis, bridges::cpp_uno::shared::VtableSlot aVtableSlot, typelib_TypeDescriptionReference *pReturnTypeRef, sal_Int32 nParams, typelib_MethodParameter *pParams, void *pUnoReturn, void *pUnoArgs[], uno_Any **ppUnoExc)
sal_Int32 nIndex
void * p
sal_uInt16 nPos
return NULL
struct _typelib_TypeDescription typelib_TypeDescription
Definition: msvc/except.hxx:53
struct _uno_Any uno_Any
Definition: msvc/except.hxx:32
bool return_in_hidden_param(typelib_TypeDescriptionReference *pTypeRef)
void fillUnoException(uno_Any *pUnoExc, uno_Mapping *pCpp2Uno)
void unoInterfaceProxyDispatch(uno_Interface *pUnoI, typelib_TypeDescription const *pMemberDescr, void *pReturn, void **pArgs, uno_Any **ppException)
VtableSlot getVtableSlot(typelib_InterfaceAttributeTypeDescription const *ifcMember)
Calculates the vtable slot associated with an interface attribute member.
Definition: vtables.cxx:132
bool isSimpleType(typelib_TypeClass typeClass)
Determines whether a type is a "simple" type (VOID, BOOLEAN, BYTE, SHORT, UNSIGNED SHORT,...
Definition: types.cxx:28
bool relatesToInterfaceType(typelib_TypeDescription const *type)
Determines whether a type relates to an interface type (is itself an interface type,...
Definition: types.cxx:41
Type
int i
void fillReturn(typelib_TypeDescriptionReference *pTypeRef, sal_Int64 *gret, double *fret, void *pRegisterReturn)
OUString runtimeToOUString(char const *runtimeString)
Represents a vtable slot of a C++ class.
Definition: vtables.hxx:60
sal_Int32 index
The index within the vtable.
Definition: vtables.hxx:76
sal_Int32 offset
The offset of the vtable.
Definition: vtables.hxx:68
void SAL_CALL typelib_typedescriptionreference_new(typelib_TypeDescriptionReference **ppTDR, typelib_TypeClass eTypeClass, rtl_uString *pTypeName) SAL_THROW_EXTERN_C()
void SAL_CALL typelib_typedescriptionreference_release(typelib_TypeDescriptionReference *pRef) SAL_THROW_EXTERN_C()
#define sal_True
#define sal_False