diff options
author | Lars Knoll <lars.knoll@qt.io> | 2018-09-12 20:08:54 +0200 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2018-09-16 17:00:26 +0000 |
commit | cd148a1fd4959daac669581df35f91104fab7b8b (patch) | |
tree | 4c14c558a00614edfdc240d0dc156a1cc20bfd3f /src/qml/jsruntime/qv4object_p.h | |
parent | e436fb3569603bca8ad0a71fef67c03d2920aedc (diff) |
Optimize Object::virtualGet()
Optimize virtualGet() for the common case where the proto chain
are all regular objects.
Change-Id: I51eea9a4b96033be4effc2072fedc5b9b08e8440
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml/jsruntime/qv4object_p.h')
-rw-r--r-- | src/qml/jsruntime/qv4object_p.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/qml/jsruntime/qv4object_p.h b/src/qml/jsruntime/qv4object_p.h index 41484660ab..991c0591a5 100644 --- a/src/qml/jsruntime/qv4object_p.h +++ b/src/qml/jsruntime/qv4object_p.h @@ -185,12 +185,17 @@ struct Q_QML_EXPORT Object: Managed { // // helpers // - static ReturnedValue getValue(const Value &thisObject, const Value &v, PropertyAttributes attrs); + static ReturnedValue getValue(const Value &thisObject, const Value &v, PropertyAttributes attrs) { + if (attrs.isData()) + return v.asReturnedValue(); + return getValueAccessor(thisObject, v, attrs); + } ReturnedValue getValue(const Value &v, PropertyAttributes attrs) const { Scope scope(this->engine()); ScopedValue t(scope, const_cast<Object *>(this)); return getValue(t, v, attrs); } + static ReturnedValue getValueAccessor(const Value &thisObject, const Value &v, PropertyAttributes attrs); bool putValue(uint memberIndex, const Value &value); |