Mercurial > hg > graal-compiler
comparison graal/com.oracle.max.cri/src/com/sun/cri/ci/CiAddress.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) 2010, 2011, Oracle and/or its affiliates. All rights reserved. | 2 * Copyright (c) 2010, 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. |
26 * Represents an address in target machine memory, specified via some combination of a base register, an index register, | 26 * Represents an address in target machine memory, specified via some combination of a base register, an index register, |
27 * a displacement and a scale. Note that the base and index registers may be {@link CiVariable variable}, that is as yet | 27 * a displacement and a scale. Note that the base and index registers may be {@link CiVariable variable}, that is as yet |
28 * unassigned to target machine registers. | 28 * unassigned to target machine registers. |
29 */ | 29 */ |
30 public final class CiAddress extends CiValue { | 30 public final class CiAddress extends CiValue { |
31 | |
32 /** | |
33 * | |
34 */ | |
35 private static final long serialVersionUID = -1003772042519945089L; | 31 private static final long serialVersionUID = -1003772042519945089L; |
36 | 32 |
37 /** | 33 /** |
38 * A sentinel value used as a place holder in an instruction stream for an address that will be patched. | 34 * A sentinel value used as a place holder in an instruction stream for an address that will be patched. |
39 */ | 35 */ |
251 } | 247 } |
252 return false; | 248 return false; |
253 } | 249 } |
254 | 250 |
255 @Override | 251 @Override |
256 public boolean equalsIgnoringKind(CiValue o) { | |
257 if (o instanceof CiAddress) { | |
258 CiAddress addr = (CiAddress) o; | |
259 return displacement == addr.displacement && base.equalsIgnoringKind(addr.base) && scale == addr.scale && index.equalsIgnoringKind(addr.index); | |
260 } | |
261 return false; | |
262 } | |
263 | |
264 @Override | |
265 public int hashCode() { | 252 public int hashCode() { |
266 return (base.hashCode() << 4) | kind.ordinal(); | 253 return (base.hashCode() << 4) | kind.ordinal(); |
267 } | 254 } |
268 } | 255 } |