From 74d23ca548b47c85c4b8cdde5fd5a9026e4eb08c Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Thu, 8 Nov 2018 18:09:21 +0100 Subject: 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 --- src/qml/jsruntime/qv4function.cpp | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'src/qml/jsruntime/qv4function.cpp') 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 #include +#include #include #include #include @@ -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 ¶meters) @@ -145,6 +149,17 @@ void Function::updateInternalClass(ExecutionEngine *engine, const QListname()->toQString() : QString(); + if (prettyName.isEmpty()) { + prettyName = QString::number(reinterpret_cast(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); -- cgit v1.2.3