--- old/src/share/vm/adlc/archDesc.cpp 2016-07-11 22:46:07.402514321 +0900 +++ new/src/share/vm/adlc/archDesc.cpp 2016-07-11 22:46:07.266514797 +0900 @@ -150,7 +150,7 @@ _needs_clone_jvms(false) { // Initialize the opcode to MatchList table with NULLs - for( int i=0; i<_last_opcode; ++i ) { + for(uint i = 0; i < static_cast(Opcodes::_last_opcode); ++i ) { _mlistab[i] = NULL; } @@ -174,7 +174,7 @@ _short_branch_debug = false; // Initialize match rule flags - for (int i = 0; i < _last_opcode; i++) { + for (uint i = 0; i < static_cast(Opcodes::_last_opcode); i++) { _has_match_rule[i] = false; } @@ -473,7 +473,7 @@ } // Identify index position among ideal operands - intptr_t index = _last_opcode; + intptr_t index = static_cast(Opcodes::_last_opcode); const char *indexStr = getMatchListIndex(*mrule); index = (intptr_t)_idealIndex[indexStr]; if (index == 0) { @@ -482,11 +482,12 @@ } // Check that this will be placed appropriately in the DFA - if (index >= _last_opcode) { + if (index >= static_cast(Opcodes::_last_opcode)) { fprintf(stderr, "Invalid match rule %s <-- ( %s )\n", resultStr ? resultStr : " ", rootOp ? rootOp : " "); - assert(index < _last_opcode, "Matching item not in ideal graph\n"); + assert(index < static_cast(Opcodes::_last_opcode), + "Matching item not in ideal graph\n"); return; } @@ -543,7 +544,7 @@ } // Identify index position among ideal operands - intptr_t index = _last_opcode; + intptr_t index = static_cast(Opcodes::_last_opcode); const char *indexStr = node ? node->_opType : (char *) " "; index = (intptr_t)_idealIndex[indexStr]; if (index == 0) { @@ -969,12 +970,13 @@ // Import predefined base types: Set = 1, RegI, RegP, ... void ArchDesc::initBaseOpTypes() { // Create OperandForm and assign type for each opcode. - for (int i = 1; i < _last_machine_leaf; ++i) { + for (uint i = 1; i < static_cast(Opcodes::_last_machine_leaf); ++i) { char *ident = (char *)NodeClassNames[i]; constructOperand(ident, true); } // Create InstructForm and assign type for each ideal instruction. - for (int j = _last_machine_leaf+1; j < _last_opcode; ++j) { + for (uint j = static_cast(Opcodes::_last_machine_leaf) + 1; + j < static_cast(Opcodes::_last_opcode); ++j) { char *ident = (char *)NodeClassNames[j]; if (!strcmp(ident, "ConI") || !strcmp(ident, "ConP") || !strcmp(ident, "ConN") || !strcmp(ident, "ConNKlass") || @@ -1048,13 +1050,15 @@ // // Build mapping from ideal names to ideal indices - int idealIndex = 0; - for (idealIndex = 1; idealIndex < _last_machine_leaf; ++idealIndex) { + uint idealIndex = 0; + for (idealIndex = 1; + idealIndex < static_cast(Opcodes::_last_machine_leaf); + ++idealIndex) { const char *idealName = NodeClassNames[idealIndex]; _idealIndex.Insert((void*) idealName, (void*) (intptr_t) idealIndex); } - for (idealIndex = _last_machine_leaf+1; - idealIndex < _last_opcode; ++idealIndex) { + for (idealIndex = static_cast(Opcodes::_last_machine_leaf) + 1; + idealIndex < static_cast(Opcodes::_last_opcode); ++idealIndex) { const char *idealName = NodeClassNames[idealIndex]; _idealIndex.Insert((void*) idealName, (void*) (intptr_t) idealIndex); } @@ -1155,7 +1159,8 @@ fprintf(fp_cpp, "\n"); fprintf(fp_cpp, "// Mapping from machine-independent opcode to boolean\n"); fprintf(fp_cpp, "const char must_clone[] = {\n"); - for (int idealIndex = 0; idealIndex < _last_opcode; ++idealIndex) { + for (uint idealIndex = 0; + idealIndex < static_cast(Opcodes::_last_opcode); ++idealIndex) { int must_clone = 0; const char *idealName = NodeClassNames[idealIndex]; // Previously selected constants for cloning @@ -1185,7 +1190,7 @@ must_clone = 1; } fprintf(fp_cpp, " %d%s // %s: %d\n", must_clone, - (idealIndex != (_last_opcode - 1)) ? "," : " // no trailing comma", + (idealIndex != (static_cast(Opcodes::_last_opcode) - 1)) ? "," : " // no trailing comma", idealName, idealIndex); } // Finish defining table