< prev index next >

src/hotspot/share/opto/ifnode.cpp

Print this page
*** 1227,10 ***
--- 1227,27 ---
      return true;
    }
    return false;
  }
  
+ // Returns true if this IfNode belongs to a flat array check
+ // and returns the corresponding array in the 'array' parameter.
+ bool IfNode::is_flat_array_check(PhaseTransform* phase, Node** array) {
+   Node* bol = in(1);
+   if (!bol->is_Bool()) {
+     return false;
+   }
+   Node* cmp = bol->in(1);
+   if (cmp->isa_FlatArrayCheck()) {
+     if (array != NULL) {
+       *array = cmp->in(FlatArrayCheckNode::Array);
+     }
+     return true;
+   }
+   return false;
+ }
+ 
  // Check that the If that is in between the 2 integer comparisons has
  // no side effect
  bool IfNode::is_side_effect_free_test(ProjNode* proj, PhaseIterGVN* igvn) {
    if (proj == NULL) {
      return false;
< prev index next >