diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2021-03-11 12:37:37 +0100 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@qt.io> | 2021-03-13 12:56:47 +0100 |
commit | 490257d44706862500c11d9a05b476c234c260e7 (patch) | |
tree | 55d6d636ee346491894e3da11fc48c81b747dddf /src/qml/jsruntime/qv4engine_p.h | |
parent | eb2386a04260966c5d1f13941f7a10154e11625a (diff) |
Optimize QML context retrieval for AOT functions
We can cache the QQmlContextWrapper rather than retrieving it twice.
Inline some things, and do not unnecessarily create and destroy ref
pointers.
Change-Id: Ife0980f83b7efe1ea9dc56aacbfbccd029ce77c8
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/qml/jsruntime/qv4engine_p.h')
-rw-r--r-- | src/qml/jsruntime/qv4engine_p.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/qml/jsruntime/qv4engine_p.h b/src/qml/jsruntime/qv4engine_p.h index 0edac38d9c..7f14fd5e4e 100644 --- a/src/qml/jsruntime/qv4engine_p.h +++ b/src/qml/jsruntime/qv4engine_p.h @@ -561,7 +561,10 @@ public: void setProfiler(Profiling::Profiler *profiler); #endif // QT_CONFIG(qml_debug) - ExecutionContext *currentContext() const; + ExecutionContext *currentContext() const + { + return static_cast<ExecutionContext *>(¤tStackFrame->jsFrame->context); + } // ensure we always get odd prototype IDs. This helps make marking in QV4::Lookup fast quintptr newProtoId() { return (protoIdCount += 2); } |