1.1 --- a/src/share/vm/opto/node.cpp Sat Jan 07 13:26:43 2012 -0800 1.2 +++ b/src/share/vm/opto/node.cpp Tue Jan 10 18:05:38 2012 -0800 1.3 @@ -833,8 +833,20 @@ 1.4 1.5 //---------------------------uncast_helper------------------------------------- 1.6 Node* Node::uncast_helper(const Node* p) { 1.7 - uint max_depth = 3; 1.8 - for (uint i = 0; i < max_depth; i++) { 1.9 +#ifdef ASSERT 1.10 + uint depth_count = 0; 1.11 + const Node* orig_p = p; 1.12 +#endif 1.13 + 1.14 + while (true) { 1.15 +#ifdef ASSERT 1.16 + if (depth_count >= K) { 1.17 + orig_p->dump(4); 1.18 + if (p != orig_p) 1.19 + p->dump(1); 1.20 + } 1.21 + assert(depth_count++ < K, "infinite loop in Node::uncast_helper"); 1.22 +#endif 1.23 if (p == NULL || p->req() != 2) { 1.24 break; 1.25 } else if (p->is_ConstraintCast()) {