mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-26 22:34:27 +02:00
8146244: compiler/jvmci/code/DataPatchTest.java crashes: SIGSEGV in (getConstClass)getConstClass
Reviewed-by: twisti
This commit is contained in:
parent
a5d7b2b450
commit
0691fac50b
2 changed files with 22 additions and 1 deletions
|
@ -295,6 +295,15 @@ public abstract class TestAssembler {
|
||||||
data.putFloat(f);
|
data.putFloat(f);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void align(int alignment) {
|
||||||
|
int pos = data.position();
|
||||||
|
int misaligned = pos % alignment;
|
||||||
|
if (misaligned != 0) {
|
||||||
|
pos += alignment - misaligned;
|
||||||
|
data.position(pos);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private byte[] finish() {
|
private byte[] finish() {
|
||||||
return Arrays.copyOf(data.array(), data.position());
|
return Arrays.copyOf(data.array(), data.position());
|
||||||
}
|
}
|
||||||
|
|
|
@ -109,10 +109,11 @@ public class SPARCTestAssembler extends TestAssembler {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Register emitLoadLong(long c) {
|
public Register emitLoadLong(long c) {
|
||||||
if ((c & 0xFFFFFFFF) == c) {
|
if ((c & 0xFFFF_FFFFL) == c) {
|
||||||
return emitLoadInt((int) c);
|
return emitLoadInt((int) c);
|
||||||
} else {
|
} else {
|
||||||
DataSectionReference ref = new DataSectionReference();
|
DataSectionReference ref = new DataSectionReference();
|
||||||
|
data.align(8);
|
||||||
ref.setOffset(data.position());
|
ref.setOffset(data.position());
|
||||||
data.emitLong(c);
|
data.emitLong(c);
|
||||||
return emitLoadPointer(ref);
|
return emitLoadPointer(ref);
|
||||||
|
@ -133,6 +134,7 @@ public class SPARCTestAssembler extends TestAssembler {
|
||||||
@Override
|
@Override
|
||||||
public Register emitLoadFloat(float c) {
|
public Register emitLoadFloat(float c) {
|
||||||
DataSectionReference ref = new DataSectionReference();
|
DataSectionReference ref = new DataSectionReference();
|
||||||
|
data.align(4);
|
||||||
ref.setOffset(data.position());
|
ref.setOffset(data.position());
|
||||||
data.emitFloat(c);
|
data.emitFloat(c);
|
||||||
|
|
||||||
|
@ -262,4 +264,14 @@ public class SPARCTestAssembler extends TestAssembler {
|
||||||
recordImplicitException(info);
|
recordImplicitException(info);
|
||||||
emitOp3(0b11, SPARC.g0, 0b001011, SPARC.g0, 0); // LDX [g0+0], g0
|
emitOp3(0b11, SPARC.g0, 0b001011, SPARC.g0, 0); // LDX [g0+0], g0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public DataSectionReference emitDataItem(HotSpotConstant c) {
|
||||||
|
if (c.isCompressed()) {
|
||||||
|
data.align(4);
|
||||||
|
} else {
|
||||||
|
data.align(8);
|
||||||
|
}
|
||||||
|
return super.emitDataItem(c);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue