diff options
author | Simon Hausmann <simon.hausmann@theqtcompany.com> | 2015-04-10 12:34:46 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@theqtcompany.com> | 2015-04-16 13:40:17 +0000 |
commit | b220a20552838fbafbbf126b9e50d148ae76518d (patch) | |
tree | 172e81559ed85ac0cdfedd4af9a9029bbdb15ecd /src/qml/jsruntime/qv4engine.cpp | |
parent | 3fa8540800c43ccc4e4c1f8f323fb5ade34044db (diff) |
Speed up value type binding creation
* Avoid calling QMetaType::construct/destruct(typeId, ...) as that requires
repeated lookups in the type registry. Instead cache the constructor/destructor/etc.
function addresses in the QQmlValueType singletons as QMetaType
* Allocate memory for the gadget pointer lazily, to accommodate the common case of
a value type binding by property reference.
Change-Id: I98a3ac73453b8f80027c06401b4f29a9707949d2
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'src/qml/jsruntime/qv4engine.cpp')
-rw-r--r-- | src/qml/jsruntime/qv4engine.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/qml/jsruntime/qv4engine.cpp b/src/qml/jsruntime/qv4engine.cpp index 8c0df3ef04..dfc7745f56 100644 --- a/src/qml/jsruntime/qv4engine.cpp +++ b/src/qml/jsruntime/qv4engine.cpp @@ -1738,9 +1738,8 @@ bool ExecutionEngine::metaTypeFromJS(const QV4::Value &value, int type, void *da { QV4::Scoped<QV4::QQmlValueTypeWrapper> vtw(scope, value); - if (vtw && vtw->d()->metaType == type) { - vtw->toGadget(data); - return true; + if (vtw && vtw->typeId() == type) { + return vtw->toGadget(data); } } |