comparison graal/com.oracle.max.cri/src/com/sun/cri/ci/CiRegisterValue.java @ 4182:de7b3e7ae528

Simplify CiValue
author Christian Wimmer <Christian.Wimmer@Oracle.com>
date Mon, 02 Jan 2012 14:38:17 -0800
parents f5328dda9714
children 9e0c1b4cfef5
comparison
equal deleted inserted replaced
4181:319860ae697a 4182:de7b3e7ae528
1 /* 1 /*
2 * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved. 2 * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 * 4 *
5 * This code is free software; you can redistribute it and/or modify it 5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as 6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
47 public int hashCode() { 47 public int hashCode() {
48 return (reg.number << 4) ^ kind.ordinal(); 48 return (reg.number << 4) ^ kind.ordinal();
49 } 49 }
50 50
51 @Override 51 @Override
52 public boolean equals(Object o) {
53 return o == this;
54 }
55
56 @Override
57 public boolean equalsIgnoringKind(CiValue other) {
58 if (other instanceof CiRegisterValue) {
59 return ((CiRegisterValue) other).reg == reg;
60 }
61 return false;
62 }
63
64 @Override
65 public String toString() { 52 public String toString() {
66 return reg.name + kindSuffix(); 53 return reg.name + kindSuffix();
67 } 54 }
68 55
69 @Override 56 @Override