提交 59681ebc 编写于 作者: D dnsimon

8174957: [JVMCI] jaotc is broken in Xcomp mode

Reviewed-by: iveresov
上级 0fdfbb6f
......@@ -70,8 +70,8 @@ class DataBuilder {
*/
private void fillVMAddresses(HotSpotVMConfigStore config) {
for (VMField vmField : config.getFields().values()) {
if (vmField.value != null) {
final long address = vmField.value;
if (vmField.value != null && vmField.value instanceof Long) {
final long address = (Long) vmField.value;
String value = vmField.name;
/*
* Some fields don't contain addresses but integer values. At least don't add zero
......
......@@ -76,7 +76,7 @@ public class HotSpotCodeCacheProvider implements CodeCacheProvider {
HotSpotVMConfigStore store = runtime.getConfigStore();
for (Map.Entry<String, VMField> e : store.getFields().entrySet()) {
VMField field = e.getValue();
if (field.isStatic() && field.value != null && field.value == address) {
if (field.isStatic() && field.value != null && field.value instanceof Long && ((Long) field.value) == address) {
return e.getValue() + ":0x" + Long.toHexString(address);
}
}
......
......@@ -497,7 +497,7 @@ public final class HotSpotJVMCIRuntime implements HotSpotJVMCIRuntimeProvider {
if (!field.isStatic()) {
printConfigLine(vm, "[vmconfig:instance field] %s %s {offset=%d[0x%x]}%n", field.type, field.name, field.offset, field.offset);
} else {
String value = field.value == null ? "null" : String.format("%d[0x%x]", field.value, field.value);
String value = field.value == null ? "null" : field.value instanceof Boolean ? field.value.toString() : String.format("%d[0x%x]", field.value, field.value);
printConfigLine(vm, "[vmconfig:static field] %s %s = %s {address=0x%x}%n", field.type, field.name, value, field.address);
}
}
......
......@@ -38,22 +38,22 @@ public final class VMField {
public final String type;
/**
* If represented field is non-static, this is its offset within the containing structure.
* If the represented field is non-static, this is its offset within the containing structure.
*/
public final long offset;
/**
* If represented field is static, this is its address. Otherwise, this field is 0.
* If the represented field is static, this is its address. Otherwise, this is 0.
*/
public final long address;
/**
* Value of the field represented as a boxed long; only valid for non-oop static fields. This
* value is only captured once, during JVMCI initialization. If {@link #type} cannot be
* meaningfully (e.g., a struct) or safely (e.g., an oop) expressed as a boxed long, this is
* {@code null}.
* Value of the field represented as a boxed boolean if its C++ type is bool otherwise as a
* boxed long; only valid for non-oop static fields. This value is only captured once, during
* JVMCI initialization. If {@link #type} cannot be meaningfully (e.g., a struct) or safely
* (e.g., an oop) expressed as a boxed object, this is {@code null}.
*/
public final Long value;
public final Object value;
/**
* Determines if the represented field is static.
......
......@@ -117,7 +117,7 @@ class JVMCIJavaClasses : AllStatic {
oop_field(VMField, type, "Ljava/lang/String;") \
long_field(VMField, offset) \
long_field(VMField, address) \
oop_field(VMField, value, "Ljava/lang/Long;") \
oop_field(VMField, value, "Ljava/lang/Object;") \
end_class \
start_class(VMFlag) \
oop_field(VMFlag, name, "Ljava/lang/String;") \
......
......@@ -38,6 +38,7 @@
package compiler.jvmci.compilerToVM;
import jdk.test.lib.Asserts;
import jdk.vm.ci.hotspot.VMField;
import jdk.vm.ci.hotspot.HotSpotJVMCIRuntime;
import jdk.vm.ci.hotspot.HotSpotVMConfigAccess;
import jdk.vm.ci.hotspot.HotSpotVMConfigStore;
......@@ -49,10 +50,19 @@ public class ReadConfigurationTest {
}
private void runTest() {
TestHotSpotVMConfig config = new TestHotSpotVMConfig(HotSpotJVMCIRuntime.runtime().getConfigStore());
HotSpotVMConfigStore store = HotSpotJVMCIRuntime.runtime().getConfigStore();
TestHotSpotVMConfig config = new TestHotSpotVMConfig(store);
Asserts.assertNE(config.codeCacheHighBound, 0L, "Got null address");
Asserts.assertNE(config.stubRoutineJintArrayCopy, 0L, "Got null address");
for (VMField field : store.getFields().values()) {
Object value = field.value;
if (value != null) {
Asserts.assertTrue(value instanceof Long || value instanceof Boolean,
"Got unexpected value type for VM field " + field.name + ": " + value.getClass());
}
}
for (VMIntrinsicMethod m : config.getStore().getIntrinsics()) {
Asserts.assertNotNull(m);
Asserts.assertNotNull(m.declaringClass);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册