Move null checks to bvector utility callers

It's generally ok to encounter basic blocks with no interesting
dataflow info, but better to skip in the callers of the utilities
than in the utilities themselves (to make it explicit).

Change-Id: I27b2c774381d4315d51436527ddf0378e5c05d32
diff --git a/src/compiler/Dataflow.cc b/src/compiler/Dataflow.cc
index 827470e..d4b5339 100644
--- a/src/compiler/Dataflow.cc
+++ b/src/compiler/Dataflow.cc
@@ -2405,6 +2405,10 @@
             if (predBBIdx == -1) break;
             predBB = (BasicBlock*)oatGrowableListGetElement(
                 blockList, predBBIdx);
+            if ((predBB->dataFlowInfo == NULL) ||
+                (predBB->dataFlowInfo->endingNullCheckV == NULL)) {
+                continue;
+            }
             oatIntersectBitVectors(cUnit->tempSSARegisterV,
                 cUnit->tempSSARegisterV,
                 predBB->dataFlowInfo->endingNullCheckV);
diff --git a/src/compiler/SSATransformation.cc b/src/compiler/SSATransformation.cc
index dea1971..1a488bb 100644
--- a/src/compiler/SSATransformation.cc
+++ b/src/compiler/SSATransformation.cc
@@ -247,7 +247,9 @@
         BasicBlock* predBB = (BasicBlock* ) oatGrowableListGetElement(
                                  blockList, predIdx);
         /* tempBlockV = tempBlockV ^ dominators */
-        oatIntersectBitVectors(tempBlockV, tempBlockV, predBB->dominators);
+        if (predBB->dominators != NULL) {
+            oatIntersectBitVectors(tempBlockV, tempBlockV, predBB->dominators);
+        }
     }
     oatSetBit(tempBlockV, bb->id);
     if (oatCompareBitVectors(tempBlockV, bb->dominators)) {
@@ -452,7 +454,9 @@
                     (BasicBlock* ) oatGrowableListGetElement(blockList, idx);
 
                 /* Merge the dominance frontier to tmpBlocks */
-                oatUnifyBitVectors(tmpBlocks, tmpBlocks, defBB->domFrontier);
+                if (defBB->domFrontier != NULL) {
+                    oatUnifyBitVectors(tmpBlocks, tmpBlocks, defBB->domFrontier);
+                }
             }
             if (oatCompareBitVectors(phiBlocks, tmpBlocks)) {
                 change = true;
diff --git a/src/compiler/Utility.cc b/src/compiler/Utility.cc
index 7d3a887..7b99966 100644
--- a/src/compiler/Utility.cc
+++ b/src/compiler/Utility.cc
@@ -373,8 +373,9 @@
 bool oatIntersectBitVectors(ArenaBitVector* dest, const ArenaBitVector* src1,
                             const ArenaBitVector* src2)
 {
-    if (src2 == NULL ||
-        dest->storageSize != src1->storageSize ||
+    DCHECK(src1 != NULL);
+    DCHECK(src2 != NULL);
+    if (dest->storageSize != src1->storageSize ||
         dest->storageSize != src2->storageSize ||
         dest->expandable != src1->expandable ||
         dest->expandable != src2->expandable)
@@ -393,8 +394,9 @@
 bool oatUnifyBitVectors(ArenaBitVector* dest, const ArenaBitVector* src1,
                         const ArenaBitVector* src2)
 {
-    if (src2 == NULL ||
-        dest->storageSize != src1->storageSize ||
+    DCHECK(src1 != NULL);
+    DCHECK(src2 != NULL);
+    if (dest->storageSize != src1->storageSize ||
         dest->storageSize != src2->storageSize ||
         dest->expandable != src1->expandable ||
         dest->expandable != src2->expandable)