--- old/src/share/vm/opto/node.cpp 2016-07-11 22:46:46.487377478 +0900 +++ new/src/share/vm/opto/node.cpp 2016-07-11 22:46:46.349377961 +0900 @@ -43,9 +43,6 @@ class PhaseTransform; class PhaseGVN; -// Arena we are currently building Nodes in -const uint Node::NotAMachineReg = 0xffff0000; - #ifndef PRODUCT extern int nodes_created; #endif @@ -699,7 +696,7 @@ //------------------------------is_dead---------------------------------------- bool Node::is_dead() const { // Mach and pinch point nodes may look like dead. - if( is_top() || is_Mach() || (Opcode() == Op_Node && _outcnt > 0) ) + if( is_top() || is_Mach() || (Opcode() == Opcodes::Op_Node && _outcnt > 0) ) return false; for( uint i = 0; i < _max; i++ ) if( _in[i] != NULL ) @@ -906,7 +903,7 @@ } // Find out of current node that matches opcode. -Node* Node::find_out_with(int opcode) { +Node* Node::find_out_with(Opcodes opcode) { for (DUIterator_Fast imax, i = fast_outs(imax); i < imax; i++) { Node* use = fast_out(i); if (use->Opcode() == opcode) { @@ -917,14 +914,14 @@ } // Return true if the current node has an out that matches opcode. -bool Node::has_out_with(int opcode) { +bool Node::has_out_with(Opcodes opcode) { return (find_out_with(opcode) != NULL); } // Return true if the current node has an out that matches any of the opcodes. -bool Node::has_out_with(int opcode1, int opcode2, int opcode3, int opcode4) { +bool Node::has_out_with(Opcodes opcode1, Opcodes opcode2, Opcodes opcode3, Opcodes opcode4) { for (DUIterator_Fast imax, i = fast_outs(imax); i < imax; i++) { - int opcode = fast_out(i)->Opcode(); + Opcodes opcode = fast_out(i)->Opcode(); if (opcode == opcode1 || opcode == opcode2 || opcode == opcode3 || opcode == opcode4) { return true; } @@ -999,7 +996,7 @@ uint Node::size_of() const { return sizeof(*this); } //------------------------------ideal_reg-------------------------------------- -uint Node::ideal_reg() const { return 0; } +Opcodes Node::ideal_reg() const { return Opcodes::Op_Node; } //------------------------------jvms------------------------------------------- JVMState* Node::jvms() const { return NULL; } @@ -1132,17 +1129,17 @@ bool Node::has_special_unique_user() const { assert(outcnt() == 1, "match only for unique out"); Node* n = unique_out(); - int op = Opcode(); + Opcodes op = Opcode(); if (this->is_Store()) { // Condition for back-to-back stores folding. return n->Opcode() == op && n->in(MemNode::Memory) == this; } else if (this->is_Load()) { // Condition for removing an unused LoadNode from the MemBarAcquire precedence input - return n->Opcode() == Op_MemBarAcquire; - } else if (op == Op_AddL) { + return n->Opcode() == Opcodes::Op_MemBarAcquire; + } else if (op == Opcodes::Op_AddL) { // Condition for convL2I(addL(x,y)) ==> addI(convL2I(x),convL2I(y)) - return n->Opcode() == Op_ConvL2I && n->in(1) == this; - } else if (op == Op_SubI || op == Op_SubL) { + return n->Opcode() == Opcodes::Op_ConvL2I && n->in(1) == this; + } else if (op == Opcodes::Op_SubI || op == Opcodes::Op_SubL) { // Condition for subI(x,subI(y,z)) ==> subI(addI(x,z),y) return n->Opcode() == op && n->in(2) == this; } else if (is_If() && (n->is_IfFalse() || n->is_IfTrue())) { @@ -1422,7 +1419,7 @@ uint sum = 0; for( uint i=0; i<_cnt; i++ ) // Add in all inputs sum = (sum<<1)-(uintptr_t)in(i); // Ignore embedded NULLs - return (sum>>2) + _cnt + Opcode(); + return (sum>>2) + _cnt + static_cast(Opcode()); } //------------------------------cmp-------------------------------------------- @@ -1465,13 +1462,13 @@ // Get a pointer constant from a ConstNode. // Returns the constant if it is a pointer ConstNode intptr_t Node::get_ptr() const { - assert( Opcode() == Op_ConP, "" ); + assert( Opcode() == Opcodes::Op_ConP, "" ); return ((ConPNode*)this)->type()->is_ptr()->get_con(); } // Get a narrow oop constant from a ConNNode. intptr_t Node::get_narrowcon() const { - assert( Opcode() == Op_ConN, "" ); + assert( Opcode() == Opcodes::Op_ConN, "" ); return ((ConNNode*)this)->type()->is_narrowoop()->get_con(); } @@ -1505,14 +1502,14 @@ // Get a double constant from a ConstNode. // Returns the constant if it is a double ConstNode jdouble Node::getd() const { - assert( Opcode() == Op_ConD, "" ); + assert( Opcode() == Opcodes::Op_ConD, "" ); return ((ConDNode*)this)->type()->is_double_constant()->getd(); } // Get a float constant from a ConstNode. // Returns the constant if it is a float ConstNode jfloat Node::getf() const { - assert( Opcode() == Op_ConF, "" ); + assert( Opcode() == Opcodes::Op_ConF, "" ); return ((ConFNode*)this)->type()->is_float_constant()->getf(); } @@ -1537,7 +1534,7 @@ } v->set(n->_idx); for( uint i=0; ilen(); i++ ) { - if( only_ctrl && !(n->is_Region()) && (n->Opcode() != Op_Root) && (i != TypeFunc::Control) ) continue; + if( only_ctrl && !(n->is_Region()) && (n->Opcode() != Opcodes::Op_Root) && (i != TypeFunc::Control) ) continue; find_recur(C, result, n->in(i), idx, only_ctrl, old_space, new_space ); } // Search along forward edges also: @@ -1590,7 +1587,7 @@ // -----------------------------Name------------------------------------------- extern const char *NodeClassNames[]; -const char *Node::Name() const { return NodeClassNames[Opcode()]; } +const char *Node::Name() const { return NodeClassNames[static_cast(Opcode())]; } static bool is_disconnected(const Node* n) { for (uint i = 0; i < n->req(); i++) { @@ -2273,7 +2270,7 @@ // It is possible for this operation to return false for a loop-varying // value, if it appears (by local graph inspection) to be computed by a simple conditional. bool Node::is_iteratively_computed() { - if (ideal_reg()) { // does operation have a result register? + if (ideal_reg() != Opcodes::Op_Node) { // does operation have a result register? for (uint i = 1; i < req(); i++) { Node* n = in(i); if (n != NULL && n->is_Phi()) { @@ -2291,7 +2288,7 @@ //--------------------------find_similar------------------------------ // Return a node with opcode "opc" and same inputs as "this" if one can // be found; Otherwise return NULL; -Node* Node::find_similar(int opc) { +Node* Node::find_similar(Opcodes opc) { if (req() >= 2) { Node* def = in(1); if (def && def->outcnt() >= 2) { @@ -2452,6 +2449,6 @@ const Type* TypeNode::Value(PhaseGVN* phase) const { return _type; } //------------------------------ideal_reg-------------------------------------- -uint TypeNode::ideal_reg() const { +Opcodes TypeNode::ideal_reg() const { return _type->ideal_reg(); }