< prev index next >

src/hotspot/share/adlc/formssel.cpp

Print this page

 829 const char *InstructForm::out_reg_class(FormDict &globals) {
 830   assert( false, "InstructForm::out_reg_class(FormDict &globals); Not Implemented");
 831 
 832   return nullptr;
 833 }
 834 
 835 
 836 
 837 // Lookup the starting position of inputs we are interested in wrt. ideal nodes
 838 uint InstructForm::oper_input_base(FormDict &globals) {
 839   if( !_matrule ) return 1;     // Skip control for most nodes
 840 
 841   // Need special handling for matching some ideal nodes
 842   // i.e. Matching a return node
 843   if( strcmp(_matrule->_opType,"Return"    )==0 ||
 844       strcmp(_matrule->_opType,"Rethrow"   )==0 ||
 845       strcmp(_matrule->_opType,"TailCall"  )==0 ||
 846       strcmp(_matrule->_opType,"TailJump"  )==0 ||
 847       strcmp(_matrule->_opType,"ForwardException")==0 ||
 848       strcmp(_matrule->_opType,"SafePoint" )==0 ||
 849       strcmp(_matrule->_opType,"Halt"      )==0 )




 850     return AdlcVMDeps::Parms;   // Skip the machine-state edges
 851 
 852   if( _matrule->_rChild &&
 853       ( strcmp(_matrule->_rChild->_opType,"AryEq"     )==0 ||
 854         strcmp(_matrule->_rChild->_opType,"VectorizedHashCode")==0 ||
 855         strcmp(_matrule->_rChild->_opType,"StrComp"   )==0 ||
 856         strcmp(_matrule->_rChild->_opType,"StrEquals" )==0 ||
 857         strcmp(_matrule->_rChild->_opType,"StrInflatedCopy"   )==0 ||
 858         strcmp(_matrule->_rChild->_opType,"StrCompressedCopy" )==0 ||
 859         strcmp(_matrule->_rChild->_opType,"StrIndexOf")==0 ||
 860         strcmp(_matrule->_rChild->_opType,"StrIndexOfChar")==0 ||
 861         strcmp(_matrule->_rChild->_opType,"CountPositives")==0 ||
 862         strcmp(_matrule->_rChild->_opType,"EncodeISOArray")==0)) {
 863         // String.(compareTo/equals/indexOf/hashCode) and Arrays.equals
 864         // and sun.nio.cs.iso8859_1$Encoder.EncodeISOArray
 865         // take 1 control and 1 memory edges.
 866         // Also String.(compressedCopy/inflatedCopy).
 867     return 2;
 868   }
 869 

3570 void MatchNode::output(FILE *fp) {
3571   if (_lChild==nullptr && _rChild==nullptr) {
3572     fprintf(fp," %s",_name);    // operand
3573   }
3574   else {
3575     fprintf(fp," (%s ",_name);  // " (opcodeName "
3576     if(_lChild) _lChild->output(fp); //               left operand
3577     if(_rChild) _rChild->output(fp); //                    right operand
3578     fprintf(fp,")");                 //                                 ")"
3579   }
3580 }
3581 
3582 void MatchNode::forms_do(FormClosure *f) {
3583   f->do_form_by_name(_name);
3584   if (_lChild) f->do_form(_lChild);
3585   if (_rChild) f->do_form(_rChild);
3586 }
3587 
3588 int MatchNode::needs_ideal_memory_edge(FormDict &globals) const {
3589   static const char *needs_ideal_memory_list[] = {
3590     "StoreI","StoreL","StoreP","StoreN","StoreNKlass","StoreD","StoreF" ,
3591     "StoreB","StoreC","Store" ,"StoreFP",
3592     "LoadI", "LoadL", "LoadP" ,"LoadN", "LoadD" ,"LoadF"  ,
3593     "LoadB" , "LoadUB", "LoadUS" ,"LoadS" ,"Load" ,
3594     "StoreVector", "LoadVector", "LoadVectorMasked", "StoreVectorMasked",
3595     "LoadVectorGather", "StoreVectorScatter", "LoadVectorGatherMasked", "StoreVectorScatterMasked",
3596     "LoadRange", "LoadKlass", "LoadNKlass", "LoadL_unaligned", "LoadD_unaligned",
3597     "CompareAndSwapB", "CompareAndSwapS", "CompareAndSwapI", "CompareAndSwapL", "CompareAndSwapP", "CompareAndSwapN",
3598     "WeakCompareAndSwapB", "WeakCompareAndSwapS", "WeakCompareAndSwapI", "WeakCompareAndSwapL", "WeakCompareAndSwapP", "WeakCompareAndSwapN",
3599     "CompareAndExchangeB", "CompareAndExchangeS", "CompareAndExchangeI", "CompareAndExchangeL", "CompareAndExchangeP", "CompareAndExchangeN",
3600     "GetAndSetB", "GetAndSetS", "GetAndAddI", "GetAndSetI", "GetAndSetP",
3601     "GetAndAddB", "GetAndAddS", "GetAndAddL", "GetAndSetL", "GetAndSetN",
3602     "ClearArray"
3603   };
3604   int cnt = sizeof(needs_ideal_memory_list)/sizeof(char*);
3605   if( strcmp(_opType,"PrefetchAllocation")==0 )
3606     return 1;
3607   if( strcmp(_opType,"CacheWB")==0 )
3608     return 1;
3609   if( strcmp(_opType,"CacheWBPreSync")==0 )
3610     return 1;

 829 const char *InstructForm::out_reg_class(FormDict &globals) {
 830   assert( false, "InstructForm::out_reg_class(FormDict &globals); Not Implemented");
 831 
 832   return nullptr;
 833 }
 834 
 835 
 836 
 837 // Lookup the starting position of inputs we are interested in wrt. ideal nodes
 838 uint InstructForm::oper_input_base(FormDict &globals) {
 839   if( !_matrule ) return 1;     // Skip control for most nodes
 840 
 841   // Need special handling for matching some ideal nodes
 842   // i.e. Matching a return node
 843   if( strcmp(_matrule->_opType,"Return"    )==0 ||
 844       strcmp(_matrule->_opType,"Rethrow"   )==0 ||
 845       strcmp(_matrule->_opType,"TailCall"  )==0 ||
 846       strcmp(_matrule->_opType,"TailJump"  )==0 ||
 847       strcmp(_matrule->_opType,"ForwardException")==0 ||
 848       strcmp(_matrule->_opType,"SafePoint" )==0 ||
 849       strcmp(_matrule->_opType,"Halt"      )==0 ||
 850       // This is required because PhaseMacroExpand::expand_mh_intrinsic_return() uses
 851       // a special version of CallLeafNoFP that takes the target of the call as first
 852       // argument
 853       strcmp(_matrule->_opType,"CallLeafNoFP")==0)
 854     return AdlcVMDeps::Parms;   // Skip the machine-state edges
 855 
 856   if( _matrule->_rChild &&
 857       ( strcmp(_matrule->_rChild->_opType,"AryEq"     )==0 ||
 858         strcmp(_matrule->_rChild->_opType,"VectorizedHashCode")==0 ||
 859         strcmp(_matrule->_rChild->_opType,"StrComp"   )==0 ||
 860         strcmp(_matrule->_rChild->_opType,"StrEquals" )==0 ||
 861         strcmp(_matrule->_rChild->_opType,"StrInflatedCopy"   )==0 ||
 862         strcmp(_matrule->_rChild->_opType,"StrCompressedCopy" )==0 ||
 863         strcmp(_matrule->_rChild->_opType,"StrIndexOf")==0 ||
 864         strcmp(_matrule->_rChild->_opType,"StrIndexOfChar")==0 ||
 865         strcmp(_matrule->_rChild->_opType,"CountPositives")==0 ||
 866         strcmp(_matrule->_rChild->_opType,"EncodeISOArray")==0)) {
 867         // String.(compareTo/equals/indexOf/hashCode) and Arrays.equals
 868         // and sun.nio.cs.iso8859_1$Encoder.EncodeISOArray
 869         // take 1 control and 1 memory edges.
 870         // Also String.(compressedCopy/inflatedCopy).
 871     return 2;
 872   }
 873 

3574 void MatchNode::output(FILE *fp) {
3575   if (_lChild==nullptr && _rChild==nullptr) {
3576     fprintf(fp," %s",_name);    // operand
3577   }
3578   else {
3579     fprintf(fp," (%s ",_name);  // " (opcodeName "
3580     if(_lChild) _lChild->output(fp); //               left operand
3581     if(_rChild) _rChild->output(fp); //                    right operand
3582     fprintf(fp,")");                 //                                 ")"
3583   }
3584 }
3585 
3586 void MatchNode::forms_do(FormClosure *f) {
3587   f->do_form_by_name(_name);
3588   if (_lChild) f->do_form(_lChild);
3589   if (_rChild) f->do_form(_rChild);
3590 }
3591 
3592 int MatchNode::needs_ideal_memory_edge(FormDict &globals) const {
3593   static const char *needs_ideal_memory_list[] = {
3594     "StoreI","StoreL","StoreLSpecial","StoreP","StoreN","StoreNKlass","StoreD","StoreF" ,
3595     "StoreB","StoreC","Store" ,"StoreFP",
3596     "LoadI", "LoadL", "LoadP" ,"LoadN", "LoadD" ,"LoadF"  ,
3597     "LoadB" , "LoadUB", "LoadUS" ,"LoadS" ,"Load" ,
3598     "StoreVector", "LoadVector", "LoadVectorMasked", "StoreVectorMasked",
3599     "LoadVectorGather", "StoreVectorScatter", "LoadVectorGatherMasked", "StoreVectorScatterMasked",
3600     "LoadRange", "LoadKlass", "LoadNKlass", "LoadL_unaligned", "LoadD_unaligned",
3601     "CompareAndSwapB", "CompareAndSwapS", "CompareAndSwapI", "CompareAndSwapL", "CompareAndSwapP", "CompareAndSwapN",
3602     "WeakCompareAndSwapB", "WeakCompareAndSwapS", "WeakCompareAndSwapI", "WeakCompareAndSwapL", "WeakCompareAndSwapP", "WeakCompareAndSwapN",
3603     "CompareAndExchangeB", "CompareAndExchangeS", "CompareAndExchangeI", "CompareAndExchangeL", "CompareAndExchangeP", "CompareAndExchangeN",
3604     "GetAndSetB", "GetAndSetS", "GetAndAddI", "GetAndSetI", "GetAndSetP",
3605     "GetAndAddB", "GetAndAddS", "GetAndAddL", "GetAndSetL", "GetAndSetN",
3606     "ClearArray"
3607   };
3608   int cnt = sizeof(needs_ideal_memory_list)/sizeof(char*);
3609   if( strcmp(_opType,"PrefetchAllocation")==0 )
3610     return 1;
3611   if( strcmp(_opType,"CacheWB")==0 )
3612     return 1;
3613   if( strcmp(_opType,"CacheWBPreSync")==0 )
3614     return 1;
< prev index next >