QV4: Don't heap allocate blockNumbers.
authorRobin Burchell <robin.burchell@viroteck.net>
Sun, 21 Dec 2014 21:55:24 +0000 (22:55 +0100)
committerRobin Burchell <robin.burchell@viroteck.net>
Fri, 9 Jan 2015 11:41:11 +0000 (12:41 +0100)
commitdc5e5cbaa40db751628888d35125486c1249444b
tree1e9f7c1c7116c5f5477573cc47a77cc40980e2d2
parent04bc7c175806ce5e62ad3eaea0c5897426b2b810
QV4: Don't heap allocate blockNumbers.

Analysis of the allocations in BasicBlockSet show a huge amount of time spent in
allocating and freeing BasicBlockSet, which involves heap allocations. Most of
the time, blockNumbers is tiny (at least in my testing) - 0 to 1 in size at
deletion time. By inlining the (small) array, we save a nasty penalty.

This shaves around 400ms off the optimizer phase of my morbid QML testcase.

Change-Id: I46319173b5408a0d7a1b9663fdc516c9e5ca410e
Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
src/qml/compiler/qv4ssa.cpp