src/share/vm/opto/cfgnode.cpp

changeset 1040
98cb887364d3
parent 990
35ae4dd6c27c
child 1063
7bb995fbd3c0
equal deleted inserted replaced
1039:ec59443af135 1040:98cb887364d3
1348 n->del_req(i); 1348 n->del_req(i);
1349 } 1349 }
1350 } 1350 }
1351 1351
1352 // Register the new node but do not transform it. Cannot transform until the 1352 // Register the new node but do not transform it. Cannot transform until the
1353 // entire Region/Phi conglerate has been hacked as a single huge transform. 1353 // entire Region/Phi conglomerate has been hacked as a single huge transform.
1354 igvn->register_new_node_with_optimizer( newn ); 1354 igvn->register_new_node_with_optimizer( newn );
1355 // Now I can point to the new node. 1355 // Now I can point to the new node.
1356 n->add_req(newn); 1356 n->add_req(newn);
1357 igvn->_worklist.push(n); 1357 igvn->_worklist.push(n);
1358 } 1358 }
1379 return NULL; 1379 return NULL;
1380 1380
1381 Node *val = phi->in(i); // Constant to split for 1381 Node *val = phi->in(i); // Constant to split for
1382 uint hit = 0; // Number of times it occurs 1382 uint hit = 0; // Number of times it occurs
1383 1383
1384 for( ; i < phi->req(); i++ ){ // Count occurances of constant 1384 for( ; i < phi->req(); i++ ){ // Count occurrences of constant
1385 Node *n = phi->in(i); 1385 Node *n = phi->in(i);
1386 if( !n ) return NULL; 1386 if( !n ) return NULL;
1387 if( phase->type(n) == Type::TOP ) return NULL; 1387 if( phase->type(n) == Type::TOP ) return NULL;
1388 if( phi->in(i) == val ) 1388 if( phi->in(i) == val )
1389 hit++; 1389 hit++;
1421 return phi; 1421 return phi;
1422 } 1422 }
1423 1423
1424 //============================================================================= 1424 //=============================================================================
1425 //------------------------------simple_data_loop_check------------------------- 1425 //------------------------------simple_data_loop_check-------------------------
1426 // Try to determing if the phi node in a simple safe/unsafe data loop. 1426 // Try to determining if the phi node in a simple safe/unsafe data loop.
1427 // Returns: 1427 // Returns:
1428 // enum LoopSafety { Safe = 0, Unsafe, UnsafeLoop }; 1428 // enum LoopSafety { Safe = 0, Unsafe, UnsafeLoop };
1429 // Safe - safe case when the phi and it's inputs reference only safe data 1429 // Safe - safe case when the phi and it's inputs reference only safe data
1430 // nodes; 1430 // nodes;
1431 // Unsafe - the phi and it's inputs reference unsafe data nodes but there 1431 // Unsafe - the phi and it's inputs reference unsafe data nodes but there
1685 Node *m = phase->transform(n); 1685 Node *m = phase->transform(n);
1686 if (outcnt() == 0) { // Above transform() may kill us! 1686 if (outcnt() == 0) { // Above transform() may kill us!
1687 progress = phase->C->top(); 1687 progress = phase->C->top();
1688 break; 1688 break;
1689 } 1689 }
1690 // If tranformed to a MergeMem, get the desired slice 1690 // If transformed to a MergeMem, get the desired slice
1691 // Otherwise the returned node represents memory for every slice 1691 // Otherwise the returned node represents memory for every slice
1692 Node *new_mem = (m->is_MergeMem()) ? 1692 Node *new_mem = (m->is_MergeMem()) ?
1693 m->as_MergeMem()->memory_at(alias_idx) : m; 1693 m->as_MergeMem()->memory_at(alias_idx) : m;
1694 // Update input if it is progress over what we have now 1694 // Update input if it is progress over what we have now
1695 if (new_mem != ii) { 1695 if (new_mem != ii) {
1960 // Rethrows always throw exceptions, never return 1960 // Rethrows always throw exceptions, never return
1961 if (call->entry_point() == OptoRuntime::rethrow_stub()) { 1961 if (call->entry_point() == OptoRuntime::rethrow_stub()) {
1962 f[CatchProjNode::fall_through_index] = Type::TOP; 1962 f[CatchProjNode::fall_through_index] = Type::TOP;
1963 } else if( call->req() > TypeFunc::Parms ) { 1963 } else if( call->req() > TypeFunc::Parms ) {
1964 const Type *arg0 = phase->type( call->in(TypeFunc::Parms) ); 1964 const Type *arg0 = phase->type( call->in(TypeFunc::Parms) );
1965 // Check for null reciever to virtual or interface calls 1965 // Check for null receiver to virtual or interface calls
1966 if( call->is_CallDynamicJava() && 1966 if( call->is_CallDynamicJava() &&
1967 arg0->higher_equal(TypePtr::NULL_PTR) ) { 1967 arg0->higher_equal(TypePtr::NULL_PTR) ) {
1968 f[CatchProjNode::fall_through_index] = Type::TOP; 1968 f[CatchProjNode::fall_through_index] = Type::TOP;
1969 } 1969 }
1970 } // End of if not a runtime stub 1970 } // End of if not a runtime stub
1993 if (t->field_at(_con) != Type::CONTROL) return this; 1993 if (t->field_at(_con) != Type::CONTROL) return this;
1994 // If we remove the last CatchProj and elide the Catch/CatchProj, then we 1994 // If we remove the last CatchProj and elide the Catch/CatchProj, then we
1995 // also remove any exception table entry. Thus we must know the call 1995 // also remove any exception table entry. Thus we must know the call
1996 // feeding the Catch will not really throw an exception. This is ok for 1996 // feeding the Catch will not really throw an exception. This is ok for
1997 // the main fall-thru control (happens when we know a call can never throw 1997 // the main fall-thru control (happens when we know a call can never throw
1998 // an exception) or for "rethrow", because a further optimnization will 1998 // an exception) or for "rethrow", because a further optimization will
1999 // yank the rethrow (happens when we inline a function that can throw an 1999 // yank the rethrow (happens when we inline a function that can throw an
2000 // exception and the caller has no handler). Not legal, e.g., for passing 2000 // exception and the caller has no handler). Not legal, e.g., for passing
2001 // a NULL receiver to a v-call, or passing bad types to a slow-check-cast. 2001 // a NULL receiver to a v-call, or passing bad types to a slow-check-cast.
2002 // These cases MUST throw an exception via the runtime system, so the VM 2002 // These cases MUST throw an exception via the runtime system, so the VM
2003 // will be looking for a table entry. 2003 // will be looking for a table entry.

mercurial