summaryrefslogtreecommitdiff
path: root/src/compiler/CompilerUtility.h
diff options
context:
space:
mode:
author buzbee <buzbee@google.com> 2012-01-17 17:33:47 -0800
committer buzbee <buzbee@google.com> 2012-01-24 06:00:32 -0800
commit5b53710b4abcf8f35c91a963a475b72cb34757e6 (patch)
tree9f10f49fd09798a8f07ebffb4ee357c135e56f9f /src/compiler/CompilerUtility.h
parentcf044318c5638df0c400b731e94fab948ebd5ccb (diff)
Dataflow analysis rework
Rework key portions of the dataflow analysis code to avoid the massive slowdowns we're seeing with methods containing more than 20,000 basic blocks. Add a somewhat hacky lookup cache in front of findBlock. Later we'll want to rework the "GrowableList" mechanism to incorporate this properly. Add memory to the bit vector utilities to speed up the iterators for large sparse vectors. (Similarly, in the future we'll want to include a rewrite of the home-grown bit-vector manipluation utilites to be better with large ones). With this CL, compilation speed on the degenerate cases is > 10x faster. Compilation of typically-sized methods will see a smallish improvement. Change-Id: I7f086c1229dd4fe62f0a5fc361234bf204ebc2b1
Diffstat (limited to 'src/compiler/CompilerUtility.h')
-rw-r--r--src/compiler/CompilerUtility.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/compiler/CompilerUtility.h b/src/compiler/CompilerUtility.h
index d7612ffc2f..a68ee5fb0a 100644
--- a/src/compiler/CompilerUtility.h
+++ b/src/compiler/CompilerUtility.h
@@ -58,8 +58,20 @@ typedef struct GrowableListIterator {
*/
struct ArenaBitVector {
bool expandable; /* expand bitmap if we run out? */
+ bool firstDirty; /* when true, don't believe firstBitSet */
+ bool lastDirty; /* when true, don't believe lastBitSet */
u4 storageSize; /* current size, in 32-bit words */
u4* storage;
+ /*
+ * Opportunistically remember first and
+ * last set bits. This yeilds a performance
+ * advantage in cases where large
+ * sparse vectors are repeatedly scanned
+ * (something that can happen a lot during
+ * dataflow analysis.
+ */
+ int firstBitSet;
+ int lastBitSet;
};
/* Handy iterator to walk through the bit positions set to 1 */