diff options
author | Erik Verbruggen <erik.verbruggen@qt.io> | 2018-10-09 14:58:01 +0200 |
---|---|---|
committer | Erik Verbruggen <erik.verbruggen@qt.io> | 2019-01-25 10:26:13 +0000 |
commit | 784a55a15ddc65b59cc4709e54453238438eae48 (patch) | |
tree | 2903e0c690a8aef0b49f3e5d6c26ef4ac90543aa /src/qml/jsruntime/qv4engine.cpp | |
parent | 923fef3ad3076e337eba4e603a6f759c54cc404c (diff) |
V4: Collect trace information in the interpreter
Collect type information about values used in a function. These include
all parameters, and the results of many bytecode instructions. For array
loads/stores, it also tracks if the access is in-bounds of a
SimpleArrayData.
Collection is only enabled when the qml-tracing feature is turned on
while configuring.
In subsequent patches this is used to generated optimized JITted code.
Change-Id: I63985c334c3fdc55fca7fb4addfe3e535989aac5
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'src/qml/jsruntime/qv4engine.cpp')
-rw-r--r-- | src/qml/jsruntime/qv4engine.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/qml/jsruntime/qv4engine.cpp b/src/qml/jsruntime/qv4engine.cpp index a482cc6a67..8adb84719f 100644 --- a/src/qml/jsruntime/qv4engine.cpp +++ b/src/qml/jsruntime/qv4engine.cpp @@ -50,6 +50,7 @@ #include <QDateTime> #include <QDir> #include <QFileInfo> +#include <QLoggingCategory> #ifndef V4_BOOTSTRAP @@ -134,6 +135,8 @@ QT_BEGIN_NAMESPACE +Q_LOGGING_CATEGORY(lcTracingAll, "qt.v4.tracing.all") + using namespace QV4; #ifndef V4_BOOTSTRAP @@ -646,6 +649,13 @@ ExecutionEngine::ExecutionEngine(QJSEngine *jsEngine) ExecutionEngine::~ExecutionEngine() { + if (Q_UNLIKELY(lcTracingAll().isDebugEnabled())) { + for (auto cu : compilationUnits) { + for (auto f : qAsConst(cu->runtimeFunctions)) + qCDebug(lcTracingAll).noquote().nospace() << f->traceInfoToString(); + } + } + modules.clear(); delete m_multiplyWrappedQObjects; m_multiplyWrappedQObjects = nullptr; |