src/share/vm/adlc/output_h.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File hotspot Sdiff src/share/vm/adlc

src/share/vm/adlc/output_h.cpp

Print this page




 194 //--------Utilities to build MachOper and MachNode derived Classes------------
 195 // ---------------------------------------------------------------------------
 196 
 197 //------------------------------Utilities to build Operand Classes------------
 198 static void in_RegMask(FILE *fp) {
 199   fprintf(fp,"  virtual const RegMask *in_RegMask(int index) const;\n");
 200 }
 201 
 202 static void declareConstStorage(FILE *fp, FormDict &globals, OperandForm *oper) {
 203   int i = 0;
 204   Component *comp;
 205 
 206   if (oper->num_consts(globals) == 0) return;
 207   // Iterate over the component list looking for constants
 208   oper->_components.reset();
 209   if ((comp = oper->_components.iter()) == NULL) {
 210     assert(oper->num_consts(globals) == 1, "Bad component list detected.\n");
 211     const char *type = oper->ideal_type(globals);
 212     if (!strcmp(type, "ConI")) {
 213       if (i > 0) fprintf(fp,", ");
 214       fprintf(fp,"  int32          _c%d;\n", i);
 215     }
 216     else if (!strcmp(type, "ConP")) {
 217       if (i > 0) fprintf(fp,", ");
 218       fprintf(fp,"  const TypePtr *_c%d;\n", i);
 219     }
 220     else if (!strcmp(type, "ConN")) {
 221       if (i > 0) fprintf(fp,", ");
 222       fprintf(fp,"  const TypeNarrowOop *_c%d;\n", i);
 223     }
 224     else if (!strcmp(type, "ConNKlass")) {
 225       if (i > 0) fprintf(fp,", ");
 226       fprintf(fp,"  const TypeNarrowKlass *_c%d;\n", i);
 227     }
 228     else if (!strcmp(type, "ConL")) {
 229       if (i > 0) fprintf(fp,", ");
 230       fprintf(fp,"  jlong          _c%d;\n", i);
 231     }
 232     else if (!strcmp(type, "ConF")) {
 233       if (i > 0) fprintf(fp,", ");
 234       fprintf(fp,"  jfloat         _c%d;\n", i);


 290 //
 291 static void defineConstructor(FILE *fp, const char *name, uint num_consts,
 292                               ComponentList &lst, bool is_ideal_bool,
 293                               Form::DataType constant_type, FormDict &globals) {
 294   fprintf(fp,"public:\n");
 295   // generate line (1)
 296   fprintf(fp,"  %sOper(", name);
 297   if( num_consts == 0 ) {
 298     fprintf(fp,") {}\n");
 299     return;
 300   }
 301 
 302   // generate parameters for constants
 303   uint i = 0;
 304   Component *comp;
 305   lst.reset();
 306   if ((comp = lst.iter()) == NULL) {
 307     assert(num_consts == 1, "Bad component list detected.\n");
 308     switch( constant_type ) {
 309     case Form::idealI : {
 310       fprintf(fp,is_ideal_bool ? "BoolTest::mask c%d" : "int32 c%d", i);
 311       break;
 312     }
 313     case Form::idealN :      { fprintf(fp,"const TypeNarrowOop *c%d", i); break; }
 314     case Form::idealNKlass : { fprintf(fp,"const TypeNarrowKlass *c%d", i); break; }
 315     case Form::idealP :      { fprintf(fp,"const TypePtr *c%d", i); break; }
 316     case Form::idealL :      { fprintf(fp,"jlong c%d", i);   break;        }
 317     case Form::idealF :      { fprintf(fp,"jfloat c%d", i);  break;        }
 318     case Form::idealD :      { fprintf(fp,"jdouble c%d", i); break;        }
 319     default:
 320       assert(!is_ideal_bool, "Non-constant operand lacks component list.");
 321       break;
 322     }
 323   } // end if NULL
 324   else {
 325     lst.reset();
 326     while((comp = lst.iter()) != NULL) {
 327       if (!strcmp(comp->base_type(globals), "ConI")) {
 328         if (i > 0) fprintf(fp,", ");
 329         fprintf(fp,"int32 c%d", i);
 330         i++;
 331       }
 332       else if (!strcmp(comp->base_type(globals), "ConP")) {
 333         if (i > 0) fprintf(fp,", ");
 334         fprintf(fp,"const TypePtr *c%d", i);
 335         i++;
 336       }
 337       else if (!strcmp(comp->base_type(globals), "ConN")) {
 338         if (i > 0) fprintf(fp,", ");
 339         fprintf(fp,"const TypePtr *c%d", i);
 340         i++;
 341       }
 342       else if (!strcmp(comp->base_type(globals), "ConNKlass")) {
 343         if (i > 0) fprintf(fp,", ");
 344         fprintf(fp,"const TypePtr *c%d", i);
 345         i++;
 346       }
 347       else if (!strcmp(comp->base_type(globals), "ConL")) {
 348         if (i > 0) fprintf(fp,", ");
 349         fprintf(fp,"jlong c%d", i);




 194 //--------Utilities to build MachOper and MachNode derived Classes------------
 195 // ---------------------------------------------------------------------------
 196 
 197 //------------------------------Utilities to build Operand Classes------------
 198 static void in_RegMask(FILE *fp) {
 199   fprintf(fp,"  virtual const RegMask *in_RegMask(int index) const;\n");
 200 }
 201 
 202 static void declareConstStorage(FILE *fp, FormDict &globals, OperandForm *oper) {
 203   int i = 0;
 204   Component *comp;
 205 
 206   if (oper->num_consts(globals) == 0) return;
 207   // Iterate over the component list looking for constants
 208   oper->_components.reset();
 209   if ((comp = oper->_components.iter()) == NULL) {
 210     assert(oper->num_consts(globals) == 1, "Bad component list detected.\n");
 211     const char *type = oper->ideal_type(globals);
 212     if (!strcmp(type, "ConI")) {
 213       if (i > 0) fprintf(fp,", ");
 214       fprintf(fp,"  int32_t        _c%d;\n", i);
 215     }
 216     else if (!strcmp(type, "ConP")) {
 217       if (i > 0) fprintf(fp,", ");
 218       fprintf(fp,"  const TypePtr *_c%d;\n", i);
 219     }
 220     else if (!strcmp(type, "ConN")) {
 221       if (i > 0) fprintf(fp,", ");
 222       fprintf(fp,"  const TypeNarrowOop *_c%d;\n", i);
 223     }
 224     else if (!strcmp(type, "ConNKlass")) {
 225       if (i > 0) fprintf(fp,", ");
 226       fprintf(fp,"  const TypeNarrowKlass *_c%d;\n", i);
 227     }
 228     else if (!strcmp(type, "ConL")) {
 229       if (i > 0) fprintf(fp,", ");
 230       fprintf(fp,"  jlong          _c%d;\n", i);
 231     }
 232     else if (!strcmp(type, "ConF")) {
 233       if (i > 0) fprintf(fp,", ");
 234       fprintf(fp,"  jfloat         _c%d;\n", i);


 290 //
 291 static void defineConstructor(FILE *fp, const char *name, uint num_consts,
 292                               ComponentList &lst, bool is_ideal_bool,
 293                               Form::DataType constant_type, FormDict &globals) {
 294   fprintf(fp,"public:\n");
 295   // generate line (1)
 296   fprintf(fp,"  %sOper(", name);
 297   if( num_consts == 0 ) {
 298     fprintf(fp,") {}\n");
 299     return;
 300   }
 301 
 302   // generate parameters for constants
 303   uint i = 0;
 304   Component *comp;
 305   lst.reset();
 306   if ((comp = lst.iter()) == NULL) {
 307     assert(num_consts == 1, "Bad component list detected.\n");
 308     switch( constant_type ) {
 309     case Form::idealI : {
 310       fprintf(fp,is_ideal_bool ? "BoolTest::mask c%d" : "int32_t c%d", i);
 311       break;
 312     }
 313     case Form::idealN :      { fprintf(fp,"const TypeNarrowOop *c%d", i); break; }
 314     case Form::idealNKlass : { fprintf(fp,"const TypeNarrowKlass *c%d", i); break; }
 315     case Form::idealP :      { fprintf(fp,"const TypePtr *c%d", i); break; }
 316     case Form::idealL :      { fprintf(fp,"jlong c%d", i);   break;        }
 317     case Form::idealF :      { fprintf(fp,"jfloat c%d", i);  break;        }
 318     case Form::idealD :      { fprintf(fp,"jdouble c%d", i); break;        }
 319     default:
 320       assert(!is_ideal_bool, "Non-constant operand lacks component list.");
 321       break;
 322     }
 323   } // end if NULL
 324   else {
 325     lst.reset();
 326     while((comp = lst.iter()) != NULL) {
 327       if (!strcmp(comp->base_type(globals), "ConI")) {
 328         if (i > 0) fprintf(fp,", ");
 329         fprintf(fp,"int32_t c%d", i);
 330         i++;
 331       }
 332       else if (!strcmp(comp->base_type(globals), "ConP")) {
 333         if (i > 0) fprintf(fp,", ");
 334         fprintf(fp,"const TypePtr *c%d", i);
 335         i++;
 336       }
 337       else if (!strcmp(comp->base_type(globals), "ConN")) {
 338         if (i > 0) fprintf(fp,", ");
 339         fprintf(fp,"const TypePtr *c%d", i);
 340         i++;
 341       }
 342       else if (!strcmp(comp->base_type(globals), "ConNKlass")) {
 343         if (i > 0) fprintf(fp,", ");
 344         fprintf(fp,"const TypePtr *c%d", i);
 345         i++;
 346       }
 347       else if (!strcmp(comp->base_type(globals), "ConL")) {
 348         if (i > 0) fprintf(fp,", ");
 349         fprintf(fp,"jlong c%d", i);


src/share/vm/adlc/output_h.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File