aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4function.cpp
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2018-11-08 18:09:21 +0100
committerUlf Hermann <ulf.hermann@qt.io>2018-12-03 08:28:36 +0000
commit74d23ca548b47c85c4b8cdde5fd5a9026e4eb08c (patch)
treecaf94cffe04b7c6235ccfd5f117b17187733752b /src/qml/jsruntime/qv4function.cpp
parentfaf99c36d29bfad629fb6ec541ccc2f61ef93443 (diff)
V4: Generate function tables on 64bit windows
In order for global exception handlers to be called reliably, the runtime needs to unwind through JIT-generated code. This can be facilitated by installing a "function table" for each JITed function that specifies "use the frame pointer". Also make sure to generate a function table for JIT'ed regular expressions. Those were forgotten also in the linux case. Fixes: QTBUG-50061 Change-Id: Ib0b8ae9356ed80afe1cab017e36efa4ccbe73f90 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml/jsruntime/qv4function.cpp')
-rw-r--r--src/qml/jsruntime/qv4function.cpp17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/qml/jsruntime/qv4function.cpp b/src/qml/jsruntime/qv4function.cpp
index 941c37de5b..2a82d96f1d 100644
--- a/src/qml/jsruntime/qv4function.cpp
+++ b/src/qml/jsruntime/qv4function.cpp
@@ -46,6 +46,7 @@
#include "qv4lookup_p.h"
#include <private/qv4mm_p.h>
#include <private/qv4identifiertable_p.h>
+#include <private/qv4functiontable_p.h>
#include <assembler/MacroAssemblerCodeRef.h>
#include <private/qv4vme_moth_p.h>
#include <private/qqmlglobal_p.h>
@@ -98,7 +99,10 @@ Function::Function(ExecutionEngine *engine, CompiledData::CompilationUnit *unit,
Function::~Function()
{
- delete codeRef;
+ if (codeRef) {
+ destroyFunctionTable(this, codeRef);
+ delete codeRef;
+ }
}
void Function::updateInternalClass(ExecutionEngine *engine, const QList<QByteArray> &parameters)
@@ -145,6 +149,17 @@ void Function::updateInternalClass(ExecutionEngine *engine, const QList<QByteArr
nFormals = parameters.size();
}
+QString Function::prettyName(const Function *function, const void *code)
+{
+ QString prettyName = function ? function->name()->toQString() : QString();
+ if (prettyName.isEmpty()) {
+ prettyName = QString::number(reinterpret_cast<quintptr>(code), 16);
+ prettyName.prepend(QLatin1String("QV4::Function(0x"));
+ prettyName.append(QLatin1Char(')'));
+ }
+ return prettyName;
+}
+
QQmlSourceLocation Function::sourceLocation() const
{
return QQmlSourceLocation(sourceFile(), compiledFunction->location.line, compiledFunction->location.column);