src/share/vm/adlc/formssel.cpp

Print this page
rev 7060 : 8058880: Introduce identifier TEMP_DEF for effects in adl.


1799     fprintf(fp,"%s(", encoding->name() );
1800 
1801     // Output its parameter list, if any
1802     bool first_param = true;
1803     encoding->reset();
1804     while (  (parameter = encoding->iter()) != 0 ) {
1805       // Output the ',' between parameters
1806       if ( ! first_param )  fprintf(fp,", ");
1807       first_param = false;
1808       // Output the parameter
1809       fprintf(fp,"%s", parameter);
1810     } // done with parameters
1811     fprintf(fp,")  ");
1812   } // done with encodings
1813 
1814   fprintf(fp,"\n");
1815 }
1816 
1817 //------------------------------Effect-----------------------------------------
1818 static int effect_lookup(const char *name) {
1819   if(!strcmp(name, "USE")) return Component::USE;
1820   if(!strcmp(name, "DEF")) return Component::DEF;
1821   if(!strcmp(name, "USE_DEF")) return Component::USE_DEF;
1822   if(!strcmp(name, "KILL")) return Component::KILL;
1823   if(!strcmp(name, "USE_KILL")) return Component::USE_KILL;
1824   if(!strcmp(name, "TEMP")) return Component::TEMP;
1825   if(!strcmp(name, "INVALID")) return Component::INVALID;
1826   if(!strcmp(name, "CALL")) return Component::CALL;
1827   assert( false,"Invalid effect name specified\n");

1828   return Component::INVALID;
1829 }
1830 
1831 const char *Component::getUsedefName() {
1832   switch (_usedef) {
1833     case Component::INVALID:  return "INVALID";  break;
1834     case Component::USE:      return "USE";      break;
1835     case Component::USE_DEF:  return "USE_DEF";  break;
1836     case Component::USE_KILL: return "USE_KILL"; break;
1837     case Component::KILL:     return "KILL";     break;
1838     case Component::TEMP:     return "TEMP";     break;

1839     case Component::DEF:      return "DEF";      break;
1840     case Component::CALL:     return "CALL";     break;
1841     default: assert(false, "unknown effect");
1842   }
1843   return "Undefined Use/Def info";
1844 }
1845 
1846 Effect::Effect(const char *name) : _name(name), _use_def(effect_lookup(name)) {
1847   _ftype = Form::EFF;
1848 }
1849 
1850 Effect::~Effect() {
1851 }
1852 
1853 // Dynamic type check
1854 Effect *Effect::is_effect() const {
1855   return (Effect*)this;
1856 }
1857 
1858 




1799     fprintf(fp,"%s(", encoding->name() );
1800 
1801     // Output its parameter list, if any
1802     bool first_param = true;
1803     encoding->reset();
1804     while (  (parameter = encoding->iter()) != 0 ) {
1805       // Output the ',' between parameters
1806       if ( ! first_param )  fprintf(fp,", ");
1807       first_param = false;
1808       // Output the parameter
1809       fprintf(fp,"%s", parameter);
1810     } // done with parameters
1811     fprintf(fp,")  ");
1812   } // done with encodings
1813 
1814   fprintf(fp,"\n");
1815 }
1816 
1817 //------------------------------Effect-----------------------------------------
1818 static int effect_lookup(const char *name) {
1819   if (!strcmp(name, "USE")) return Component::USE;
1820   if (!strcmp(name, "DEF")) return Component::DEF;
1821   if (!strcmp(name, "USE_DEF")) return Component::USE_DEF;
1822   if (!strcmp(name, "KILL")) return Component::KILL;
1823   if (!strcmp(name, "USE_KILL")) return Component::USE_KILL;
1824   if (!strcmp(name, "TEMP")) return Component::TEMP;
1825   if (!strcmp(name, "TEMP_DEF")) return Component::TEMP_DEF;
1826   if (!strcmp(name, "INVALID")) return Component::INVALID;
1827   if (!strcmp(name, "CALL")) return Component::CALL;
1828   assert(false,"Invalid effect name specified\n");
1829   return Component::INVALID;
1830 }
1831 
1832 const char *Component::getUsedefName() {
1833   switch (_usedef) {
1834     case Component::INVALID:  return "INVALID";  break;
1835     case Component::USE:      return "USE";      break;
1836     case Component::USE_DEF:  return "USE_DEF";  break;
1837     case Component::USE_KILL: return "USE_KILL"; break;
1838     case Component::KILL:     return "KILL";     break;
1839     case Component::TEMP:     return "TEMP";     break;
1840     case Component::TEMP_DEF: return "TEMP_DEF"; break;
1841     case Component::DEF:      return "DEF";      break;
1842     case Component::CALL:     return "CALL";     break;
1843     default: assert(false, "unknown effect");
1844   }
1845   return "Undefined Use/Def info";
1846 }
1847 
1848 Effect::Effect(const char *name) : _name(name), _use_def(effect_lookup(name)) {
1849   _ftype = Form::EFF;
1850 }
1851 
1852 Effect::~Effect() {
1853 }
1854 
1855 // Dynamic type check
1856 Effect *Effect::is_effect() const {
1857   return (Effect*)this;
1858 }
1859 
1860