From 34c82d54b70409202b36c8ec51442fa56014ba8a Mon Sep 17 00:00:00 2001 From: Erik Verbruggen Date: Fri, 19 Aug 2016 11:33:22 +0200 Subject: V4: Replace a QSet with a QVector in calculateOptionalJumps Instead of storing a bunch of statement IDs in a QSet, the parent basic block of the terminator statement (specifically: the jump) is used as an index into a bit vector. If the bit is set, this indicates that the jump can be omitted. This reduces the number of allocations from 1 hash node per optional jump, to 1 per function. The allocation will also be smaller then a hash node. Change-Id: Ia34468534b96dd9cefa837523bf89ad233de92e8 Reviewed-by: Simon Hausmann --- src/qml/jsruntime/qv4util_p.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/qml/jsruntime/qv4util_p.h') diff --git a/src/qml/jsruntime/qv4util_p.h b/src/qml/jsruntime/qv4util_p.h index 59c12c5e46..2669a3e4bf 100644 --- a/src/qml/jsruntime/qv4util_p.h +++ b/src/qml/jsruntime/qv4util_p.h @@ -90,6 +90,9 @@ public: : bits(size, value) {} + void clear() + { bits = std::vector(bits.size(), false); } + void reserve(int size) { bits.reserve(size); } @@ -153,6 +156,9 @@ public: : bits(size, value) {} + void clear() + { bits = QBitArray(bits.size(), false); } + void reserve(int size) { Q_UNUSED(size); } -- cgit v1.2.3