< prev index next >

src/share/vm/adlc/formssel.cpp

Print this page




 376   return false;
 377 }
 378 
 379 // Return 'true' if this instruction matches an ideal 'Halt' node
 380 bool InstructForm::is_ideal_halt() const {
 381   int  index   = 0;
 382   return _matrule && _matrule->find_type("Halt",index);
 383 }
 384 
 385 // Return 'true' if this instruction matches an ideal 'SafePoint' node
 386 bool InstructForm::is_ideal_safepoint() const {
 387   int  index   = 0;
 388   return _matrule && _matrule->find_type("SafePoint",index);
 389 }
 390 
 391 // Return 'true' if this instruction matches an ideal 'Nop' node
 392 bool InstructForm::is_ideal_nop() const {
 393   return _ident && _ident[0] == 'N' && _ident[1] == 'o' && _ident[2] == 'p' && _ident[3] == '_';
 394 }
 395 





 396 bool InstructForm::is_ideal_control() const {
 397   if ( ! _matrule)  return false;
 398 
 399   return is_ideal_return() || is_ideal_branch() || _matrule->is_ideal_jump() || is_ideal_halt();
 400 }
 401 
 402 // Return 'true' if this instruction matches an ideal 'Call' node
 403 Form::CallType InstructForm::is_ideal_call() const {
 404   if( _matrule == NULL ) return Form::invalid_type;
 405 
 406   // Check MatchRule to see if the first entry is the ideal "Call" node
 407   int  idx   = 0;
 408   if(_matrule->find_type("CallStaticJava",idx))   return Form::JAVA_STATIC;
 409   idx = 0;
 410   if(_matrule->find_type("Lock",idx))             return Form::JAVA_STATIC;
 411   idx = 0;
 412   if(_matrule->find_type("Unlock",idx))           return Form::JAVA_STATIC;
 413   idx = 0;
 414   if(_matrule->find_type("CallDynamicJava",idx))  return Form::JAVA_DYNAMIC;
 415   idx = 0;


1145   else if (is_ideal_return()) {
1146     return "MachReturnNode";
1147   }
1148   else if (is_ideal_halt()) {
1149     return "MachHaltNode";
1150   }
1151   else if (is_ideal_safepoint()) {
1152     return "MachSafePointNode";
1153   }
1154   else if (is_ideal_if()) {
1155     return "MachIfNode";
1156   }
1157   else if (is_ideal_goto()) {
1158     return "MachGotoNode";
1159   }
1160   else if (is_ideal_fastlock()) {
1161     return "MachFastLockNode";
1162   }
1163   else if (is_ideal_nop()) {
1164     return "MachNopNode";



1165   }
1166   else if (is_mach_constant()) {
1167     return "MachConstantNode";
1168   }
1169   else if (captures_bottom_type(globals)) {
1170     return "MachTypeNode";
1171   } else {
1172     return "MachNode";
1173   }
1174   assert( false, "ShouldNotReachHere()");
1175   return NULL;
1176 }
1177 
1178 // Compare the instruction predicates for textual equality
1179 bool equivalent_predicates( const InstructForm *instr1, const InstructForm *instr2 ) {
1180   const Predicate *pred1  = instr1->_predicate;
1181   const Predicate *pred2  = instr2->_predicate;
1182   if( pred1 == NULL && pred2 == NULL ) {
1183     // no predicates means they are identical
1184     return true;




 376   return false;
 377 }
 378 
 379 // Return 'true' if this instruction matches an ideal 'Halt' node
 380 bool InstructForm::is_ideal_halt() const {
 381   int  index   = 0;
 382   return _matrule && _matrule->find_type("Halt",index);
 383 }
 384 
 385 // Return 'true' if this instruction matches an ideal 'SafePoint' node
 386 bool InstructForm::is_ideal_safepoint() const {
 387   int  index   = 0;
 388   return _matrule && _matrule->find_type("SafePoint",index);
 389 }
 390 
 391 // Return 'true' if this instruction matches an ideal 'Nop' node
 392 bool InstructForm::is_ideal_nop() const {
 393   return _ident && _ident[0] == 'N' && _ident[1] == 'o' && _ident[2] == 'p' && _ident[3] == '_';
 394 }
 395 
 396 // Return 'true' if this instruction matches an ideal 'Msk' node
 397 bool InstructForm::is_ideal_msk() const {
 398   return _ident && _ident[0] == 'M' && _ident[1] == 's' && _ident[2] == 'k' && _ident[3] == '_' ;
 399 }
 400 
 401 bool InstructForm::is_ideal_control() const {
 402   if ( ! _matrule)  return false;
 403 
 404   return is_ideal_return() || is_ideal_branch() || _matrule->is_ideal_jump() || is_ideal_halt();
 405 }
 406 
 407 // Return 'true' if this instruction matches an ideal 'Call' node
 408 Form::CallType InstructForm::is_ideal_call() const {
 409   if( _matrule == NULL ) return Form::invalid_type;
 410 
 411   // Check MatchRule to see if the first entry is the ideal "Call" node
 412   int  idx   = 0;
 413   if(_matrule->find_type("CallStaticJava",idx))   return Form::JAVA_STATIC;
 414   idx = 0;
 415   if(_matrule->find_type("Lock",idx))             return Form::JAVA_STATIC;
 416   idx = 0;
 417   if(_matrule->find_type("Unlock",idx))           return Form::JAVA_STATIC;
 418   idx = 0;
 419   if(_matrule->find_type("CallDynamicJava",idx))  return Form::JAVA_DYNAMIC;
 420   idx = 0;


1150   else if (is_ideal_return()) {
1151     return "MachReturnNode";
1152   }
1153   else if (is_ideal_halt()) {
1154     return "MachHaltNode";
1155   }
1156   else if (is_ideal_safepoint()) {
1157     return "MachSafePointNode";
1158   }
1159   else if (is_ideal_if()) {
1160     return "MachIfNode";
1161   }
1162   else if (is_ideal_goto()) {
1163     return "MachGotoNode";
1164   }
1165   else if (is_ideal_fastlock()) {
1166     return "MachFastLockNode";
1167   }
1168   else if (is_ideal_nop()) {
1169     return "MachNopNode";
1170   }
1171   else if (is_ideal_msk()) {
1172     return "MachMskNode";
1173   }
1174   else if (is_mach_constant()) {
1175     return "MachConstantNode";
1176   }
1177   else if (captures_bottom_type(globals)) {
1178     return "MachTypeNode";
1179   } else {
1180     return "MachNode";
1181   }
1182   assert( false, "ShouldNotReachHere()");
1183   return NULL;
1184 }
1185 
1186 // Compare the instruction predicates for textual equality
1187 bool equivalent_predicates( const InstructForm *instr1, const InstructForm *instr2 ) {
1188   const Predicate *pred1  = instr1->_predicate;
1189   const Predicate *pred2  = instr2->_predicate;
1190   if( pred1 == NULL && pred2 == NULL ) {
1191     // no predicates means they are identical
1192     return true;


< prev index next >