< prev index next >

src/share/vm/opto/cfgnode.cpp

Print this page

        

*** 45,55 **** // Optimization - Graph Style //============================================================================= //------------------------------Value------------------------------------------ // Compute the type of the RegionNode. ! const Type *RegionNode::Value( PhaseTransform *phase ) const { for( uint i=1; i<req(); ++i ) { // For all paths in Node *n = in(i); // Get Control source if( !n ) continue; // Missing inputs are TOP if( phase->type(n) == Type::CONTROL ) return Type::CONTROL; --- 45,55 ---- // Optimization - Graph Style //============================================================================= //------------------------------Value------------------------------------------ // Compute the type of the RegionNode. ! const Type* RegionNode::Value(PhaseGVN* phase) const { for( uint i=1; i<req(); ++i ) { // For all paths in Node *n = in(i); // Get Control source if( !n ) continue; // Missing inputs are TOP if( phase->type(n) == Type::CONTROL ) return Type::CONTROL;
*** 57,67 **** return Type::TOP; // All paths dead? Then so are we } //------------------------------Identity--------------------------------------- // Check for Region being Identity. ! Node *RegionNode::Identity( PhaseTransform *phase ) { // Cannot have Region be an identity, even if it has only 1 input. // Phi users cannot have their Region input folded away for them, // since they need to select the proper data input return this; } --- 57,67 ---- return Type::TOP; // All paths dead? Then so are we } //------------------------------Identity--------------------------------------- // Check for Region being Identity. ! Node* RegionNode::Identity(PhaseGVN* phase) { // Cannot have Region be an identity, even if it has only 1 input. // Phi users cannot have their Region input folded away for them, // since they need to select the proper data input return this; }
*** 889,899 **** #endif //------------------------------Value------------------------------------------ // Compute the type of the PhiNode ! const Type *PhiNode::Value( PhaseTransform *phase ) const { Node *r = in(0); // RegionNode if( !r ) // Copy or dead return in(1) ? phase->type(in(1)) : Type::TOP; // Note: During parsing, phis are often transformed before their regions. --- 889,899 ---- #endif //------------------------------Value------------------------------------------ // Compute the type of the PhiNode ! const Type* PhiNode::Value(PhaseGVN* phase) const { Node *r = in(0); // RegionNode if( !r ) // Copy or dead return in(1) ? phase->type(in(1)) : Type::TOP; // Note: During parsing, phis are often transformed before their regions.
*** 1140,1150 **** return id; } //------------------------------Identity--------------------------------------- // Check for Region being Identity. ! Node *PhiNode::Identity( PhaseTransform *phase ) { // Check for no merging going on // (There used to be special-case code here when this->region->is_Loop. // It would check for a tributary phi on the backedge that the main phi // trivially, perhaps with a single cast. The unique_input method // does all this and more, by reducing such tributaries to 'this'.) --- 1140,1150 ---- return id; } //------------------------------Identity--------------------------------------- // Check for Region being Identity. ! Node* PhiNode::Identity(PhaseGVN* phase) { // Check for no merging going on // (There used to be special-case code here when this->region->is_Loop. // It would check for a tributary phi on the backedge that the main phi // trivially, perhaps with a single cast. The unique_input method // does all this and more, by reducing such tributaries to 'this'.)
*** 2046,2062 **** } #endif //============================================================================= ! const Type *GotoNode::Value( PhaseTransform *phase ) const { // If the input is reachable, then we are executed. // If the input is not reachable, then we are not executed. return phase->type(in(0)); } ! Node *GotoNode::Identity( PhaseTransform *phase ) { return in(0); // Simple copy of incoming control } const RegMask &GotoNode::out_RegMask() const { return RegMask::Empty; --- 2046,2062 ---- } #endif //============================================================================= ! const Type* GotoNode::Value(PhaseGVN* phase) const { // If the input is reachable, then we are executed. // If the input is not reachable, then we are not executed. return phase->type(in(0)); } ! Node* GotoNode::Identity(PhaseGVN* phase) { return in(0); // Simple copy of incoming control } const RegMask &GotoNode::out_RegMask() const { return RegMask::Empty;
*** 2114,2124 **** } //------------------------------Value------------------------------------------ // Compute the type of the PCTableNode. If reachable it is a tuple of // Control, otherwise the table targets are not reachable ! const Type *PCTableNode::Value( PhaseTransform *phase ) const { if( phase->type(in(0)) == Type::CONTROL ) return bottom_type(); return Type::TOP; // All paths dead? Then so are we } --- 2114,2124 ---- } //------------------------------Value------------------------------------------ // Compute the type of the PCTableNode. If reachable it is a tuple of // Control, otherwise the table targets are not reachable ! const Type* PCTableNode::Value(PhaseGVN* phase) const { if( phase->type(in(0)) == Type::CONTROL ) return bottom_type(); return Type::TOP; // All paths dead? Then so are we }
*** 2159,2169 **** //============================================================================= //------------------------------Value------------------------------------------ // Check for being unreachable, or for coming from a Rethrow. Rethrow's cannot // have the default "fall_through_index" path. ! const Type *CatchNode::Value( PhaseTransform *phase ) const { // Unreachable? Then so are all paths from here. if( phase->type(in(0)) == Type::TOP ) return Type::TOP; // First assume all paths are reachable const Type** f = TypeTuple::fields(_size); for( uint i = 0; i < _size; i++ ) f[i] = Type::CONTROL; --- 2159,2169 ---- //============================================================================= //------------------------------Value------------------------------------------ // Check for being unreachable, or for coming from a Rethrow. Rethrow's cannot // have the default "fall_through_index" path. ! const Type* CatchNode::Value(PhaseGVN* phase) const { // Unreachable? Then so are all paths from here. if( phase->type(in(0)) == Type::TOP ) return Type::TOP; // First assume all paths are reachable const Type** f = TypeTuple::fields(_size); for( uint i = 0; i < _size; i++ ) f[i] = Type::CONTROL;
*** 2203,2213 **** } //------------------------------Identity--------------------------------------- // If only 1 target is possible, choose it if it is the main control ! Node *CatchProjNode::Identity( PhaseTransform *phase ) { // If my value is control and no other value is, then treat as ID const TypeTuple *t = phase->type(in(0))->is_tuple(); if (t->field_at(_con) != Type::CONTROL) return this; // If we remove the last CatchProj and elide the Catch/CatchProj, then we // also remove any exception table entry. Thus we must know the call --- 2203,2213 ---- } //------------------------------Identity--------------------------------------- // If only 1 target is possible, choose it if it is the main control ! Node* CatchProjNode::Identity(PhaseGVN* phase) { // If my value is control and no other value is, then treat as ID const TypeTuple *t = phase->type(in(0))->is_tuple(); if (t->field_at(_con) != Type::CONTROL) return this; // If we remove the last CatchProj and elide the Catch/CatchProj, then we // also remove any exception table entry. Thus we must know the call
*** 2246,2256 **** #endif //============================================================================= //------------------------------Identity--------------------------------------- // Check for CreateEx being Identity. ! Node *CreateExNode::Identity( PhaseTransform *phase ) { if( phase->type(in(1)) == Type::TOP ) return in(1); if( phase->type(in(0)) == Type::TOP ) return in(0); // We only come from CatchProj, unless the CatchProj goes away. // If the CatchProj is optimized away, then we just carry the // exception oop through. --- 2246,2256 ---- #endif //============================================================================= //------------------------------Identity--------------------------------------- // Check for CreateEx being Identity. ! Node* CreateExNode::Identity(PhaseGVN* phase) { if( phase->type(in(1)) == Type::TOP ) return in(1); if( phase->type(in(0)) == Type::TOP ) return in(0); // We only come from CatchProj, unless the CatchProj goes away. // If the CatchProj is optimized away, then we just carry the // exception oop through.
*** 2262,2272 **** } //============================================================================= //------------------------------Value------------------------------------------ // Check for being unreachable. ! const Type *NeverBranchNode::Value( PhaseTransform *phase ) const { if (!in(0) || in(0)->is_top()) return Type::TOP; return bottom_type(); } //------------------------------Ideal------------------------------------------ --- 2262,2272 ---- } //============================================================================= //------------------------------Value------------------------------------------ // Check for being unreachable. ! const Type* NeverBranchNode::Value(PhaseGVN* phase) const { if (!in(0) || in(0)->is_top()) return Type::TOP; return bottom_type(); } //------------------------------Ideal------------------------------------------
< prev index next >