src/share/vm/adlc/archDesc.cpp

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


 956 
 957 
 958 OperandForm *ArchDesc::constructOperand(const char *ident,
 959                                         bool  ideal_only) {
 960   OperandForm *opForm = new OperandForm(ident, ideal_only);
 961   _globalNames.Insert(ident, opForm);
 962   addForm(opForm);
 963 
 964   return opForm;
 965 }
 966 
 967 
 968 // Import predefined base types: Set = 1, RegI, RegP, ...
 969 void ArchDesc::initBaseOpTypes() {
 970   // Create OperandForm and assign type for each opcode.
 971   for (int i = 1; i < _last_machine_leaf; ++i) {
 972     char        *ident   = (char *)NodeClassNames[i];
 973     constructOperand(ident, true);
 974   }
 975   // Create InstructForm and assign type for each ideal instruction.
 976   for ( int j = _last_machine_leaf+1; j < _last_opcode; ++j) {
 977     char         *ident    = (char *)NodeClassNames[j];
 978     if(!strcmp(ident, "ConI") || !strcmp(ident, "ConP") ||
 979        !strcmp(ident, "ConN") || !strcmp(ident, "ConNKlass") ||
 980        !strcmp(ident, "ConF") || !strcmp(ident, "ConD") ||
 981        !strcmp(ident, "ConL") || !strcmp(ident, "Con" ) ||
 982        !strcmp(ident, "Bool") ) {
 983       constructOperand(ident, true);
 984     }
 985     else {
 986       InstructForm *insForm  = new InstructForm(ident, true);
 987       // insForm->_opcode       = nextUserOpType(ident);
 988       _globalNames.Insert(ident,insForm);
 989       addForm(insForm);
 990     }
 991   }
 992 
 993   { OperandForm *opForm;
 994   // Create operand type "Universe" for return instructions.
 995   const char *ident = "Universe";
 996   opForm = constructOperand(ident, false);
 997 
 998   // Create operand type "label" for branch targets
 999   ident = "label";
1000   opForm = constructOperand(ident, false);
1001 
1002   // !!!!! Update - when adding a new sReg/stackSlot type
1003   // Create operand types "sReg[IPFDL]" for stack slot registers
1004   opForm = constructOperand("sRegI", false);
1005   opForm->_constraint = new Constraint("ALLOC_IN_RC", "stack_slots");
1006   opForm = constructOperand("sRegP", false);
1007   opForm->_constraint = new Constraint("ALLOC_IN_RC", "stack_slots");
1008   opForm = constructOperand("sRegF", false);


1021   // USE, DEF, USE_DEF, KILL, USE_KILL
1022   {
1023     const char *ident = "USE";
1024     Effect     *eForm = new Effect(ident);
1025     _globalNames.Insert(ident, eForm);
1026     ident = "DEF";
1027     eForm = new Effect(ident);
1028     _globalNames.Insert(ident, eForm);
1029     ident = "USE_DEF";
1030     eForm = new Effect(ident);
1031     _globalNames.Insert(ident, eForm);
1032     ident = "KILL";
1033     eForm = new Effect(ident);
1034     _globalNames.Insert(ident, eForm);
1035     ident = "USE_KILL";
1036     eForm = new Effect(ident);
1037     _globalNames.Insert(ident, eForm);
1038     ident = "TEMP";
1039     eForm = new Effect(ident);
1040     _globalNames.Insert(ident, eForm);



1041     ident = "CALL";
1042     eForm = new Effect(ident);
1043     _globalNames.Insert(ident, eForm);
1044   }
1045 
1046   //
1047   // Build mapping from ideal names to ideal indices
1048   int idealIndex = 0;
1049   for (idealIndex = 1; idealIndex < _last_machine_leaf; ++idealIndex) {
1050     const char *idealName = NodeClassNames[idealIndex];
1051     _idealIndex.Insert((void*) idealName, (void*) (intptr_t) idealIndex);
1052   }
1053   for ( idealIndex = _last_machine_leaf+1;
1054         idealIndex < _last_opcode; ++idealIndex) {
1055     const char *idealName = NodeClassNames[idealIndex];
1056     _idealIndex.Insert((void*) idealName, (void*) (intptr_t) idealIndex);
1057   }
1058 
1059 }
1060 
1061 
1062 //---------------------------addSUNcopyright-------------------------------
1063 // output SUN copyright info
1064 void ArchDesc::addSunCopyright(char* legal, int size, FILE *fp) {
1065   size_t count = fwrite(legal, 1, size, fp);
1066   assert(count == (size_t) size, "copyright info truncated");
1067   fprintf(fp,"\n");
1068   fprintf(fp,"// Machine Generated File.  Do Not Edit!\n");
1069   fprintf(fp,"\n");
1070 }
1071 
1072 
1073 //---------------------------addIncludeGuardStart--------------------------




 956 
 957 
 958 OperandForm *ArchDesc::constructOperand(const char *ident,
 959                                         bool  ideal_only) {
 960   OperandForm *opForm = new OperandForm(ident, ideal_only);
 961   _globalNames.Insert(ident, opForm);
 962   addForm(opForm);
 963 
 964   return opForm;
 965 }
 966 
 967 
 968 // Import predefined base types: Set = 1, RegI, RegP, ...
 969 void ArchDesc::initBaseOpTypes() {
 970   // Create OperandForm and assign type for each opcode.
 971   for (int i = 1; i < _last_machine_leaf; ++i) {
 972     char *ident = (char *)NodeClassNames[i];
 973     constructOperand(ident, true);
 974   }
 975   // Create InstructForm and assign type for each ideal instruction.
 976   for (int j = _last_machine_leaf+1; j < _last_opcode; ++j) {
 977     char *ident = (char *)NodeClassNames[j];
 978     if (!strcmp(ident, "ConI") || !strcmp(ident, "ConP") ||
 979         !strcmp(ident, "ConN") || !strcmp(ident, "ConNKlass") ||
 980         !strcmp(ident, "ConF") || !strcmp(ident, "ConD") ||
 981         !strcmp(ident, "ConL") || !strcmp(ident, "Con" ) ||
 982         !strcmp(ident, "Bool")) {
 983       constructOperand(ident, true);
 984     } else {

 985       InstructForm *insForm = new InstructForm(ident, true);
 986       // insForm->_opcode = nextUserOpType(ident);
 987       _globalNames.Insert(ident, insForm);
 988       addForm(insForm);
 989     }
 990   }
 991 
 992   { OperandForm *opForm;
 993   // Create operand type "Universe" for return instructions.
 994   const char *ident = "Universe";
 995   opForm = constructOperand(ident, false);
 996 
 997   // Create operand type "label" for branch targets
 998   ident = "label";
 999   opForm = constructOperand(ident, false);
1000 
1001   // !!!!! Update - when adding a new sReg/stackSlot type
1002   // Create operand types "sReg[IPFDL]" for stack slot registers
1003   opForm = constructOperand("sRegI", false);
1004   opForm->_constraint = new Constraint("ALLOC_IN_RC", "stack_slots");
1005   opForm = constructOperand("sRegP", false);
1006   opForm->_constraint = new Constraint("ALLOC_IN_RC", "stack_slots");
1007   opForm = constructOperand("sRegF", false);


1020   // USE, DEF, USE_DEF, KILL, USE_KILL
1021   {
1022     const char *ident = "USE";
1023     Effect     *eForm = new Effect(ident);
1024     _globalNames.Insert(ident, eForm);
1025     ident = "DEF";
1026     eForm = new Effect(ident);
1027     _globalNames.Insert(ident, eForm);
1028     ident = "USE_DEF";
1029     eForm = new Effect(ident);
1030     _globalNames.Insert(ident, eForm);
1031     ident = "KILL";
1032     eForm = new Effect(ident);
1033     _globalNames.Insert(ident, eForm);
1034     ident = "USE_KILL";
1035     eForm = new Effect(ident);
1036     _globalNames.Insert(ident, eForm);
1037     ident = "TEMP";
1038     eForm = new Effect(ident);
1039     _globalNames.Insert(ident, eForm);
1040     ident = "TEMP_DEF";
1041     eForm = new Effect(ident);
1042     _globalNames.Insert(ident, eForm);
1043     ident = "CALL";
1044     eForm = new Effect(ident);
1045     _globalNames.Insert(ident, eForm);
1046   }
1047 
1048   //
1049   // Build mapping from ideal names to ideal indices
1050   int idealIndex = 0;
1051   for (idealIndex = 1; idealIndex < _last_machine_leaf; ++idealIndex) {
1052     const char *idealName = NodeClassNames[idealIndex];
1053     _idealIndex.Insert((void*) idealName, (void*) (intptr_t) idealIndex);
1054   }
1055   for (idealIndex = _last_machine_leaf+1;
1056        idealIndex < _last_opcode; ++idealIndex) {
1057     const char *idealName = NodeClassNames[idealIndex];
1058     _idealIndex.Insert((void*) idealName, (void*) (intptr_t) idealIndex);
1059   }
1060 
1061 }
1062 
1063 
1064 //---------------------------addSUNcopyright-------------------------------
1065 // output SUN copyright info
1066 void ArchDesc::addSunCopyright(char* legal, int size, FILE *fp) {
1067   size_t count = fwrite(legal, 1, size, fp);
1068   assert(count == (size_t) size, "copyright info truncated");
1069   fprintf(fp,"\n");
1070   fprintf(fp,"// Machine Generated File.  Do Not Edit!\n");
1071   fprintf(fp,"\n");
1072 }
1073 
1074 
1075 //---------------------------addIncludeGuardStart--------------------------