Skip to content

Commit a788cfe

Browse files
committed
[GR-64888] Minor access fixes
PullRequest: graal/20774
2 parents 0c69fe5 + e19371d commit a788cfe

File tree

3 files changed

+7
-12
lines changed

3 files changed

+7
-12
lines changed

compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/core/test/ea/PartialEscapeUnsafeStoreTest.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,10 @@
2424
*/
2525
package jdk.graal.compiler.core.test.ea;
2626

27-
import jdk.graal.compiler.core.test.GraalCompilerTest;
2827
import org.junit.Test;
2928

29+
import jdk.graal.compiler.core.test.GraalCompilerTest;
30+
3031
/**
3132
* Exercise a mix of unsafe and normal reads ands writes in situations where EA might attempt to
3233
* fold the operations.
@@ -557,7 +558,7 @@ public void testByteArrayWithIntStoreAndRead() {
557558
}
558559

559560
public static byte testByteArrayWithLongStoreAndReadSnippet(long v) {
560-
byte[] b = new byte[4];
561+
byte[] b = new byte[8];
561562
UNSAFE.putLong(b, byteArrayBaseOffset, v);
562563
return b[(byteSize / longSize) + 1];
563564
}
@@ -579,7 +580,7 @@ public void testByteArrayWithFloatStoreAndRead() {
579580
}
580581

581582
public static byte testByteArrayWithDoubleStoreAndReadSnippet(double v) {
582-
byte[] b = new byte[4];
583+
byte[] b = new byte[8];
583584
UNSAFE.putDouble(b, byteArrayBaseOffset, v);
584585
return b[(byteSize / doubleSize) + 1];
585586
}

compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/hotspot/meta/DefaultHotSpotLoweringProvider.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -996,7 +996,7 @@ private void lowerOSRStartNode(OSRStartNode osrStart) {
996996
graph.addBeforeFixed(migrationEnd, loadDisplacedHeader);
997997

998998
// we need to initialize the stack slot for the lock
999-
BeginLockScopeNode beginLockScope = graph.add(new BeginLockScopeNode(lock.getStackKind(), monitorID.getLockDepth()));
999+
BeginLockScopeNode beginLockScope = graph.add(new BeginLockScopeNode(replacements.getProviders().getWordTypes(), monitorID.getLockDepth()));
10001000
graph.addBeforeFixed(migrationEnd, beginLockScope);
10011001

10021002
// write the displaced mark to the correct stack slot

compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/hotspot/nodes/BeginLockScopeNode.java

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@
2828
import static jdk.graal.compiler.nodeinfo.NodeCycles.CYCLES_2;
2929
import static jdk.graal.compiler.nodeinfo.NodeSize.SIZE_1;
3030

31+
import org.graalvm.word.LocationIdentity;
32+
3133
import jdk.graal.compiler.core.common.type.StampFactory;
3234
import jdk.graal.compiler.graph.NodeClass;
3335
import jdk.graal.compiler.hotspot.HotSpotLIRGenerator;
@@ -40,9 +42,6 @@
4042
import jdk.graal.compiler.nodes.spi.NodeLIRBuilderTool;
4143
import jdk.graal.compiler.word.Word;
4244
import jdk.graal.compiler.word.WordTypes;
43-
import org.graalvm.word.LocationIdentity;
44-
45-
import jdk.vm.ci.meta.JavaKind;
4645
import jdk.vm.ci.meta.Value;
4746

4847
/**
@@ -62,11 +61,6 @@ public BeginLockScopeNode(@InjectedNodeParameter WordTypes wordTypes, int lockDe
6261
this.lockDepth = lockDepth;
6362
}
6463

65-
public BeginLockScopeNode(JavaKind kind, int lockDepth) {
66-
super(TYPE, StampFactory.forKind(kind));
67-
this.lockDepth = lockDepth;
68-
}
69-
7064
@Override
7165
public boolean hasSideEffect() {
7266
return false;

0 commit comments

Comments
 (0)