diff options
author | Erik Verbruggen <erik.verbruggen@qt.io> | 2016-08-19 11:33:22 +0200 |
---|---|---|
committer | Erik Verbruggen <erik.verbruggen@qt.io> | 2016-08-23 09:04:38 +0000 |
commit | 34c82d54b70409202b36c8ec51442fa56014ba8a (patch) | |
tree | 47f278cb94f32c46634f5843431057e9195da8fc /src/qml/jsruntime/qv4util_p.h | |
parent | fd57e1449dc974417f3409a4da7338d7e8a6e7c8 (diff) |
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 <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml/jsruntime/qv4util_p.h')
-rw-r--r-- | src/qml/jsruntime/qv4util_p.h | 6 |
1 files changed, 6 insertions, 0 deletions
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<bool>(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); } |