aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4arraydata.cpp
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@theqtcompany.com>2015-01-09 13:13:04 +0100
committerSimon Hausmann <simon.hausmann@digia.com>2015-01-12 11:04:19 +0100
commit3840beb6c61023542a689c7f125a7b521d3b2551 (patch)
treeb787c7383fd6ea631d81f6952f4687804e4c4e48 /src/qml/jsruntime/qv4arraydata.cpp
parent462496c2bbf9a35ce13762af8830cb2f87b0c27e (diff)
Get rid of hasAccessorProperty in Heap::Base
This shouldn't affect performance as we can just as well check for cases where we need to take the slow path differently. Change-Id: I4b9f69c39e9e64b437820ca3a6ea43e8877f2cf3 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/qml/jsruntime/qv4arraydata.cpp')
-rw-r--r--src/qml/jsruntime/qv4arraydata.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/qml/jsruntime/qv4arraydata.cpp b/src/qml/jsruntime/qv4arraydata.cpp
index f0277430ad..a4f67c7656 100644
--- a/src/qml/jsruntime/qv4arraydata.cpp
+++ b/src/qml/jsruntime/qv4arraydata.cpp
@@ -35,6 +35,7 @@
#include "qv4functionobject_p.h"
#include "qv4mm_p.h"
#include "qv4runtime_p.h"
+#include "qv4argumentsobject_p.h"
using namespace QV4;
@@ -570,9 +571,13 @@ uint ArrayData::append(Object *obj, ArrayObject *otherObj, uint n)
uint oldSize = obj->getLength();
- if (other && other->isSparse()) {
+ if (!other || ArgumentsObject::isNonStrictArgumentsObject(otherObj)) {
+ ScopedValue v(scope);
+ for (uint i = 0; i < n; ++i)
+ obj->arraySet(oldSize + i, (v = otherObj->getIndexed(i)));
+ } else if (other && other->isSparse()) {
Heap::SparseArrayData *os = static_cast<Heap::SparseArrayData *>(other->d());
- if (otherObj->hasAccessorProperty() && other->hasAttributes()) {
+ if (other->hasAttributes()) {
ScopedValue v(scope);
for (const SparseArrayNode *it = os->sparse->begin();
it != os->sparse->end(); it = it->nextNode()) {