|
@@ -337,34 +337,43 @@ public BinaryContainer(OptionValues graalOptions, GraalHotSpotVMConfig graalHotS |
|
|
private void recordConfiguration(GraalHotSpotVMConfig graalHotSpotVMConfig, GraphBuilderConfiguration graphBuilderConfig, int gc) { |
|
|
// @Checkstyle: stop |
|
|
// @formatter:off |
|
|
boolean[] booleanFlags = { graalHotSpotVMConfig.cAssertions, // Debug VM |
|
|
graalHotSpotVMConfig.useCompressedOops, |
|
|
graalHotSpotVMConfig.useCompressedClassPointers, |
|
|
graalHotSpotVMConfig.useTLAB, |
|
|
graalHotSpotVMConfig.useBiasedLocking, |
|
|
TieredAOT.getValue(graalOptions), |
|
|
graalHotSpotVMConfig.enableContended, |
|
|
graalHotSpotVMConfig.restrictContended, |
|
|
graphBuilderConfig.omitAssertions(), |
|
|
}; |
|
|
|
|
|
int[] intFlags = { graalHotSpotVMConfig.getOopEncoding().getShift(), |
|
|
graalHotSpotVMConfig.getKlassEncoding().getShift(), |
|
|
graalHotSpotVMConfig.contendedPaddingWidth, |
|
|
1 << graalHotSpotVMConfig.logMinObjAlignment(), |
|
|
graalHotSpotVMConfig.codeSegmentSize, |
|
|
gc |
|
|
}; |
|
|
// @formatter:on |
|
|
// @Checkstyle: resume |
|
|
|
|
|
ArrayList<Boolean> booleanFlagsList = new ArrayList<>(); |
|
|
|
|
|
booleanFlagsList.addAll(Arrays.asList(graalHotSpotVMConfig.cAssertions, // Debug VM |
|
|
graalHotSpotVMConfig.useCompressedOops, |
|
|
graalHotSpotVMConfig.useCompressedClassPointers)); |
|
|
if (JavaVersionUtil.JAVA_SPEC < 15) { |
|
|
// See JDK-8236224. FieldsAllocationStyle and CompactFields flags were removed in JDK15. |
|
|
booleanFlagsList.add(graalHotSpotVMConfig.compactFields); |
|
|
} |
|
|
booleanFlagsList.addAll(Arrays.asList(graalHotSpotVMConfig.useTLAB, |
|
|
graalHotSpotVMConfig.useBiasedLocking, |
|
|
TieredAOT.getValue(graalOptions), |
|
|
graalHotSpotVMConfig.enableContended, |
|
|
graalHotSpotVMConfig.restrictContended, |
|
|
graphBuilderConfig.omitAssertions())); |
|
|
if (JavaVersionUtil.JAVA_SPEC < 14) { |
|
|
// See JDK-8220049. Thread local handshakes are on by default since JDK14, the command line option has been removed. |
|
|
booleanFlags = Arrays.copyOf(booleanFlags, booleanFlags.length + 1); |
|
|
booleanFlags[booleanFlags.length - 1] = graalHotSpotVMConfig.threadLocalHandshakes; |
|
|
booleanFlagsList.add(graalHotSpotVMConfig.threadLocalHandshakes); |
|
|
} |
|
|
|
|
|
byte[] booleanFlagsAsBytes = flagsToByteArray(booleanFlags); |
|
|
ArrayList<Integer> intFlagsList = new ArrayList<>(); |
|
|
intFlagsList.addAll(Arrays.asList(graalHotSpotVMConfig.getOopEncoding().getShift(), |
|
|
graalHotSpotVMConfig.getKlassEncoding().getShift(), |
|
|
graalHotSpotVMConfig.contendedPaddingWidth)); |
|
|
if (JavaVersionUtil.JAVA_SPEC < 15) { |
|
|
// See JDK-8236224. FieldsAllocationStyle and CompactFields flags were removed in JDK15. |
|
|
intFlagsList.add(graalHotSpotVMConfig.fieldsAllocationStyle); |
|
|
} |
|
|
intFlagsList.addAll(Arrays.asList(1 << graalHotSpotVMConfig.logMinObjAlignment(), |
|
|
graalHotSpotVMConfig.codeSegmentSize, |
|
|
gc)); |
|
|
|
|
|
// @formatter:on |
|
|
// @Checkstyle: resume |
|
|
|
|
|
byte[] booleanFlagsAsBytes = booleanListToByteArray(booleanFlagsList); |
|
|
int[] intFlags = intFlagsList.stream().mapToInt(i -> i).toArray(); |
|
|
int size0 = configContainer.getByteStreamSize(); |
|
|
|
|
|
// @formatter:off |
|
@@ -381,10 +390,10 @@ private void recordConfiguration(GraalHotSpotVMConfig graalHotSpotVMConfig, Grap |
|
|
assert size == computedSize; |
|
|
} |
|
|
|
|
|
private static byte[] flagsToByteArray(boolean[] flags) { |
|
|
byte[] byteArray = new byte[flags.length]; |
|
|
for (int i = 0; i < flags.length; ++i) { |
|
|
byteArray[i] = boolToByte(flags[i]); |
|
|
private static byte[] booleanListToByteArray(ArrayList<Boolean> list) { |
|
|
byte[] byteArray = new byte[list.size()]; |
|
|
for (int i = 0; i < list.size(); ++i) { |
|
|
byteArray[i] = boolToByte(list.get(i)); |
|
|
} |
|
|
return byteArray; |
|
|
} |
|
|