| 506 | // Two nodes are equal if they have the same inputs and the same "opcode" |
| 507 | // which means the same Java class, plus same internal parts. |
| 508 | @Override public final boolean equals( Object o ) { |
| 509 | if( o==this ) return true; |
| 510 | if( o.getClass() != getClass() ) return false; |
| 511 | Node n = (Node)o; |
| 512 | int len = _inputs.size(); |
| 513 | if( len != n._inputs.size() ) return false; |
| 514 | for( int i=0; i<len; i++ ) |
| 515 | if( in(i) != n.in(i) ) |
| 516 | return false; |
| 517 | return eq(n); |
| 518 | } |
| 519 | // Subclasses add extra checks (such as ConstantNodes have same constant), |
| 520 | // and can assume "this!=n" and has the same Java class. |
| 521 | boolean eq( Node n ) { return true; } |