diff options
author | Lars Knoll <lars.knoll@qt.io> | 2017-08-07 08:37:45 +0200 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2017-08-10 08:18:56 +0000 |
commit | 30e3664bf3668bda9a211fe7d1404f8f806dbf7b (patch) | |
tree | bd119839af7db0f6f9119401d478b37b44051c8b /src/qml/jsruntime/qv4engine.cpp | |
parent | eb2c08f57493aa12850e6cddff2cc3527e7cbfd7 (diff) |
Avoid creating a CallContext for simple functions
This cuts out quite a bit of overhead when entering
and leaving functions.
Change-Id: I32670c98a4087ea3b2d45853d9cabff9066399e8
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml/jsruntime/qv4engine.cpp')
-rw-r--r-- | src/qml/jsruntime/qv4engine.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/qml/jsruntime/qv4engine.cpp b/src/qml/jsruntime/qv4engine.cpp index ad090682cc..08f4f29763 100644 --- a/src/qml/jsruntime/qv4engine.cpp +++ b/src/qml/jsruntime/qv4engine.cpp @@ -875,14 +875,13 @@ QUrl ExecutionEngine::resolvedUrl(const QString &file) return src; QUrl base; - ExecutionContext *c = currentContext; - while (c) { - CallContext *callCtx = c->asCallContext(); - if (callCtx && callCtx->d()->v4Function) { - base.setUrl(callCtx->d()->v4Function->sourceFile()); + StackFrame *f = currentStackFrame; + while (f) { + if (f->v4Function) { + base.setUrl(f->v4Function->sourceFile()); break; } - c = parentContext(c); + f = f->parent; } if (base.isEmpty() && globalCode) |