< prev index next >

src/share/vm/adlc/formssel.cpp

Print this page




 590   return rematerialize;
 591 }
 592 
 593 // loads from memory, so must check for anti-dependence
 594 bool InstructForm::needs_anti_dependence_check(FormDict &globals) const {
 595   if ( skip_antidep_check() ) return false;
 596 
 597   // Machine independent loads must be checked for anti-dependences
 598   if( is_ideal_load() != Form::none )  return true;
 599 
 600   // !!!!! !!!!! !!!!!
 601   // TEMPORARY
 602   // if( is_simple_chain_rule(globals) )  return false;
 603 
 604   // String.(compareTo/equals/indexOf) and Arrays.equals use many memorys edges,
 605   // but writes none
 606   if( _matrule && _matrule->_rChild &&
 607       ( strcmp(_matrule->_rChild->_opType,"StrComp"    )==0 ||
 608         strcmp(_matrule->_rChild->_opType,"StrEquals"  )==0 ||
 609         strcmp(_matrule->_rChild->_opType,"StrIndexOf" )==0 ||


 610         strcmp(_matrule->_rChild->_opType,"AryEq"      )==0 ))
 611     return true;
 612 
 613   // Check if instruction has a USE of a memory operand class, but no defs
 614   bool USE_of_memory  = false;
 615   bool DEF_of_memory  = false;
 616   Component     *comp = NULL;
 617   ComponentList &components = (ComponentList &)_components;
 618 
 619   components.reset();
 620   while( (comp = components.iter()) != NULL ) {
 621     const Form  *form = globals[comp->_type];
 622     if( !form ) continue;
 623     OpClassForm *op   = form->is_opclass();
 624     if( !op ) continue;
 625     if( form->interface_type(globals) == Form::memory_interface ) {
 626       if( comp->isa(Component::USE) ) USE_of_memory = true;
 627       if( comp->isa(Component::DEF) ) {
 628         OperandForm *oper = form->is_operand();
 629         if( oper && oper->is_user_name_for_sReg() ) {


 870 
 871 
 872 // Lookup the starting position of inputs we are interested in wrt. ideal nodes
 873 uint InstructForm::oper_input_base(FormDict &globals) {
 874   if( !_matrule ) return 1;     // Skip control for most nodes
 875 
 876   // Need special handling for matching some ideal nodes
 877   // i.e. Matching a return node
 878   if( strcmp(_matrule->_opType,"Return"    )==0 ||
 879       strcmp(_matrule->_opType,"Rethrow"   )==0 ||
 880       strcmp(_matrule->_opType,"TailCall"  )==0 ||
 881       strcmp(_matrule->_opType,"TailJump"  )==0 ||
 882       strcmp(_matrule->_opType,"SafePoint" )==0 ||
 883       strcmp(_matrule->_opType,"Halt"      )==0 )
 884     return AdlcVMDeps::Parms;   // Skip the machine-state edges
 885 
 886   if( _matrule->_rChild &&
 887       ( strcmp(_matrule->_rChild->_opType,"AryEq"     )==0 ||
 888         strcmp(_matrule->_rChild->_opType,"StrComp"   )==0 ||
 889         strcmp(_matrule->_rChild->_opType,"StrEquals" )==0 ||


 890         strcmp(_matrule->_rChild->_opType,"StrIndexOf")==0 ||


 891         strcmp(_matrule->_rChild->_opType,"EncodeISOArray")==0)) {
 892         // String.(compareTo/equals/indexOf) and Arrays.equals
 893         // and sun.nio.cs.iso8859_1$Encoder.EncodeISOArray
 894         // take 1 control and 1 memory edges.

 895     return 2;
 896   }
 897 
 898   // Check for handling of 'Memory' input/edge in the ideal world.
 899   // The AD file writer is shielded from knowledge of these edges.
 900   int base = 1;                 // Skip control
 901   base += _matrule->needs_ideal_memory_edge(globals);
 902 
 903   // Also skip the base-oop value for uses of derived oops.
 904   // The AD file writer is shielded from knowledge of these edges.
 905   base += needs_base_oop_edge(globals);
 906 
 907   return base;
 908 }
 909 
 910 // This function determines the order of the MachOper in _opnds[]
 911 // by writing the operand names into the _components list.
 912 //
 913 // Implementation does not modify state of internal structures
 914 void InstructForm::build_components() {




 590   return rematerialize;
 591 }
 592 
 593 // loads from memory, so must check for anti-dependence
 594 bool InstructForm::needs_anti_dependence_check(FormDict &globals) const {
 595   if ( skip_antidep_check() ) return false;
 596 
 597   // Machine independent loads must be checked for anti-dependences
 598   if( is_ideal_load() != Form::none )  return true;
 599 
 600   // !!!!! !!!!! !!!!!
 601   // TEMPORARY
 602   // if( is_simple_chain_rule(globals) )  return false;
 603 
 604   // String.(compareTo/equals/indexOf) and Arrays.equals use many memorys edges,
 605   // but writes none
 606   if( _matrule && _matrule->_rChild &&
 607       ( strcmp(_matrule->_rChild->_opType,"StrComp"    )==0 ||
 608         strcmp(_matrule->_rChild->_opType,"StrEquals"  )==0 ||
 609         strcmp(_matrule->_rChild->_opType,"StrIndexOf" )==0 ||
 610         strcmp(_matrule->_rChild->_opType,"StrIndexOfChar" )==0 ||
 611         strcmp(_matrule->_rChild->_opType,"HasNegatives" )==0 ||
 612         strcmp(_matrule->_rChild->_opType,"AryEq"      )==0 ))
 613     return true;
 614 
 615   // Check if instruction has a USE of a memory operand class, but no defs
 616   bool USE_of_memory  = false;
 617   bool DEF_of_memory  = false;
 618   Component     *comp = NULL;
 619   ComponentList &components = (ComponentList &)_components;
 620 
 621   components.reset();
 622   while( (comp = components.iter()) != NULL ) {
 623     const Form  *form = globals[comp->_type];
 624     if( !form ) continue;
 625     OpClassForm *op   = form->is_opclass();
 626     if( !op ) continue;
 627     if( form->interface_type(globals) == Form::memory_interface ) {
 628       if( comp->isa(Component::USE) ) USE_of_memory = true;
 629       if( comp->isa(Component::DEF) ) {
 630         OperandForm *oper = form->is_operand();
 631         if( oper && oper->is_user_name_for_sReg() ) {


 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.
 906   // The AD file writer is shielded from knowledge of these edges.
 907   int base = 1;                 // Skip control
 908   base += _matrule->needs_ideal_memory_edge(globals);
 909 
 910   // Also skip the base-oop value for uses of derived oops.
 911   // The AD file writer is shielded from knowledge of these edges.
 912   base += needs_base_oop_edge(globals);
 913 
 914   return base;
 915 }
 916 
 917 // This function determines the order of the MachOper in _opnds[]
 918 // by writing the operand names into the _components list.
 919 //
 920 // Implementation does not modify state of internal structures
 921 void InstructForm::build_components() {


< prev index next >