diff options
Diffstat (limited to 'src/qml')
-rw-r--r-- | src/qml/jsruntime/qv4executableallocator.cpp | 14 | ||||
-rw-r--r-- | src/qml/jsruntime/qv4executableallocator_p.h | 10 | ||||
-rw-r--r-- | src/qml/jsruntime/qv4functiontable_win64.cpp | 4 |
3 files changed, 22 insertions, 6 deletions
diff --git a/src/qml/jsruntime/qv4executableallocator.cpp b/src/qml/jsruntime/qv4executableallocator.cpp index 7ee6f39aa2..c06773d3c5 100644 --- a/src/qml/jsruntime/qv4executableallocator.cpp +++ b/src/qml/jsruntime/qv4executableallocator.cpp @@ -45,12 +45,22 @@ using namespace QV4; -void *ExecutableAllocator::Allocation::exceptionHandler() const +void *ExecutableAllocator::Allocation::exceptionHandlerStart() const { return reinterpret_cast<void*>(addr); } -void *ExecutableAllocator::Allocation::start() const +size_t ExecutableAllocator::Allocation::exceptionHandlerSize() const +{ + return QV4::exceptionHandlerSize(); +} + +void *ExecutableAllocator::Allocation::memoryStart() const +{ + return reinterpret_cast<void*>(addr); +} + +void *ExecutableAllocator::Allocation::codeStart() const { return reinterpret_cast<void*>(addr + exceptionHandlerSize()); } diff --git a/src/qml/jsruntime/qv4executableallocator_p.h b/src/qml/jsruntime/qv4executableallocator_p.h index f98f2c7d33..4735fb151f 100644 --- a/src/qml/jsruntime/qv4executableallocator_p.h +++ b/src/qml/jsruntime/qv4executableallocator_p.h @@ -86,8 +86,14 @@ public: , free(true) {} - void *exceptionHandler() const; - void *start() const; + void *memoryStart() const; + size_t memorySize() const { return size; } + + void *exceptionHandlerStart() const; + size_t exceptionHandlerSize() const; + + void *codeStart() const; + void invalidate() { addr = 0; } bool isValid() const { return addr != 0; } void deallocate(ExecutableAllocator *allocator); diff --git a/src/qml/jsruntime/qv4functiontable_win64.cpp b/src/qml/jsruntime/qv4functiontable_win64.cpp index fc13dc2602..0cb98641cd 100644 --- a/src/qml/jsruntime/qv4functiontable_win64.cpp +++ b/src/qml/jsruntime/qv4functiontable_win64.cpp @@ -106,7 +106,7 @@ struct ExceptionHandlerRecord void generateFunctionTable(Function *, JSC::MacroAssemblerCodeRef *codeRef) { ExceptionHandlerRecord *record = reinterpret_cast<ExceptionHandlerRecord *>( - codeRef->executableMemory()->exceptionHandler()); + codeRef->executableMemory()->exceptionHandlerStart()); record->info.Version = 1; record->info.Flags = 0; @@ -136,7 +136,7 @@ void generateFunctionTable(Function *, JSC::MacroAssemblerCodeRef *codeRef) void destroyFunctionTable(Function *, JSC::MacroAssemblerCodeRef *codeRef) { ExceptionHandlerRecord *record = reinterpret_cast<ExceptionHandlerRecord *>( - codeRef->executableMemory()->exceptionHandler()); + codeRef->executableMemory()->exceptionHandlerStart()); if (!RtlDeleteFunctionTable(&record->handler)) { const unsigned int errorCode = GetLastError(); qWarning() << "Failed to remove win64 unwind hook. Error code:" << errorCode; |