--- old/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/GraalHotSpotVMConfig.java 2017-04-25 16:43:59.623176425 +0200 +++ new/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/GraalHotSpotVMConfig.java 2017-04-25 16:43:59.503176429 +0200 @@ -46,6 +46,8 @@ public static final GraalHotSpotVMConfig INJECTED_VMCONFIG = null; private final boolean isJDK8 = System.getProperty("java.specification.version").compareTo("1.9") < 0; + private final boolean isJDK9 = !isJDK8; + private final boolean isJDK10 = isJDK9; public final String osName = getHostOSName(); public final String osArch = getHostArchitectureName(); public final boolean windowsOs = System.getProperty("os.name", "").startsWith("Windows"); @@ -547,8 +549,12 @@ public final int logOfHRGrainBytes = getFieldValue("HeapRegion::LogOfHRGrainBytes", Integer.class, "int"); - public final byte dirtyCardValue = isJDK8 ? getFieldValue("CompilerToVM::Data::dirty_card", Byte.class, "int") : getConstant("CardTableModRefBS::dirty_card", Byte.class); - public final byte g1YoungCardValue = isJDK8 ? getFieldValue("CompilerToVM::Data::g1_young_card", Byte.class, "int") : getConstant("G1SATBCardTableModRefBS::g1_young_gen", Byte.class); + public final byte dirtyCardValue = isJDK10 ? getConstant("CardTable::dirty_card", Byte.class) : + (isJDK9 ? getConstant("CardTableModRefBS::dirty_card", Byte.class) : + getFieldValue("CompilerToVM::Data::dirty_card", Byte.class, "int")); + public final byte g1YoungCardValue = isJDK10 ? getConstant("G1CardTable::g1_young_gen", Byte.class) : + (isJDK9 ? getConstant("G1SATBCardTableModRefBS::g1_young_gen", Byte.class) : + getFieldValue("CompilerToVM::Data::g1_young_card", Byte.class, "int")); public final long cardtableStartAddress = getFieldValue("CompilerToVM::Data::cardtable_start_address", Long.class, "jbyte*"); public final int cardtableShift = getFieldValue("CompilerToVM::Data::cardtable_shift", Integer.class, "int");