215 }
216
217 public ValueNode getLength() {
218 return length;
219 }
220
221 public JavaKind getKind() {
222 return kind;
223 }
224
225 @Override
226 public void generate(NodeLIRBuilderTool gen) {
227 if (UseGraalStubs.getValue(graph().getOptions())) {
228 ForeignCallLinkage linkage = gen.lookupGraalStub(this);
229 if (linkage != null) {
230 Value result = gen.getLIRGeneratorTool().emitForeignCall(linkage, null, gen.operand(array1), gen.operand(array2), gen.operand(length));
231 gen.setResult(this, result);
232 return;
233 }
234 }
235
236 int constantLength = -1;
237 if (length.isConstant()) {
238 constantLength = length.asJavaConstant().asInt();
239 }
240 Value result = gen.getLIRGeneratorTool().emitArrayEquals(kind, gen.operand(array1), gen.operand(array2), gen.operand(length), constantLength, false);
241 gen.setResult(this, result);
242 }
243
244 @Override
245 public LocationIdentity getLocationIdentity() {
246 return NamedLocationIdentity.getArrayLocation(kind);
247 }
248
249 @Override
250 public MemoryNode getLastLocationAccess() {
251 return lastLocationAccess;
252 }
253
254 @Override
255 public void setLastLocationAccess(MemoryNode lla) {
256 updateUsages(ValueNodeUtil.asNode(lastLocationAccess), ValueNodeUtil.asNode(lla));
257 lastLocationAccess = lla;
258 }
259 }
|
215 }
216
217 public ValueNode getLength() {
218 return length;
219 }
220
221 public JavaKind getKind() {
222 return kind;
223 }
224
225 @Override
226 public void generate(NodeLIRBuilderTool gen) {
227 if (UseGraalStubs.getValue(graph().getOptions())) {
228 ForeignCallLinkage linkage = gen.lookupGraalStub(this);
229 if (linkage != null) {
230 Value result = gen.getLIRGeneratorTool().emitForeignCall(linkage, null, gen.operand(array1), gen.operand(array2), gen.operand(length));
231 gen.setResult(this, result);
232 return;
233 }
234 }
235 Value result = gen.getLIRGeneratorTool().emitArrayEquals(kind, gen.operand(array1), gen.operand(array2), gen.operand(length), false);
236 gen.setResult(this, result);
237 }
238
239 @Override
240 public LocationIdentity getLocationIdentity() {
241 return NamedLocationIdentity.getArrayLocation(kind);
242 }
243
244 @Override
245 public MemoryNode getLastLocationAccess() {
246 return lastLocationAccess;
247 }
248
249 @Override
250 public void setLastLocationAccess(MemoryNode lla) {
251 updateUsages(ValueNodeUtil.asNode(lastLocationAccess), ValueNodeUtil.asNode(lla));
252 lastLocationAccess = lla;
253 }
254 }
|