< prev index next >

src/hotspot/share/adlc/formssel.cpp

Print this page




 746       // pretend it has multiple defs and uses
 747       return MANY_MEMORY_OPERANDS;
 748     }
 749     if( is_ideal_load()  != Form::none ) {
 750       fprintf(stderr, "Warning: cannot find memory opnd in instr.\n");
 751       ((InstructForm*)this)->dump();
 752       // pretend it has multiple uses and no defs
 753       return MANY_MEMORY_OPERANDS;
 754     }
 755   }
 756 
 757   return NO_MEMORY_OPERAND;
 758 }
 759 
 760 // This instruction captures the machine-independent bottom_type
 761 // Expected use is for pointer vs oop determination for LoadP
 762 bool InstructForm::captures_bottom_type(FormDict &globals) const {
 763   if (_matrule && _matrule->_rChild &&
 764       (!strcmp(_matrule->_rChild->_opType,"CastPP")       ||  // new result type
 765        !strcmp(_matrule->_rChild->_opType,"CastX2P")      ||  // new result type

 766        !strcmp(_matrule->_rChild->_opType,"DecodeN")      ||
 767        !strcmp(_matrule->_rChild->_opType,"EncodeP")      ||
 768        !strcmp(_matrule->_rChild->_opType,"DecodeNKlass") ||
 769        !strcmp(_matrule->_rChild->_opType,"EncodePKlass") ||
 770        !strcmp(_matrule->_rChild->_opType,"LoadN")        ||
 771        !strcmp(_matrule->_rChild->_opType,"LoadNKlass")   ||
 772        !strcmp(_matrule->_rChild->_opType,"CreateEx")     ||  // type of exception
 773        !strcmp(_matrule->_rChild->_opType,"CheckCastPP")  ||
 774        !strcmp(_matrule->_rChild->_opType,"GetAndSetP")   ||
 775        !strcmp(_matrule->_rChild->_opType,"GetAndSetN")   ||
 776 #if INCLUDE_ZGC
 777        !strcmp(_matrule->_rChild->_opType,"ZGetAndSetP") ||
 778        !strcmp(_matrule->_rChild->_opType,"ZCompareAndExchangeP") ||
 779        !strcmp(_matrule->_rChild->_opType,"LoadBarrierSlowReg") ||
 780 #endif
 781 #if INCLUDE_SHENANDOAHGC
 782        !strcmp(_matrule->_rChild->_opType,"ShenandoahCompareAndExchangeP") ||
 783        !strcmp(_matrule->_rChild->_opType,"ShenandoahCompareAndExchangeN") ||
 784 #endif
 785        !strcmp(_matrule->_rChild->_opType,"CompareAndExchangeP") ||
 786        !strcmp(_matrule->_rChild->_opType,"CompareAndExchangeN"))) return true;
 787   else if ( is_ideal_load() == Form::idealP )                return true;
 788   else if ( is_ideal_store() != Form::none  )                return true;
 789 
 790   if (needs_base_oop_edge(globals)) return true;
 791 
 792   if (is_vector()) return true;
 793   if (is_mach_constant()) return true;
 794 
 795   return  false;
 796 }
 797 
 798 
 799 // Access instr_cost attribute or return NULL.
 800 const char* InstructForm::cost() {
 801   for (Attribute* cur = _attribs; cur != NULL; cur = (Attribute*)cur->_next) {
 802     if( strcmp(cur->_ident,AttributeForm::_ins_cost) == 0 ) {
 803       return cur->_val;
 804     }
 805   }
 806   return NULL;
 807 }
 808 
 809 // Return count of top-level operands.
 810 uint InstructForm::num_opnds() {
 811   int  num_opnds = _components.num_operands();
 812 
 813   // Need special handling for matching some ideal nodes
 814   // i.e. Matching a return node
 815   /*


 865 // Return the register class associated with 'leaf'.
 866 const char *InstructForm::out_reg_class(FormDict &globals) {
 867   assert( false, "InstructForm::out_reg_class(FormDict &globals); Not Implemented");
 868 
 869   return NULL;
 870 }
 871 
 872 
 873 
 874 // Lookup the starting position of inputs we are interested in wrt. ideal nodes
 875 uint InstructForm::oper_input_base(FormDict &globals) {
 876   if( !_matrule ) return 1;     // Skip control for most nodes
 877 
 878   // Need special handling for matching some ideal nodes
 879   // i.e. Matching a return node
 880   if( strcmp(_matrule->_opType,"Return"    )==0 ||
 881       strcmp(_matrule->_opType,"Rethrow"   )==0 ||
 882       strcmp(_matrule->_opType,"TailCall"  )==0 ||
 883       strcmp(_matrule->_opType,"TailJump"  )==0 ||
 884       strcmp(_matrule->_opType,"SafePoint" )==0 ||
 885       strcmp(_matrule->_opType,"Halt"      )==0 )

 886     return AdlcVMDeps::Parms;   // Skip the machine-state edges
 887 
 888   if( _matrule->_rChild &&
 889       ( strcmp(_matrule->_rChild->_opType,"AryEq"     )==0 ||
 890         strcmp(_matrule->_rChild->_opType,"StrComp"   )==0 ||
 891         strcmp(_matrule->_rChild->_opType,"StrEquals" )==0 ||
 892         strcmp(_matrule->_rChild->_opType,"StrInflatedCopy"   )==0 ||
 893         strcmp(_matrule->_rChild->_opType,"StrCompressedCopy" )==0 ||
 894         strcmp(_matrule->_rChild->_opType,"StrIndexOf")==0 ||
 895         strcmp(_matrule->_rChild->_opType,"StrIndexOfChar")==0 ||
 896         strcmp(_matrule->_rChild->_opType,"HasNegatives")==0 ||
 897         strcmp(_matrule->_rChild->_opType,"EncodeISOArray")==0)) {
 898         // String.(compareTo/equals/indexOf) and Arrays.equals
 899         // and sun.nio.cs.iso8859_1$Encoder.EncodeISOArray
 900         // take 1 control and 1 memory edges.
 901         // Also String.(compressedCopy/inflatedCopy).
 902     return 2;
 903   }
 904 
 905   // Check for handling of 'Memory' input/edge in the ideal world.




 746       // pretend it has multiple defs and uses
 747       return MANY_MEMORY_OPERANDS;
 748     }
 749     if( is_ideal_load()  != Form::none ) {
 750       fprintf(stderr, "Warning: cannot find memory opnd in instr.\n");
 751       ((InstructForm*)this)->dump();
 752       // pretend it has multiple uses and no defs
 753       return MANY_MEMORY_OPERANDS;
 754     }
 755   }
 756 
 757   return NO_MEMORY_OPERAND;
 758 }
 759 
 760 // This instruction captures the machine-independent bottom_type
 761 // Expected use is for pointer vs oop determination for LoadP
 762 bool InstructForm::captures_bottom_type(FormDict &globals) const {
 763   if (_matrule && _matrule->_rChild &&
 764       (!strcmp(_matrule->_rChild->_opType,"CastPP")       ||  // new result type
 765        !strcmp(_matrule->_rChild->_opType,"CastX2P")      ||  // new result type
 766        !strcmp(_matrule->_rChild->_opType,"CastI2N")      ||  // new result type
 767        !strcmp(_matrule->_rChild->_opType,"DecodeN")      ||
 768        !strcmp(_matrule->_rChild->_opType,"EncodeP")      ||
 769        !strcmp(_matrule->_rChild->_opType,"DecodeNKlass") ||
 770        !strcmp(_matrule->_rChild->_opType,"EncodePKlass") ||
 771        !strcmp(_matrule->_rChild->_opType,"LoadN")        ||
 772        !strcmp(_matrule->_rChild->_opType,"LoadNKlass")   ||
 773        !strcmp(_matrule->_rChild->_opType,"CreateEx")     ||  // type of exception
 774        !strcmp(_matrule->_rChild->_opType,"CheckCastPP")  ||
 775        !strcmp(_matrule->_rChild->_opType,"GetAndSetP")   ||
 776        !strcmp(_matrule->_rChild->_opType,"GetAndSetN")   ||
 777 #if INCLUDE_ZGC
 778        !strcmp(_matrule->_rChild->_opType,"ZGetAndSetP") ||
 779        !strcmp(_matrule->_rChild->_opType,"ZCompareAndExchangeP") ||
 780        !strcmp(_matrule->_rChild->_opType,"LoadBarrierSlowReg") ||
 781 #endif
 782 #if INCLUDE_SHENANDOAHGC
 783        !strcmp(_matrule->_rChild->_opType,"ShenandoahCompareAndExchangeP") ||
 784        !strcmp(_matrule->_rChild->_opType,"ShenandoahCompareAndExchangeN") ||
 785 #endif
 786        !strcmp(_matrule->_rChild->_opType,"CompareAndExchangeP") ||
 787        !strcmp(_matrule->_rChild->_opType,"CompareAndExchangeN"))) return true;
 788   else if ( is_ideal_load() == Form::idealP )                return true;
 789   else if ( is_ideal_store() != Form::none  )                return true;
 790 
 791   if (needs_base_oop_edge(globals)) return true;
 792 
 793   if (is_vector()) return true;
 794   if (is_mach_constant()) return true;
 795 
 796   return false;
 797 }
 798 
 799 
 800 // Access instr_cost attribute or return NULL.
 801 const char* InstructForm::cost() {
 802   for (Attribute* cur = _attribs; cur != NULL; cur = (Attribute*)cur->_next) {
 803     if( strcmp(cur->_ident,AttributeForm::_ins_cost) == 0 ) {
 804       return cur->_val;
 805     }
 806   }
 807   return NULL;
 808 }
 809 
 810 // Return count of top-level operands.
 811 uint InstructForm::num_opnds() {
 812   int  num_opnds = _components.num_operands();
 813 
 814   // Need special handling for matching some ideal nodes
 815   // i.e. Matching a return node
 816   /*


 866 // Return the register class associated with 'leaf'.
 867 const char *InstructForm::out_reg_class(FormDict &globals) {
 868   assert( false, "InstructForm::out_reg_class(FormDict &globals); Not Implemented");
 869 
 870   return NULL;
 871 }
 872 
 873 
 874 
 875 // Lookup the starting position of inputs we are interested in wrt. ideal nodes
 876 uint InstructForm::oper_input_base(FormDict &globals) {
 877   if( !_matrule ) return 1;     // Skip control for most nodes
 878 
 879   // Need special handling for matching some ideal nodes
 880   // i.e. Matching a return node
 881   if( strcmp(_matrule->_opType,"Return"    )==0 ||
 882       strcmp(_matrule->_opType,"Rethrow"   )==0 ||
 883       strcmp(_matrule->_opType,"TailCall"  )==0 ||
 884       strcmp(_matrule->_opType,"TailJump"  )==0 ||
 885       strcmp(_matrule->_opType,"SafePoint" )==0 ||
 886       strcmp(_matrule->_opType,"Halt"      )==0 ||
 887       strcmp(_matrule->_opType,"CallLeafNoFP")==0)
 888     return AdlcVMDeps::Parms;   // Skip the machine-state edges
 889 
 890   if( _matrule->_rChild &&
 891       ( strcmp(_matrule->_rChild->_opType,"AryEq"     )==0 ||
 892         strcmp(_matrule->_rChild->_opType,"StrComp"   )==0 ||
 893         strcmp(_matrule->_rChild->_opType,"StrEquals" )==0 ||
 894         strcmp(_matrule->_rChild->_opType,"StrInflatedCopy"   )==0 ||
 895         strcmp(_matrule->_rChild->_opType,"StrCompressedCopy" )==0 ||
 896         strcmp(_matrule->_rChild->_opType,"StrIndexOf")==0 ||
 897         strcmp(_matrule->_rChild->_opType,"StrIndexOfChar")==0 ||
 898         strcmp(_matrule->_rChild->_opType,"HasNegatives")==0 ||
 899         strcmp(_matrule->_rChild->_opType,"EncodeISOArray")==0)) {
 900         // String.(compareTo/equals/indexOf) and Arrays.equals
 901         // and sun.nio.cs.iso8859_1$Encoder.EncodeISOArray
 902         // take 1 control and 1 memory edges.
 903         // Also String.(compressedCopy/inflatedCopy).
 904     return 2;
 905   }
 906 
 907   // Check for handling of 'Memory' input/edge in the ideal world.


< prev index next >