782 !strcmp(_matrule->_rChild->_opType,"GetAndSetN") ||
783 !strcmp(_matrule->_rChild->_opType,"RotateLeft") ||
784 !strcmp(_matrule->_rChild->_opType,"RotateRight") ||
785 #if INCLUDE_SHENANDOAHGC
786 !strcmp(_matrule->_rChild->_opType,"ShenandoahCompareAndExchangeP") ||
787 !strcmp(_matrule->_rChild->_opType,"ShenandoahCompareAndExchangeN") ||
788 #endif
789 !strcmp(_matrule->_rChild->_opType,"StrInflatedCopy") ||
790 !strcmp(_matrule->_rChild->_opType,"VectorCmpMasked")||
791 !strcmp(_matrule->_rChild->_opType,"VectorMaskGen")||
792 !strcmp(_matrule->_rChild->_opType,"CompareAndExchangeP") ||
793 !strcmp(_matrule->_rChild->_opType,"CompareAndExchangeN"))) return true;
794 else if ( is_ideal_load() == Form::idealP ) return true;
795 else if ( is_ideal_store() != Form::none ) return true;
796
797 if (needs_base_oop_edge(globals)) return true;
798
799 if (is_vector()) return true;
800 if (is_mach_constant()) return true;
801
802 return false;
803 }
804
805
806 // Access instr_cost attribute or return NULL.
807 const char* InstructForm::cost() {
808 for (Attribute* cur = _attribs; cur != NULL; cur = (Attribute*)cur->_next) {
809 if( strcmp(cur->_ident,AttributeForm::_ins_cost) == 0 ) {
810 return cur->_val;
811 }
812 }
813 return NULL;
814 }
815
816 // Return count of top-level operands.
817 uint InstructForm::num_opnds() {
818 int num_opnds = _components.num_operands();
819
820 // Need special handling for matching some ideal nodes
821 // i.e. Matching a return node
822 /*
872 // Return the register class associated with 'leaf'.
873 const char *InstructForm::out_reg_class(FormDict &globals) {
874 assert( false, "InstructForm::out_reg_class(FormDict &globals); Not Implemented");
875
876 return NULL;
877 }
878
879
880
881 // Lookup the starting position of inputs we are interested in wrt. ideal nodes
882 uint InstructForm::oper_input_base(FormDict &globals) {
883 if( !_matrule ) return 1; // Skip control for most nodes
884
885 // Need special handling for matching some ideal nodes
886 // i.e. Matching a return node
887 if( strcmp(_matrule->_opType,"Return" )==0 ||
888 strcmp(_matrule->_opType,"Rethrow" )==0 ||
889 strcmp(_matrule->_opType,"TailCall" )==0 ||
890 strcmp(_matrule->_opType,"TailJump" )==0 ||
891 strcmp(_matrule->_opType,"SafePoint" )==0 ||
892 strcmp(_matrule->_opType,"Halt" )==0 )
893 return AdlcVMDeps::Parms; // Skip the machine-state edges
894
895 if( _matrule->_rChild &&
896 ( strcmp(_matrule->_rChild->_opType,"AryEq" )==0 ||
897 strcmp(_matrule->_rChild->_opType,"StrComp" )==0 ||
898 strcmp(_matrule->_rChild->_opType,"StrEquals" )==0 ||
899 strcmp(_matrule->_rChild->_opType,"StrInflatedCopy" )==0 ||
900 strcmp(_matrule->_rChild->_opType,"StrCompressedCopy" )==0 ||
901 strcmp(_matrule->_rChild->_opType,"StrIndexOf")==0 ||
902 strcmp(_matrule->_rChild->_opType,"StrIndexOfChar")==0 ||
903 strcmp(_matrule->_rChild->_opType,"CountPositives")==0 ||
904 strcmp(_matrule->_rChild->_opType,"EncodeISOArray")==0)) {
905 // String.(compareTo/equals/indexOf) and Arrays.equals
906 // and sun.nio.cs.iso8859_1$Encoder.EncodeISOArray
907 // take 1 control and 1 memory edges.
908 // Also String.(compressedCopy/inflatedCopy).
909 return 2;
910 }
911
912 // Check for handling of 'Memory' input/edge in the ideal world.
|
782 !strcmp(_matrule->_rChild->_opType,"GetAndSetN") ||
783 !strcmp(_matrule->_rChild->_opType,"RotateLeft") ||
784 !strcmp(_matrule->_rChild->_opType,"RotateRight") ||
785 #if INCLUDE_SHENANDOAHGC
786 !strcmp(_matrule->_rChild->_opType,"ShenandoahCompareAndExchangeP") ||
787 !strcmp(_matrule->_rChild->_opType,"ShenandoahCompareAndExchangeN") ||
788 #endif
789 !strcmp(_matrule->_rChild->_opType,"StrInflatedCopy") ||
790 !strcmp(_matrule->_rChild->_opType,"VectorCmpMasked")||
791 !strcmp(_matrule->_rChild->_opType,"VectorMaskGen")||
792 !strcmp(_matrule->_rChild->_opType,"CompareAndExchangeP") ||
793 !strcmp(_matrule->_rChild->_opType,"CompareAndExchangeN"))) return true;
794 else if ( is_ideal_load() == Form::idealP ) return true;
795 else if ( is_ideal_store() != Form::none ) return true;
796
797 if (needs_base_oop_edge(globals)) return true;
798
799 if (is_vector()) return true;
800 if (is_mach_constant()) return true;
801
802 return false;
803 }
804
805
806 // Access instr_cost attribute or return NULL.
807 const char* InstructForm::cost() {
808 for (Attribute* cur = _attribs; cur != NULL; cur = (Attribute*)cur->_next) {
809 if( strcmp(cur->_ident,AttributeForm::_ins_cost) == 0 ) {
810 return cur->_val;
811 }
812 }
813 return NULL;
814 }
815
816 // Return count of top-level operands.
817 uint InstructForm::num_opnds() {
818 int num_opnds = _components.num_operands();
819
820 // Need special handling for matching some ideal nodes
821 // i.e. Matching a return node
822 /*
872 // Return the register class associated with 'leaf'.
873 const char *InstructForm::out_reg_class(FormDict &globals) {
874 assert( false, "InstructForm::out_reg_class(FormDict &globals); Not Implemented");
875
876 return NULL;
877 }
878
879
880
881 // Lookup the starting position of inputs we are interested in wrt. ideal nodes
882 uint InstructForm::oper_input_base(FormDict &globals) {
883 if( !_matrule ) return 1; // Skip control for most nodes
884
885 // Need special handling for matching some ideal nodes
886 // i.e. Matching a return node
887 if( strcmp(_matrule->_opType,"Return" )==0 ||
888 strcmp(_matrule->_opType,"Rethrow" )==0 ||
889 strcmp(_matrule->_opType,"TailCall" )==0 ||
890 strcmp(_matrule->_opType,"TailJump" )==0 ||
891 strcmp(_matrule->_opType,"SafePoint" )==0 ||
892 strcmp(_matrule->_opType,"Halt" )==0 ||
893 strcmp(_matrule->_opType,"CallLeafNoFP")==0)
894 return AdlcVMDeps::Parms; // Skip the machine-state edges
895
896 if( _matrule->_rChild &&
897 ( strcmp(_matrule->_rChild->_opType,"AryEq" )==0 ||
898 strcmp(_matrule->_rChild->_opType,"StrComp" )==0 ||
899 strcmp(_matrule->_rChild->_opType,"StrEquals" )==0 ||
900 strcmp(_matrule->_rChild->_opType,"StrInflatedCopy" )==0 ||
901 strcmp(_matrule->_rChild->_opType,"StrCompressedCopy" )==0 ||
902 strcmp(_matrule->_rChild->_opType,"StrIndexOf")==0 ||
903 strcmp(_matrule->_rChild->_opType,"StrIndexOfChar")==0 ||
904 strcmp(_matrule->_rChild->_opType,"CountPositives")==0 ||
905 strcmp(_matrule->_rChild->_opType,"EncodeISOArray")==0)) {
906 // String.(compareTo/equals/indexOf) and Arrays.equals
907 // and sun.nio.cs.iso8859_1$Encoder.EncodeISOArray
908 // take 1 control and 1 memory edges.
909 // Also String.(compressedCopy/inflatedCopy).
910 return 2;
911 }
912
913 // Check for handling of 'Memory' input/edge in the ideal world.
|