Mercurial > hg > graal-jvmci-8
comparison jvmci/jdk.vm.ci.code/src/jdk/vm/ci/code/Register.java @ 22688:ef7d87db544a
Remove unused reference map index.
author | Roland Schatz <roland.schatz@oracle.com> |
---|---|
date | Fri, 16 Oct 2015 11:12:34 +0200 |
parents | 1bbd4a7c274b |
children | 1d4ce2d19e52 |
comparison
equal
deleted
inserted
replaced
22687:d43f6d932ad5 | 22688:ef7d87db544a |
---|---|
79 * A platform specific register type that describes which values can be stored in a register. | 79 * A platform specific register type that describes which values can be stored in a register. |
80 */ | 80 */ |
81 public static class RegisterCategory { | 81 public static class RegisterCategory { |
82 | 82 |
83 private final String name; | 83 private final String name; |
84 | |
85 private final boolean mayContainReference; | 84 private final boolean mayContainReference; |
86 private final int referenceMapOffset; | |
87 private final int referenceMapShift; | |
88 | 85 |
89 public RegisterCategory(String name) { | 86 public RegisterCategory(String name) { |
90 this(name, true, 0, 0); | 87 this(name, true); |
91 } | 88 } |
92 | 89 |
93 public RegisterCategory(String name, boolean mayContainReference) { | 90 public RegisterCategory(String name, boolean mayContainReference) { |
94 this(name, mayContainReference, 0, 0); | |
95 } | |
96 | |
97 public RegisterCategory(String name, int referenceMapOffset) { | |
98 this(name, true, referenceMapOffset, 0); | |
99 } | |
100 | |
101 public RegisterCategory(String name, int referenceMapOffset, int referenceMapShift) { | |
102 this(name, true, referenceMapOffset, referenceMapShift); | |
103 } | |
104 | |
105 private RegisterCategory(String name, boolean mayContainReference, int referenceMapOffset, int referenceMapShift) { | |
106 this.name = name; | 91 this.name = name; |
107 this.mayContainReference = mayContainReference; | 92 this.mayContainReference = mayContainReference; |
108 this.referenceMapOffset = referenceMapOffset; | |
109 this.referenceMapShift = referenceMapShift; | |
110 } | 93 } |
111 | 94 |
112 @Override | 95 @Override |
113 public String toString() { | 96 public String toString() { |
114 return name; | 97 return name; |
121 | 104 |
122 @Override | 105 @Override |
123 public boolean equals(Object obj) { | 106 public boolean equals(Object obj) { |
124 if (obj instanceof RegisterCategory) { | 107 if (obj instanceof RegisterCategory) { |
125 RegisterCategory that = (RegisterCategory) obj; | 108 RegisterCategory that = (RegisterCategory) obj; |
126 return this.referenceMapOffset == that.referenceMapOffset && this.referenceMapShift == that.referenceMapShift && this.name.equals(that.name); | 109 return this.name.equals(that.name); |
127 } | 110 } |
128 return false; | 111 return false; |
129 } | 112 } |
130 } | 113 } |
131 | 114 |
151 /** | 134 /** |
152 * Determine whether this register needs to be part of the reference map. | 135 * Determine whether this register needs to be part of the reference map. |
153 */ | 136 */ |
154 public boolean mayContainReference() { | 137 public boolean mayContainReference() { |
155 return registerCategory.mayContainReference; | 138 return registerCategory.mayContainReference; |
156 } | |
157 | |
158 /** | |
159 * Get the start index of this register in the {@link ReferenceMap}. This method may only be | |
160 * called if {@link #mayContainReference()} is true. | |
161 */ | |
162 public int getReferenceMapIndex() { | |
163 assert mayContainReference(); | |
164 return (encoding << registerCategory.referenceMapShift) + registerCategory.referenceMapOffset; | |
165 } | 139 } |
166 | 140 |
167 /** | 141 /** |
168 * Gets this register as a {@linkplain RegisterValue value} with a specified kind. | 142 * Gets this register as a {@linkplain RegisterValue value} with a specified kind. |
169 * | 143 * |