Save memory on array data
authorLars Knoll <lars.knoll@digia.com>
Thu, 9 Jan 2014 10:05:08 +0000 (11:05 +0100)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Mon, 20 Jan 2014 20:14:27 +0000 (21:14 +0100)
commit5c25379cd1889dc16187c0ec62f32d2b17a320cf
tree23bb7bef5b2378ffe0e4193bf753811f4bf843f4
parente2d9917878968986a9df21c9cfafc32a2360aee7
Save memory on array data

Store a simple vector of Values in the array data,
instead of a Vector of Property's. This halfes the
memory consumption on 64bit and simplifies our code.

If an indexed property gets converted to an accessor
property, we simply convert the ArrayData into a
SparseArrayData.

Add support in SparseArrayData to allocate double slots
(two Value's) to hold a full Property in case someone
sets an accessor on an indexed property.

Some methods still return a Property*, but this is safe, as
only the first Value in the Property pointer will ever get
accessed if the Property doesn't contain an accessor.

Change-Id: Ic9b0f309b09a2772a328d947a10faaf3be9fe56f
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
14 files changed:
src/qml/jsruntime/qv4argumentsobject.cpp
src/qml/jsruntime/qv4arraydata.cpp
src/qml/jsruntime/qv4arraydata_p.h
src/qml/jsruntime/qv4arrayobject.cpp
src/qml/jsruntime/qv4functionobject.cpp
src/qml/jsruntime/qv4object.cpp
src/qml/jsruntime/qv4object_p.h
src/qml/jsruntime/qv4objectproto.cpp
src/qml/jsruntime/qv4property_p.h
src/qml/jsruntime/qv4runtime.cpp
src/qml/jsruntime/qv4sparsearray.cpp
src/qml/jsruntime/qv4sparsearray_p.h
src/qml/jsruntime/qv4stringobject.cpp
tests/manual/v4/sparsearraytest.js