1.1 --- a/src/share/vm/opto/machnode.cpp Thu Nov 21 18:29:34 2013 -0800 1.2 +++ b/src/share/vm/opto/machnode.cpp Thu Nov 21 19:00:57 2013 -0800 1.3 @@ -397,6 +397,17 @@ 1.4 return skipped; 1.5 } 1.6 1.7 +int MachNode::operand_index(const MachOper *oper) const { 1.8 + uint skipped = oper_input_base(); // Sum of leaves skipped so far 1.9 + uint opcnt; 1.10 + for (opcnt = 1; opcnt < num_opnds(); opcnt++) { 1.11 + if (_opnds[opcnt] == oper) break; 1.12 + uint num_edges = _opnds[opcnt]->num_edges(); // leaves for operand 1.13 + skipped += num_edges; 1.14 + } 1.15 + if (_opnds[opcnt] != oper) return -1; 1.16 + return skipped; 1.17 +} 1.18 1.19 //------------------------------peephole--------------------------------------- 1.20 // Apply peephole rule(s) to this instruction