aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jit
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2018-01-15 15:36:25 +0100
committerLars Knoll <lars.knoll@qt.io>2018-01-17 09:20:59 +0000
commitc2b4c6393fee37e0c6c4a8c5d40d13120cc8a94e (patch)
tree1e3454e819e248337ad460b0db6a7a7239882523 /src/qml/jit
parentc2d0693ca99171ebeb8f35423f29562b0d26c6c0 (diff)
Use a more optimized lookup for global properties
Force the use of a global lookup if we know that the property can and will be found in the global object. This is possible, as the global object is frozen in QML mode and can't be overwritten. Shaves of .5% on the delegates_item_states benchmark, and will significantly speed up all accesses to e.g. the Math object. Change-Id: Ia1e248781a13ebaeb8bc43652e53a6fdde336d0d Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml/jit')
-rw-r--r--src/qml/jit/qv4isel_masm.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/qml/jit/qv4isel_masm.cpp b/src/qml/jit/qv4isel_masm.cpp
index 50d40f6f98..9ddab8f838 100644
--- a/src/qml/jit/qv4isel_masm.cpp
+++ b/src/qml/jit/qv4isel_masm.cpp
@@ -168,7 +168,7 @@ void InstructionSelection<JITAssembler>::callBuiltinInvalid(IR::Name *func, IR::
{
prepareCallData(args, 0);
- if (useFastLookups && func->global) {
+ if ((useFastLookups || func->forceLookup) && func->global) {
uint index = registerGlobalGetterLookup(*func->id);
generateRuntimeCall(_as, result, callGlobalLookup,
JITTargetPlatform::EngineRegister,
@@ -517,7 +517,7 @@ void InstructionSelection<JITAssembler>::loadRegexp(IR::RegExp *sourceRegexp, IR
template <typename JITAssembler>
void InstructionSelection<JITAssembler>::getActivationProperty(const IR::Name *name, IR::Expr *target)
{
- if (useFastLookups && name->global) {
+ if ((useFastLookups || name->forceLookup) && name->global) {
uint index = registerGlobalGetterLookup(*name->id);
generateLookupCall(target, index, offsetof(QV4::Lookup, globalGetter), JITTargetPlatform::EngineRegister, JITAssembler::Void);
return;
@@ -1128,7 +1128,7 @@ void InstructionSelection<JITAssembler>::constructActivationProperty(IR::Name *f
Q_ASSERT(func != 0);
prepareCallData(args, 0);
- if (useFastLookups && func->global) {
+ if ((useFastLookups || func->forceLookup) && func->global) {
uint index = registerGlobalGetterLookup(*func->id);
generateRuntimeCall(_as, result, constructGlobalLookup,
JITTargetPlatform::EngineRegister,