| 485 | // Two nodes are equal if they have the same inputs and the same "opcode" |
| 486 | // which means the same Java class, plus same internal parts. |
| 487 | @Override public final boolean equals( Object o ) { |
| 488 | if( o==this ) return true; |
| 489 | if( o.getClass() != getClass() ) return false; |
| 490 | Node n = (Node)o; |
| 491 | int len = _inputs.size(); |
| 492 | if( len != n._inputs.size() ) return false; |
| 493 | for( int i=0; i<len; i++ ) |
| 494 | if( in(i) != n.in(i) ) |
| 495 | return false; |
| 496 | return eq(n); |
| 497 | } |
| 498 | // Subclasses add extra checks (such as ConstantNodes have same constant), |
| 499 | // and can assume "this!=n" and has the same Java class. |
| 500 | boolean eq( Node n ) { return true; } |