src/share/vm/adlc/formssel.cpp

Print this page
rev 2892 : 7121140: Allocation paths require explicit memory synchronization operations for RMO systems
Summary: adds store store barrier after initialization of header and body of objects.
Reviewed-by:


 610           // Stack slots are unaliased memory handled by allocator
 611           oper = oper;  // debug stopping point !!!!!
 612         } else {
 613           DEF_of_memory = true;
 614         }
 615       }
 616     }
 617   }
 618   return (USE_of_memory && !DEF_of_memory);
 619 }
 620 
 621 
 622 bool InstructForm::is_wide_memory_kill(FormDict &globals) const {
 623   if( _matrule == NULL ) return false;
 624   if( !_matrule->_opType ) return false;
 625 
 626   if( strcmp(_matrule->_opType,"MemBarRelease") == 0 ) return true;
 627   if( strcmp(_matrule->_opType,"MemBarAcquire") == 0 ) return true;
 628   if( strcmp(_matrule->_opType,"MemBarReleaseLock") == 0 ) return true;
 629   if( strcmp(_matrule->_opType,"MemBarAcquireLock") == 0 ) return true;

 630 
 631   return false;
 632 }
 633 
 634 int InstructForm::memory_operand(FormDict &globals) const {
 635   // Machine independent loads must be checked for anti-dependences
 636   // Check if instruction has a USE of a memory operand class, or a def.
 637   int USE_of_memory  = 0;
 638   int DEF_of_memory  = 0;
 639   const char*    last_memory_DEF = NULL; // to test DEF/USE pairing in asserts
 640   Component     *unique          = NULL;
 641   Component     *comp            = NULL;
 642   ComponentList &components      = (ComponentList &)_components;
 643 
 644   components.reset();
 645   while( (comp = components.iter()) != NULL ) {
 646     const Form  *form = globals[comp->_type];
 647     if( !form ) continue;
 648     OpClassForm *op   = form->is_opclass();
 649     if( !op ) continue;


3961   return
3962     !strcmp(_opType,"If"            ) ||
3963     !strcmp(_opType,"CountedLoopEnd");
3964 }
3965 
3966 bool MatchRule::is_ideal_fastlock() const {
3967   if ( _opType && (strcmp(_opType,"Set") == 0) && _rChild ) {
3968     return (strcmp(_rChild->_opType,"FastLock") == 0);
3969   }
3970   return false;
3971 }
3972 
3973 bool MatchRule::is_ideal_membar() const {
3974   if( !_opType ) return false;
3975   return
3976     !strcmp(_opType,"MemBarAcquire"  ) ||
3977     !strcmp(_opType,"MemBarRelease"  ) ||
3978     !strcmp(_opType,"MemBarAcquireLock") ||
3979     !strcmp(_opType,"MemBarReleaseLock") ||
3980     !strcmp(_opType,"MemBarVolatile" ) ||
3981     !strcmp(_opType,"MemBarCPUOrder" ) ;

3982 }
3983 
3984 bool MatchRule::is_ideal_loadPC() const {
3985   if ( _opType && (strcmp(_opType,"Set") == 0) && _rChild ) {
3986     return (strcmp(_rChild->_opType,"LoadPC") == 0);
3987   }
3988   return false;
3989 }
3990 
3991 bool MatchRule::is_ideal_box() const {
3992   if ( _opType && (strcmp(_opType,"Set") == 0) && _rChild ) {
3993     return (strcmp(_rChild->_opType,"Box") == 0);
3994   }
3995   return false;
3996 }
3997 
3998 bool MatchRule::is_ideal_goto() const {
3999   bool   ideal_goto = false;
4000 
4001   if( _opType && (strcmp(_opType,"Goto") == 0) ) {




 610           // Stack slots are unaliased memory handled by allocator
 611           oper = oper;  // debug stopping point !!!!!
 612         } else {
 613           DEF_of_memory = true;
 614         }
 615       }
 616     }
 617   }
 618   return (USE_of_memory && !DEF_of_memory);
 619 }
 620 
 621 
 622 bool InstructForm::is_wide_memory_kill(FormDict &globals) const {
 623   if( _matrule == NULL ) return false;
 624   if( !_matrule->_opType ) return false;
 625 
 626   if( strcmp(_matrule->_opType,"MemBarRelease") == 0 ) return true;
 627   if( strcmp(_matrule->_opType,"MemBarAcquire") == 0 ) return true;
 628   if( strcmp(_matrule->_opType,"MemBarReleaseLock") == 0 ) return true;
 629   if( strcmp(_matrule->_opType,"MemBarAcquireLock") == 0 ) return true;
 630   if( strcmp(_matrule->_opType,"MemBarStoreStore") == 0 ) return true;
 631 
 632   return false;
 633 }
 634 
 635 int InstructForm::memory_operand(FormDict &globals) const {
 636   // Machine independent loads must be checked for anti-dependences
 637   // Check if instruction has a USE of a memory operand class, or a def.
 638   int USE_of_memory  = 0;
 639   int DEF_of_memory  = 0;
 640   const char*    last_memory_DEF = NULL; // to test DEF/USE pairing in asserts
 641   Component     *unique          = NULL;
 642   Component     *comp            = NULL;
 643   ComponentList &components      = (ComponentList &)_components;
 644 
 645   components.reset();
 646   while( (comp = components.iter()) != NULL ) {
 647     const Form  *form = globals[comp->_type];
 648     if( !form ) continue;
 649     OpClassForm *op   = form->is_opclass();
 650     if( !op ) continue;


3962   return
3963     !strcmp(_opType,"If"            ) ||
3964     !strcmp(_opType,"CountedLoopEnd");
3965 }
3966 
3967 bool MatchRule::is_ideal_fastlock() const {
3968   if ( _opType && (strcmp(_opType,"Set") == 0) && _rChild ) {
3969     return (strcmp(_rChild->_opType,"FastLock") == 0);
3970   }
3971   return false;
3972 }
3973 
3974 bool MatchRule::is_ideal_membar() const {
3975   if( !_opType ) return false;
3976   return
3977     !strcmp(_opType,"MemBarAcquire"  ) ||
3978     !strcmp(_opType,"MemBarRelease"  ) ||
3979     !strcmp(_opType,"MemBarAcquireLock") ||
3980     !strcmp(_opType,"MemBarReleaseLock") ||
3981     !strcmp(_opType,"MemBarVolatile" ) ||
3982     !strcmp(_opType,"MemBarCPUOrder" ) ||
3983     !strcmp(_opType,"MemBarStoreStore" );
3984 }
3985 
3986 bool MatchRule::is_ideal_loadPC() const {
3987   if ( _opType && (strcmp(_opType,"Set") == 0) && _rChild ) {
3988     return (strcmp(_rChild->_opType,"LoadPC") == 0);
3989   }
3990   return false;
3991 }
3992 
3993 bool MatchRule::is_ideal_box() const {
3994   if ( _opType && (strcmp(_opType,"Set") == 0) && _rChild ) {
3995     return (strcmp(_rChild->_opType,"Box") == 0);
3996   }
3997   return false;
3998 }
3999 
4000 bool MatchRule::is_ideal_goto() const {
4001   bool   ideal_goto = false;
4002 
4003   if( _opType && (strcmp(_opType,"Goto") == 0) ) {