diff options
author | Simon Hausmann <simon.hausmann@qt.io> | 2018-03-16 11:15:38 +0100 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@qt.io> | 2018-03-16 10:42:57 +0000 |
commit | ee89a8c052db0fa3dffe3e01c4c0309cf9ec80d0 (patch) | |
tree | 281e0baf0ae8f69408f438dac87952805f8504af /src/qml/jit | |
parent | d7b361bc33992ed61310b709df476cc4fa9f67e5 (diff) |
Fix lookup of enums declared in QML singletons
Given the following expression
var x = MySingleton.MyEnumValue
where MySingleton is a QML (composite) singleton and MyEnumValue comes
from a QML declared enum, we had code in place up to (and including)
5.10 to attempt to optimize that expression to a enum constant at
compile time. In 5.10 that optimization does not exist anymore. In <=
5.10 we would also skip the optimization under certain circumstances
(too many statementes, etc.). The fallback that is in place for handling
this at run-time tried to be smart by avoiding the
QQmlContextWrapper::get lookup and return straight a reference to the
singleton as QObject. That works for regular property lookups, but it
fails when trying to look up something like an enum, that isn't a
meta-object property.
Change-Id: I1819b9d8ae06a3f595e067bf5b018c4065be76bb
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/qml/jit')
-rw-r--r-- | src/qml/jit/qv4jit.cpp | 11 | ||||
-rw-r--r-- | src/qml/jit/qv4jit_p.h | 1 |
2 files changed, 0 insertions, 12 deletions
diff --git a/src/qml/jit/qv4jit.cpp b/src/qml/jit/qv4jit.cpp index 5dc98a591a..bc46c0ca1d 100644 --- a/src/qml/jit/qv4jit.cpp +++ b/src/qml/jit/qv4jit.cpp @@ -917,14 +917,6 @@ void BaselineJIT::generate_LoadQmlImportedScripts(int result) as->storeReg(result); } -void BaselineJIT::generate_LoadQmlSingleton(int name) -{ - as->prepareCallWithArgCount(2); - as->passInt32AsArg(name, 1); - as->passEngineAsArg(0); - JIT_GENERATE_RUNTIME_CALL(Runtime::method_loadQmlSingleton, Assembler::ResultInAccumulator); -} - void BaselineJIT::startInstruction(Instr::Type /*instr*/) { if (hasLabel()) @@ -1328,9 +1320,6 @@ void BaselineJIT::collectLabelsInBytecode() MOTH_BEGIN_INSTR(LoadQmlImportedScripts) MOTH_END_INSTR(LoadQmlImportedScripts) - - MOTH_BEGIN_INSTR(LoadQmlSingleton) - MOTH_END_INSTR(LoadQmlSingleton) } } #undef MOTH_BEGIN_INSTR diff --git a/src/qml/jit/qv4jit_p.h b/src/qml/jit/qv4jit_p.h index c17ab4ff6e..5aebf78a8d 100644 --- a/src/qml/jit/qv4jit_p.h +++ b/src/qml/jit/qv4jit_p.h @@ -240,7 +240,6 @@ public: void generate_Sub(int lhs) override; void generate_LoadQmlContext(int result) override; void generate_LoadQmlImportedScripts(int result) override; - void generate_LoadQmlSingleton(int name) override; void startInstruction(Moth::Instr::Type instr) override; void endInstruction(Moth::Instr::Type instr) override; |