93 }
94
95 public JavaKind getKind2() {
96 return kind2;
97 }
98
99 public ValueNode getLength() {
100 return length;
101 }
102
103 @Override
104 public void generate(NodeLIRBuilderTool gen) {
105 if (UseGraalStubs.getValue(graph().getOptions())) {
106 ForeignCallLinkage linkage = gen.lookupGraalStub(this);
107 if (linkage != null) {
108 Value result = gen.getLIRGeneratorTool().emitForeignCall(linkage, null, gen.operand(array1), gen.operand(array2), gen.operand(length));
109 gen.setResult(this, result);
110 return;
111 }
112 }
113
114 int constantLength = -1;
115 if (length.isConstant()) {
116 constantLength = length.asJavaConstant().asInt();
117 }
118 Value result;
119 if (kind1 == kind2) {
120 result = gen.getLIRGeneratorTool().emitArrayEquals(kind1, gen.operand(array1), gen.operand(array2), gen.operand(length), constantLength, true);
121 } else {
122 result = gen.getLIRGeneratorTool().emitArrayEquals(kind1, kind2, gen.operand(array1), gen.operand(array2), gen.operand(length), constantLength, true);
123 }
124 gen.setResult(this, result);
125 }
126
127 @Override
128 public LocationIdentity getLocationIdentity() {
129 return kind1 != kind2 ? LocationIdentity.ANY_LOCATION : NamedLocationIdentity.getArrayLocation(kind1);
130 }
131
132 @Override
133 public MemoryNode getLastLocationAccess() {
134 return lastLocationAccess;
135 }
136
137 @Override
138 public void setLastLocationAccess(MemoryNode lla) {
139 updateUsages(ValueNodeUtil.asNode(lastLocationAccess), ValueNodeUtil.asNode(lla));
140 lastLocationAccess = lla;
141 }
142 }
|
93 }
94
95 public JavaKind getKind2() {
96 return kind2;
97 }
98
99 public ValueNode getLength() {
100 return length;
101 }
102
103 @Override
104 public void generate(NodeLIRBuilderTool gen) {
105 if (UseGraalStubs.getValue(graph().getOptions())) {
106 ForeignCallLinkage linkage = gen.lookupGraalStub(this);
107 if (linkage != null) {
108 Value result = gen.getLIRGeneratorTool().emitForeignCall(linkage, null, gen.operand(array1), gen.operand(array2), gen.operand(length));
109 gen.setResult(this, result);
110 return;
111 }
112 }
113 Value result;
114 if (kind1 == kind2) {
115 result = gen.getLIRGeneratorTool().emitArrayEquals(kind1, gen.operand(array1), gen.operand(array2), gen.operand(length), true);
116 } else {
117 result = gen.getLIRGeneratorTool().emitArrayEquals(kind1, kind2, gen.operand(array1), gen.operand(array2), gen.operand(length), true);
118 }
119 gen.setResult(this, result);
120 }
121
122 @Override
123 public LocationIdentity getLocationIdentity() {
124 return kind1 != kind2 ? LocationIdentity.ANY_LOCATION : NamedLocationIdentity.getArrayLocation(kind1);
125 }
126
127 @Override
128 public MemoryNode getLastLocationAccess() {
129 return lastLocationAccess;
130 }
131
132 @Override
133 public void setLastLocationAccess(MemoryNode lla) {
134 updateUsages(ValueNodeUtil.asNode(lastLocationAccess), ValueNodeUtil.asNode(lla));
135 lastLocationAccess = lla;
136 }
137 }
|