summaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4script_p.h
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2017-08-30 21:53:03 +0200
committerLars Knoll <lars.knoll@qt.io>2017-09-01 12:30:49 +0000
commit6df6f642ea382169533a0ad106be270b6d4b7d58 (patch)
tree143401796a060f2e9aef61f9e5bf9a5ffa34a73b /src/qml/jsruntime/qv4script_p.h
parentcc7a858698063649f9770a89949354e2b58ae288 (diff)
Move CallContext construction into a interpreter instruction
This will allow us to further cut down on function call overhead. To make this work, introduce a proper distinction between EvalCode and GlobalCode and use the correct compilation mode in all places. Change-Id: I070621142159b7416026347c9239200c5ed7a56b Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml/jsruntime/qv4script_p.h')
-rw-r--r--src/qml/jsruntime/qv4script_p.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/qml/jsruntime/qv4script_p.h b/src/qml/jsruntime/qv4script_p.h
index 96c3b4b32d..8d7500eb13 100644
--- a/src/qml/jsruntime/qv4script_p.h
+++ b/src/qml/jsruntime/qv4script_p.h
@@ -54,6 +54,7 @@
#include "qv4engine_p.h"
#include "qv4functionobject_p.h"
#include "qv4qmlcontext_p.h"
+#include "private/qv4compilercontext_p.h"
#include <QQmlError>
@@ -88,9 +89,9 @@ struct ContextStateSaver {
};
struct Q_QML_EXPORT Script {
- Script(ExecutionContext *scope, const QString &sourceCode, const QString &source = QString(), int line = 1, int column = 0)
+ Script(ExecutionContext *scope, QV4::Compiler::CompilationMode mode, const QString &sourceCode, const QString &source = QString(), int line = 1, int column = 0)
: sourceFile(source), line(line), column(column), sourceCode(sourceCode)
- , scope(scope), strictMode(false), inheritContext(false), parsed(false)
+ , scope(scope), strictMode(false), inheritContext(false), parsed(false), compilationMode(mode)
, vmFunction(0), parseAsBinding(false) {}
Script(ExecutionEngine *engine, QmlContext *qml, const QString &sourceCode, const QString &source = QString(), int line = 1, int column = 0)
: sourceFile(source), line(line), column(column), sourceCode(sourceCode)
@@ -109,6 +110,7 @@ struct Q_QML_EXPORT Script {
bool strictMode;
bool inheritContext;
bool parsed;
+ QV4::Compiler::CompilationMode compilationMode = QV4::Compiler::EvalCode;
QV4::PersistentValue qmlContext;
QQmlRefPointer<CompiledData::CompilationUnit> compilationUnit;
Function *vmFunction;