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 strcmp(_matrule->_opType,"CallLeafNoFP")==0)
851 return AdlcVMDeps::Parms; // Skip the machine-state edges
852
853 if( _matrule->_rChild &&
854 ( strcmp(_matrule->_rChild->_opType,"AryEq" )==0 ||
855 strcmp(_matrule->_rChild->_opType,"VectorizedHashCode")==0 ||
856 strcmp(_matrule->_rChild->_opType,"StrComp" )==0 ||
857 strcmp(_matrule->_rChild->_opType,"StrEquals" )==0 ||
858 strcmp(_matrule->_rChild->_opType,"StrInflatedCopy" )==0 ||
859 strcmp(_matrule->_rChild->_opType,"StrCompressedCopy" )==0 ||
860 strcmp(_matrule->_rChild->_opType,"StrIndexOf")==0 ||
861 strcmp(_matrule->_rChild->_opType,"StrIndexOfChar")==0 ||
862 strcmp(_matrule->_rChild->_opType,"CountPositives")==0 ||
863 strcmp(_matrule->_rChild->_opType,"EncodeISOArray")==0)) {
864 // String.(compareTo/equals/indexOf/hashCode) and Arrays.equals
865 // and sun.nio.cs.iso8859_1$Encoder.EncodeISOArray
866 // take 1 control and 1 memory edges.
867 // Also String.(compressedCopy/inflatedCopy).
868 return 2;
869 }
870
3571 void MatchNode::output(FILE *fp) {
3572 if (_lChild==nullptr && _rChild==nullptr) {
3573 fprintf(fp," %s",_name); // operand
3574 }
3575 else {
3576 fprintf(fp," (%s ",_name); // " (opcodeName "
3577 if(_lChild) _lChild->output(fp); // left operand
3578 if(_rChild) _rChild->output(fp); // right operand
3579 fprintf(fp,")"); // ")"
3580 }
3581 }
3582
3583 void MatchNode::forms_do(FormClosure *f) {
3584 f->do_form_by_name(_name);
3585 if (_lChild) f->do_form(_lChild);
3586 if (_rChild) f->do_form(_rChild);
3587 }
3588
3589 int MatchNode::needs_ideal_memory_edge(FormDict &globals) const {
3590 static const char *needs_ideal_memory_list[] = {
3591 "StoreI","StoreL","StoreLSpecial","StoreP","StoreN","StoreNKlass","StoreD","StoreF" ,
3592 "StoreB","StoreC","Store" ,"StoreFP",
3593 "LoadI", "LoadL", "LoadP" ,"LoadN", "LoadD" ,"LoadF" ,
3594 "LoadB" , "LoadUB", "LoadUS" ,"LoadS" ,"Load" ,
3595 "StoreVector", "LoadVector", "LoadVectorMasked", "StoreVectorMasked",
3596 "LoadVectorGather", "StoreVectorScatter", "LoadVectorGatherMasked", "StoreVectorScatterMasked",
3597 "LoadRange", "LoadKlass", "LoadNKlass", "LoadL_unaligned", "LoadD_unaligned",
3598 "CompareAndSwapB", "CompareAndSwapS", "CompareAndSwapI", "CompareAndSwapL", "CompareAndSwapP", "CompareAndSwapN",
3599 "WeakCompareAndSwapB", "WeakCompareAndSwapS", "WeakCompareAndSwapI", "WeakCompareAndSwapL", "WeakCompareAndSwapP", "WeakCompareAndSwapN",
3600 "CompareAndExchangeB", "CompareAndExchangeS", "CompareAndExchangeI", "CompareAndExchangeL", "CompareAndExchangeP", "CompareAndExchangeN",
3601 "GetAndSetB", "GetAndSetS", "GetAndAddI", "GetAndSetI", "GetAndSetP",
3602 "GetAndAddB", "GetAndAddS", "GetAndAddL", "GetAndSetL", "GetAndSetN",
3603 "ClearArray"
3604 };
3605 int cnt = sizeof(needs_ideal_memory_list)/sizeof(char*);
3606 if( strcmp(_opType,"PrefetchAllocation")==0 )
3607 return 1;
3608 if( strcmp(_opType,"CacheWB")==0 )
3609 return 1;
3610 if( strcmp(_opType,"CacheWBPreSync")==0 )
3611 return 1;
|