/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* * This file is part of the LibreOffice project. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. * * This file incorporates work covered by the following license notice: * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed * with this work for additional information regarding copyright * ownership. The ASF licenses this file to you under the Apache * License, Version 2.0 (the "License"); you may not use this file * except in compliance with the License. You may obtain a copy of * the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
if (!rParam.bOut && bridges::cpp_uno::shared::isSimpleType( pParamTypeDescr )) // value
{
pCppArgs[nPos] = pUnoArgs[nPos] = CPPU_CURRENT_NAMESPACE::adjustPointer(pCppStack, pParamTypeDescr); switch (pParamTypeDescr->eTypeClass)
{ case typelib_TypeClass_HYPER: case typelib_TypeClass_UNSIGNED_HYPER: case typelib_TypeClass_DOUBLE:
{ if ((reinterpret_cast< long >(pCppStack) & 7) != 0)
{
static_assert(sizeof (double) == sizeof (sal_Int64), "boo"); void * pDest = alloca( sizeof (sal_Int64) );
*reinterpret_cast< sal_Int32 * >(pDest) =
*reinterpret_cast< sal_Int32 const * >(pCppStack);
*(reinterpret_cast< sal_Int32 * >(pDest) + 1) =
*(reinterpret_cast< sal_Int32 const * >(pCppStack) + 1);
pCppArgs[nPos] = pUnoArgs[nPos] = pDest;
}
pCppStack += sizeof (sal_Int32); // extra long break; default: break;
}
} // no longer needed
TYPELIB_DANGER_RELEASE( pParamTypeDescr );
} else// ptr to complex value | ref
{
pCppArgs[nPos] = *(void **)pCppStack;
if (! rParam.bIn) // is pure out
{ // uno out is unconstructed mem!
pUnoArgs[nPos] = alloca( pParamTypeDescr->nSize );
pTempIndices[nTempIndices] = nPos; // will be released at reconversion
ppTempParamTypeDescr[nTempIndices++] = pParamTypeDescr;
} // is in/inout elseif (bridges::cpp_uno::shared::relatesToInterfaceType(
pParamTypeDescr ))
{
uno_copyAndConvertData( pUnoArgs[nPos] = alloca( pParamTypeDescr->nSize ),
*(void **)pCppStack, pParamTypeDescr,
pThis->getBridge()->getCpp2Uno() );
pTempIndices[nTempIndices] = nPos; // has to be reconverted // will be released at reconversion
ppTempParamTypeDescr[nTempIndices++] = pParamTypeDescr;
} else// direct way
{
pUnoArgs[nPos] = *(void **)pCppStack; // no longer needed
TYPELIB_DANGER_RELEASE( pParamTypeDescr );
}
}
pCppStack += sizeof(sal_Int32); // standard parameter length
}
// ExceptionHolder
uno_Any aUnoExc; // Any will be constructed by callee
uno_Any * pUnoExc = &aUnoExc;
// in case an exception occurred... if (pUnoExc)
{ // destruct temporary in/inout params for ( ; nTempIndices--; )
{
sal_Int32 nIndex = pTempIndices[nTempIndices];
if (pParams[nIndex].bIn) // is in/inout => was constructed
uno_destructData( pUnoArgs[nIndex], ppTempParamTypeDescr[nTempIndices], 0 );
TYPELIB_DANGER_RELEASE( ppTempParamTypeDescr[nTempIndices] );
} if (pReturnTypeDescr)
TYPELIB_DANGER_RELEASE( pReturnTypeDescr );
CPPU_CURRENT_NAMESPACE::raiseException(&aUnoExc, pThis->getBridge()->getUno2Cpp() ); // has to destruct the any // is here for dummy return typelib_TypeClass_VOID;
} else// else no exception occurred...
{ // temporary params for ( ; nTempIndices--; )
{
sal_Int32 nIndex = pTempIndices[nTempIndices];
typelib_TypeDescription * pParamTypeDescr = ppTempParamTypeDescr[nTempIndices];
// pCallStack: this, params // eventual [ret*] lies at pCallStack -1 // so count down pCallStack by one to keep it simple // pCallStack: this, params // eventual [ret*] lies at pCallStack -1 // so count down pCallStack by one to keep it simple
bridges::cpp_uno::shared::CppInterfaceProxy * pCppI
= bridges::cpp_uno::shared::CppInterfaceProxy::castInterfaceToProxy( static_cast< char * >(*pCallStack) - nVtableOffset); if ((nFunctionIndex & 0x80000000) != 0) {
nFunctionIndex &= 0x7FFFFFFF;
--pCallStack;
}
/** * is called on incoming vtable calls * (called by asm snippets)
*/ staticvoid cpp_vtable_call()
{
sal_Int64 nRegReturn; int nFunctionIndex; void** pCallStack; int vTableOffset;
namespace { // Some dummy type whose RTTI is used in the synthesized proxy vtables to make uses of dynamic_cast // on such proxy objects not crash: struct ProxyRtti {};
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.