diff options
author | Lars Knoll <lars.knoll@digia.com> | 2013-10-13 22:08:59 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-10-14 21:59:56 +0200 |
commit | 668eca2b9343cf5d79dc1faa6c251595e2e84918 (patch) | |
tree | bae99ec4065b0e20ba3bbf2fab89434d43d12f07 /src/qml/jsruntime/qv4argumentsobject.cpp | |
parent | 669e6b434f015982d2e5e9f48ef72d8e8eebb0ac (diff) |
Avoid creating array attributes if possible
Holes in arrays should be represented by an empty
value, not by creating/setting array attributes.
Reason is that the creation is irreversable, and slows
down execution. This speeds up crypto.js by 10%
Change-Id: I2e5472575479a5f2dbe53f59ecb8ed3aeab1be7a
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/qml/jsruntime/qv4argumentsobject.cpp')
-rw-r--r-- | src/qml/jsruntime/qv4argumentsobject.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/qml/jsruntime/qv4argumentsobject.cpp b/src/qml/jsruntime/qv4argumentsobject.cpp index c815036550..47b149c9d5 100644 --- a/src/qml/jsruntime/qv4argumentsobject.cpp +++ b/src/qml/jsruntime/qv4argumentsobject.cpp @@ -127,12 +127,11 @@ bool ArgumentsObject::defineOwnProperty(ExecutionContext *ctx, uint index, const isNonStrictArgumentsObject = true; if (isMapped && attrs.isData()) { - if (!attrs.isGeneric()) { - ScopedCallData callData(scope, 1); - callData->thisObject = this->asReturnedValue(); - callData->args[0] = desc.value; - map.setter()->call(callData); - } + ScopedCallData callData(scope, 1); + callData->thisObject = this->asReturnedValue(); + callData->args[0] = desc.value; + map.setter()->call(callData); + if (attrs.isWritable()) { *pd = map; arrayAttributes[pidx] = mapAttrs; |