From 4d9ffeff745a4a8bd31df7af85058d38383c5286 Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Fri, 14 Jun 2019 13:58:36 +0200 Subject: Inline CompiledData::unlink() into the only caller The compiler never links anything and therefore it doesn't need to unlink, either. Change-Id: I9ccdc012f9333abc5f4b60174b794e490772e1fd Reviewed-by: Simon Hausmann Reviewed-by: Fabian Kosmale --- src/qml/compiler/qv4compileddata.cpp | 10 ---------- src/qml/compiler/qv4compileddata_p.h | 2 -- src/qml/jsruntime/qv4executablecompilationunit.cpp | 7 ++++++- 3 files changed, 6 insertions(+), 13 deletions(-) diff --git a/src/qml/compiler/qv4compileddata.cpp b/src/qml/compiler/qv4compileddata.cpp index e548085873..ee53ca1586 100644 --- a/src/qml/compiler/qv4compileddata.cpp +++ b/src/qml/compiler/qv4compileddata.cpp @@ -150,16 +150,6 @@ QString Binding::escapedString(const QString &string) return tmp; } -void CompilationUnit::unlink() -{ - free(runtimeStrings); - runtimeStrings = nullptr; - delete [] runtimeRegularExpressions; - runtimeRegularExpressions = nullptr; - free(runtimeClasses); - runtimeClasses = nullptr; -} - } } diff --git a/src/qml/compiler/qv4compileddata_p.h b/src/qml/compiler/qv4compileddata_p.h index b8ae2536dc..1db23fc755 100644 --- a/src/qml/compiler/qv4compileddata_p.h +++ b/src/qml/compiler/qv4compileddata_p.h @@ -1136,8 +1136,6 @@ public: Heap::Module *module() const { return m_module; } void setModule(Heap::Module *module) { m_module = module; } - void unlink(); - private: QString m_fileName; // initialized from data->sourceFileIndex QString m_finalUrlString; // initialized from data->finalUrlIndex diff --git a/src/qml/jsruntime/qv4executablecompilationunit.cpp b/src/qml/jsruntime/qv4executablecompilationunit.cpp index 86fd2e9171..39f4a0a129 100644 --- a/src/qml/jsruntime/qv4executablecompilationunit.cpp +++ b/src/qml/jsruntime/qv4executablecompilationunit.cpp @@ -323,7 +323,12 @@ void ExecutableCompilationUnit::unlink() f->destroy(); runtimeFunctions.clear(); - CompiledData::CompilationUnit::unlink(); + free(runtimeStrings); + runtimeStrings = nullptr; + delete [] runtimeRegularExpressions; + runtimeRegularExpressions = nullptr; + free(runtimeClasses); + runtimeClasses = nullptr; } void ExecutableCompilationUnit::markObjects(QV4::MarkStack *markStack) -- cgit v1.2.3