79 w_o_mask = o_mask; // Must target desired registers
80 // Does the ideal-reg-mask overlap with o_mask? I.e., can I use
81 // a reg-reg move or do I need a trip across register classes
82 // (and thus through memory)?
83 if( !C->matcher()->idealreg2regmask[ireg]->overlap( *o_mask) && o_mask->is_UP() )
84 // Here we assume a trip through memory is required.
85 w_i_mask = &C->FIRST_STACK_mask();
86 }
87 return new (C) MachSpillCopyNode( def, *w_i_mask, *w_o_mask );
88 }
89
90 //------------------------------insert_proj------------------------------------
91 // Insert the spill at chosen location. Skip over any interveneing Proj's or
92 // Phis. Skip over a CatchNode and projs, inserting in the fall-through block
93 // instead. Update high-pressure indices. Create a new live range.
94 void PhaseChaitin::insert_proj( Block *b, uint i, Node *spill, uint maxlrg ) {
95 // Skip intervening ProjNodes. Do not insert between a ProjNode and
96 // its definer.
97 while( i < b->_nodes.size() &&
98 (b->_nodes[i]->is_Proj() ||
99 b->_nodes[i]->is_Phi() ||
100 (b->_nodes[i]->is_Mach() &&
101 b->_nodes[i]->as_Mach()->ideal_Opcode() == Op_CreateEx)) )
102 i++;
103
104 // Do not insert between a call and his Catch
105 if( b->_nodes[i]->is_Catch() ) {
106 // Put the instruction at the top of the fall-thru block.
107 // Find the fall-thru projection
108 while( 1 ) {
109 const CatchProjNode *cp = b->_nodes[++i]->as_CatchProj();
110 if( cp->_con == CatchProjNode::fall_through_index )
111 break;
112 }
113 int sidx = i - b->end_idx()-1;
114 b = b->_succs[sidx]; // Switch to successor block
115 i = 1; // Right at start of block
116 }
117
118 b->_nodes.insert(i,spill); // Insert node in block
119 _cfg._bbs.map(spill->_idx,b); // Update node->block mapping to reflect
120 // Adjust the point where we go hi-pressure
121 if( i <= b->_ihrp_index ) b->_ihrp_index++;
|
79 w_o_mask = o_mask; // Must target desired registers
80 // Does the ideal-reg-mask overlap with o_mask? I.e., can I use
81 // a reg-reg move or do I need a trip across register classes
82 // (and thus through memory)?
83 if( !C->matcher()->idealreg2regmask[ireg]->overlap( *o_mask) && o_mask->is_UP() )
84 // Here we assume a trip through memory is required.
85 w_i_mask = &C->FIRST_STACK_mask();
86 }
87 return new (C) MachSpillCopyNode( def, *w_i_mask, *w_o_mask );
88 }
89
90 //------------------------------insert_proj------------------------------------
91 // Insert the spill at chosen location. Skip over any interveneing Proj's or
92 // Phis. Skip over a CatchNode and projs, inserting in the fall-through block
93 // instead. Update high-pressure indices. Create a new live range.
94 void PhaseChaitin::insert_proj( Block *b, uint i, Node *spill, uint maxlrg ) {
95 // Skip intervening ProjNodes. Do not insert between a ProjNode and
96 // its definer.
97 while( i < b->_nodes.size() &&
98 (b->_nodes[i]->is_Proj() ||
99 b->_nodes[i]->is_Phi() ) )
100 i++;
101
102 // Do not insert between a call and his Catch
103 if( b->_nodes[i]->is_Catch() ) {
104 // Put the instruction at the top of the fall-thru block.
105 // Find the fall-thru projection
106 while( 1 ) {
107 const CatchProjNode *cp = b->_nodes[++i]->as_CatchProj();
108 if( cp->_con == CatchProjNode::fall_through_index )
109 break;
110 }
111 int sidx = i - b->end_idx()-1;
112 b = b->_succs[sidx]; // Switch to successor block
113 i = 1; // Right at start of block
114 }
115
116 b->_nodes.insert(i,spill); // Insert node in block
117 _cfg._bbs.map(spill->_idx,b); // Update node->block mapping to reflect
118 // Adjust the point where we go hi-pressure
119 if( i <= b->_ihrp_index ) b->_ihrp_index++;
|