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