Mercurial > hg > graal-compiler
comparison graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/RegisterSaveLayout.java @ 18342:d60dd21329f2
implemented .equals() for CompilationResult and the objects it encapsulates
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Wed, 12 Nov 2014 10:36:30 +0100 |
parents | 0e0c24424d14 |
children |
comparison
equal
deleted
inserted
replaced
18341:8169f68e9530 | 18342:d60dd21329f2 |
---|---|
26 | 26 |
27 /** | 27 /** |
28 * A map from registers to frame slots. This can be used to describe where callee saved registers | 28 * A map from registers to frame slots. This can be used to describe where callee saved registers |
29 * are saved in a callee's frame. | 29 * are saved in a callee's frame. |
30 */ | 30 */ |
31 public class RegisterSaveLayout { | 31 public final class RegisterSaveLayout { |
32 | 32 |
33 /** | 33 /** |
34 * Keys. | 34 * Keys. |
35 */ | 35 */ |
36 private final Register[] registers; | 36 private final Register[] registers; |
100 } | 100 } |
101 return result; | 101 return result; |
102 } | 102 } |
103 | 103 |
104 @Override | 104 @Override |
105 public int hashCode() { | |
106 throw new UnsupportedOperationException(); | |
107 } | |
108 | |
109 @Override | |
110 public boolean equals(Object obj) { | |
111 if (this == obj) { | |
112 return true; | |
113 } | |
114 if (obj instanceof RegisterSaveLayout) { | |
115 RegisterSaveLayout that = (RegisterSaveLayout) obj; | |
116 if (Arrays.equals(registers, that.registers) && Arrays.equals(slots, that.slots)) { | |
117 return true; | |
118 } | |
119 } | |
120 return false; | |
121 } | |
122 | |
123 @Override | |
105 public String toString() { | 124 public String toString() { |
106 return registersToSlots(true).toString(); | 125 return registersToSlots(true).toString(); |
107 } | 126 } |
108 } | 127 } |