161 uint no = num_opnds();
162 uint sum = rule();
163 for( uint i=0; i<no; i++ )
164 sum += _opnds[i]->hash();
165 return sum+Node::hash();
166 }
167
168 //-----------------------------cmp---------------------------------------------
169 uint MachNode::cmp( const Node &node ) const {
170 MachNode& n = *((Node&)node).as_Mach();
171 uint no = num_opnds();
172 if( no != n.num_opnds() ) return 0;
173 if( rule() != n.rule() ) return 0;
174 for( uint i=0; i<no; i++ ) // All operands must match
175 if( !_opnds[i]->cmp( *n._opnds[i] ) )
176 return 0; // mis-matched operands
177 return 1; // match
178 }
179
180 // Return an equivalent instruction using memory for cisc_operand position
181 MachNode *MachNode::cisc_version(int offset, Compile* C) {
182 ShouldNotCallThis();
183 return NULL;
184 }
185
186 void MachNode::use_cisc_RegMask() {
187 ShouldNotReachHere();
188 }
189
190
191 //-----------------------------in_RegMask--------------------------------------
192 const RegMask &MachNode::in_RegMask( uint idx ) const {
193 uint numopnds = num_opnds(); // Virtual call for number of operands
194 uint skipped = oper_input_base(); // Sum of leaves skipped so far
195 if( idx < skipped ) {
196 assert( ideal_Opcode() == Op_AddP, "expected base ptr here" );
197 assert( idx == 1, "expected base ptr here" );
198 // debug info can be anywhere
199 return *Compile::current()->matcher()->idealreg2spillmask[Op_RegP];
200 }
201 uint opcnt = 1; // First operand
394 uint num_edges = _opnds[opcnt]->num_edges(); // leaves for operand
395 skipped += num_edges;
396 }
397 return skipped;
398 }
399
400 int MachNode::operand_index(const MachOper *oper) const {
401 uint skipped = oper_input_base(); // Sum of leaves skipped so far
402 uint opcnt;
403 for (opcnt = 1; opcnt < num_opnds(); opcnt++) {
404 if (_opnds[opcnt] == oper) break;
405 uint num_edges = _opnds[opcnt]->num_edges(); // leaves for operand
406 skipped += num_edges;
407 }
408 if (_opnds[opcnt] != oper) return -1;
409 return skipped;
410 }
411
412 //------------------------------peephole---------------------------------------
413 // Apply peephole rule(s) to this instruction
414 MachNode *MachNode::peephole( Block *block, int block_index, PhaseRegAlloc *ra_, int &deleted, Compile* C ) {
415 return NULL;
416 }
417
418 //------------------------------add_case_label---------------------------------
419 // Adds the label for the case
420 void MachNode::add_case_label( int index_num, Label* blockLabel) {
421 ShouldNotCallThis();
422 }
423
424 //------------------------------method_set-------------------------------------
425 // Set the absolute address of a method
426 void MachNode::method_set( intptr_t addr ) {
427 ShouldNotCallThis();
428 }
429
430 //------------------------------rematerialize----------------------------------
431 bool MachNode::rematerialize() const {
432 // Temps are always rematerializable
433 if (is_MachTemp()) return true;
434
|
161 uint no = num_opnds();
162 uint sum = rule();
163 for( uint i=0; i<no; i++ )
164 sum += _opnds[i]->hash();
165 return sum+Node::hash();
166 }
167
168 //-----------------------------cmp---------------------------------------------
169 uint MachNode::cmp( const Node &node ) const {
170 MachNode& n = *((Node&)node).as_Mach();
171 uint no = num_opnds();
172 if( no != n.num_opnds() ) return 0;
173 if( rule() != n.rule() ) return 0;
174 for( uint i=0; i<no; i++ ) // All operands must match
175 if( !_opnds[i]->cmp( *n._opnds[i] ) )
176 return 0; // mis-matched operands
177 return 1; // match
178 }
179
180 // Return an equivalent instruction using memory for cisc_operand position
181 MachNode *MachNode::cisc_version(int offset) {
182 ShouldNotCallThis();
183 return NULL;
184 }
185
186 void MachNode::use_cisc_RegMask() {
187 ShouldNotReachHere();
188 }
189
190
191 //-----------------------------in_RegMask--------------------------------------
192 const RegMask &MachNode::in_RegMask( uint idx ) const {
193 uint numopnds = num_opnds(); // Virtual call for number of operands
194 uint skipped = oper_input_base(); // Sum of leaves skipped so far
195 if( idx < skipped ) {
196 assert( ideal_Opcode() == Op_AddP, "expected base ptr here" );
197 assert( idx == 1, "expected base ptr here" );
198 // debug info can be anywhere
199 return *Compile::current()->matcher()->idealreg2spillmask[Op_RegP];
200 }
201 uint opcnt = 1; // First operand
394 uint num_edges = _opnds[opcnt]->num_edges(); // leaves for operand
395 skipped += num_edges;
396 }
397 return skipped;
398 }
399
400 int MachNode::operand_index(const MachOper *oper) const {
401 uint skipped = oper_input_base(); // Sum of leaves skipped so far
402 uint opcnt;
403 for (opcnt = 1; opcnt < num_opnds(); opcnt++) {
404 if (_opnds[opcnt] == oper) break;
405 uint num_edges = _opnds[opcnt]->num_edges(); // leaves for operand
406 skipped += num_edges;
407 }
408 if (_opnds[opcnt] != oper) return -1;
409 return skipped;
410 }
411
412 //------------------------------peephole---------------------------------------
413 // Apply peephole rule(s) to this instruction
414 MachNode *MachNode::peephole(Block *block, int block_index, PhaseRegAlloc *ra_, int &deleted) {
415 return NULL;
416 }
417
418 //------------------------------add_case_label---------------------------------
419 // Adds the label for the case
420 void MachNode::add_case_label( int index_num, Label* blockLabel) {
421 ShouldNotCallThis();
422 }
423
424 //------------------------------method_set-------------------------------------
425 // Set the absolute address of a method
426 void MachNode::method_set( intptr_t addr ) {
427 ShouldNotCallThis();
428 }
429
430 //------------------------------rematerialize----------------------------------
431 bool MachNode::rematerialize() const {
432 // Temps are always rematerializable
433 if (is_MachTemp()) return true;
434
|