aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4engine.cpp
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2017-11-03 22:08:02 +0100
committerLars Knoll <lars.knoll@qt.io>2017-11-14 21:45:54 +0000
commit353164263c55825a0ec72d30128c50560c626334 (patch)
treee44b831652a84fc75237ce628a06438f620a0599 /src/qml/jsruntime/qv4engine.cpp
parent5c0481c1934ef4b39437eef06ddfa15170473bcb (diff)
Avoid marking on simple array data's
Speeds up things by 2-3%. Change-Id: Ib17ab126cf91ce48a0ced7dd7b06c4f7f0a70a3b Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
Diffstat (limited to 'src/qml/jsruntime/qv4engine.cpp')
-rw-r--r--src/qml/jsruntime/qv4engine.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/qml/jsruntime/qv4engine.cpp b/src/qml/jsruntime/qv4engine.cpp
index 049e4a117d..78c10eacc7 100644
--- a/src/qml/jsruntime/qv4engine.cpp
+++ b/src/qml/jsruntime/qv4engine.cpp
@@ -585,6 +585,12 @@ Heap::ArrayObject *ExecutionEngine::newArrayObject(const Value *values, int leng
// this doesn't require a write barrier, things will be ok, when the new array data gets inserted into
// the parent object
memcpy(&d->values.values, values, length*sizeof(Value));
+ for (int i = 0; i < length; ++i) {
+ if (values[i].isManaged()) {
+ d->needsMark = true;
+ break;
+ }
+ }
a->d()->arrayData.set(this, d);
a->setArrayLengthUnchecked(length);
}