aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/compiler/qv4codegen.cpp
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2017-08-16 21:24:33 +0200
committerErik Verbruggen <erik.verbruggen@qt.io>2017-08-25 12:05:45 +0000
commit3c201dd0d95020c4cb4c8ceaf779673d411664e7 (patch)
tree97d4316e6d2ce54c0fa20600dcd1429f1b8ab789 /src/qml/compiler/qv4codegen.cpp
parent34280d266fe4bed0274b260c0091d50908acd087 (diff)
Specialize possible direct calls to eval
To avoid additional overhead on most function calls Change-Id: I2477b91fda6216b508c8331884a02b601f65590c Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
Diffstat (limited to 'src/qml/compiler/qv4codegen.cpp')
-rw-r--r--src/qml/compiler/qv4codegen.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/qml/compiler/qv4codegen.cpp b/src/qml/compiler/qv4codegen.cpp
index 0b8091d70e..273856e541 100644
--- a/src/qml/compiler/qv4codegen.cpp
+++ b/src/qml/compiler/qv4codegen.cpp
@@ -1199,7 +1199,11 @@ bool Codegen::visit(CallExpression *ast)
call.callData = calldata;
bytecodeGenerator->addInstruction(call);
} else if (base.type == Reference::Name) {
- if (useFastLookups && base.global) {
+ if (base.name == QStringLiteral("eval")) {
+ Instruction::CallPossiblyDirectEval call;
+ call.callData = calldata;
+ bytecodeGenerator->addInstruction(call);
+ } else if (useFastLookups && base.global) {
Instruction::CallGlobalLookup call;
call.index = registerGlobalGetterLookup(base.nameAsIndex());
call.callData = calldata;