Kaydet (Commit) f7087b0e authored tarafından Pedro Giffuni's avatar Pedro Giffuni

Update i386 bridge code on FreeBSD to USE_DOUBLE_MMAP.

üst 755d5acc
...@@ -355,7 +355,7 @@ extern "C" typedef void (*PrivateSnippetExecutor)(); ...@@ -355,7 +355,7 @@ extern "C" typedef void (*PrivateSnippetExecutor)();
int const codeSnippetSize = 16; int const codeSnippetSize = 16;
unsigned char * codeSnippet( unsigned char * codeSnippet(
unsigned char * code, sal_Int32 functionIndex, sal_Int32 vtableOffset, unsigned char * code, sal_PtrDiff writetoexecdiff, sal_Int32 functionIndex, sal_Int32 vtableOffset,
typelib_TypeClass returnTypeClass) typelib_TypeClass returnTypeClass)
{ {
if (!bridges::cpp_uno::shared::isSimpleType(returnTypeClass)) { if (!bridges::cpp_uno::shared::isSimpleType(returnTypeClass)) {
...@@ -401,7 +401,7 @@ unsigned char * codeSnippet( ...@@ -401,7 +401,7 @@ unsigned char * codeSnippet(
// jmp privateSnippetExecutor: // jmp privateSnippetExecutor:
*p++ = 0xE9; *p++ = 0xE9;
*reinterpret_cast< sal_Int32 * >(p) *reinterpret_cast< sal_Int32 * >(p)
= ((unsigned char *) exec) - p - sizeof (sal_Int32); = ((unsigned char *) exec) - p - sizeof (sal_Int32) - writetoexecdiff;
p += sizeof (sal_Int32); p += sizeof (sal_Int32);
OSL_ASSERT(p - code <= codeSnippetSize); OSL_ASSERT(p - code <= codeSnippetSize);
return code + codeSnippetSize; return code + codeSnippetSize;
...@@ -434,7 +434,7 @@ bridges::cpp_uno::shared::VtableFactory::initializeBlock( ...@@ -434,7 +434,7 @@ bridges::cpp_uno::shared::VtableFactory::initializeBlock(
} }
unsigned char * bridges::cpp_uno::shared::VtableFactory::addLocalFunctions( unsigned char * bridges::cpp_uno::shared::VtableFactory::addLocalFunctions(
Slot ** slots, unsigned char * code, Slot ** slots, unsigned char * code, sal_PtrDiff writetoexecdiff,
typelib_InterfaceTypeDescription const * type, sal_Int32 functionOffset, typelib_InterfaceTypeDescription const * type, sal_Int32 functionOffset,
sal_Int32 functionCount, sal_Int32 vtableOffset) sal_Int32 functionCount, sal_Int32 vtableOffset)
{ {
...@@ -447,9 +447,9 @@ unsigned char * bridges::cpp_uno::shared::VtableFactory::addLocalFunctions( ...@@ -447,9 +447,9 @@ unsigned char * bridges::cpp_uno::shared::VtableFactory::addLocalFunctions(
switch (member->eTypeClass) { switch (member->eTypeClass) {
case typelib_TypeClass_INTERFACE_ATTRIBUTE: case typelib_TypeClass_INTERFACE_ATTRIBUTE:
// Getter: // Getter:
(s++)->fn = code; (s++)->fn = code + writetoexecdiff;
code = codeSnippet( code = codeSnippet(
code, functionOffset++, vtableOffset, code, writetoexecdiff, functionOffset++, vtableOffset,
reinterpret_cast< typelib_InterfaceAttributeTypeDescription * >( reinterpret_cast< typelib_InterfaceAttributeTypeDescription * >(
member)->pAttributeTypeRef->eTypeClass); member)->pAttributeTypeRef->eTypeClass);
// Setter: // Setter:
...@@ -457,17 +457,17 @@ unsigned char * bridges::cpp_uno::shared::VtableFactory::addLocalFunctions( ...@@ -457,17 +457,17 @@ unsigned char * bridges::cpp_uno::shared::VtableFactory::addLocalFunctions(
typelib_InterfaceAttributeTypeDescription * >( typelib_InterfaceAttributeTypeDescription * >(
member)->bReadOnly) member)->bReadOnly)
{ {
(s++)->fn = code; (s++)->fn = code + writetoexecdiff;
code = codeSnippet( code = codeSnippet(
code, functionOffset++, vtableOffset, code, writetoexecdiff, functionOffset++, vtableOffset,
typelib_TypeClass_VOID); typelib_TypeClass_VOID);
} }
break; break;
case typelib_TypeClass_INTERFACE_METHOD: case typelib_TypeClass_INTERFACE_METHOD:
(s++)->fn = code; (s++)->fn = code + writetoexecdiff;
code = codeSnippet( code = codeSnippet(
code, functionOffset++, vtableOffset, code, writetoexecdiff, functionOffset++, vtableOffset,
reinterpret_cast< typelib_InterfaceMethodTypeDescription * >( reinterpret_cast< typelib_InterfaceMethodTypeDescription * >(
member)->pReturnTypeRef->eTypeClass); member)->pReturnTypeRef->eTypeClass);
break; break;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment