oracle/graal · error · IllegalStateException
Unexpected kind of register config: ${name}
Error message
Unexpected kind of register config: ${name} What it means
Deserialization counterpart of 151: the registerConfig entry's 'name' must be 'AMD64', 'RISCV64', or 'AArch64'; anything else throws IllegalStateException('Unexpected kind of register config: ...'). Note the casing differs from the Architecture names ('AMD64' vs 'riscv64'/'aarch64' lowercase), a common trip-up when editing files by hand.
Source
Thrown at compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/hotspot/replaycomp/JsonReplayCodec.java:1702
@Override
@SuppressWarnings("unchecked")
public Object deserialize(EconomicMap<String, Object> json, RecursiveDeserializer deserializer, CompilationProxies.ProxyFactory proxyFactory) throws DeserializationException {
String name = (String) json.get("name");
TargetDescription targetDescription = (TargetDescription) deserializer.deserialize(json.get("target"), proxyFactory);
List<Register> allocatable = (List<Register>) deserializer.deserialize(json.get("allocatable"), proxyFactory);
switch (name) {
case "AMD64" -> {
boolean windowsOS = (boolean) json.get("windowsOS");
return new AMD64HotSpotRegisterConfig(targetDescription, allocatable, windowsOS);
}
case "RISCV64" -> {
return new RISCV64HotSpotRegisterConfig(targetDescription, allocatable);
}
case "AArch64" -> {
return new AArch64HotSpotRegisterConfig(targetDescription, allocatable);
}
default -> throw new IllegalStateException("Unexpected kind of register config: " + name);
}
}
}
private static final class ThrowableSerializer implements ObjectSerializer {
@Override
public boolean serializesSubclasses() {
return true;
}
@Override
public Class<?> clazz() {
return Throwable.class;
}
@Override
public String tag() {View on GitHub (pinned to a66e9ccd1d)
Solutions
- Fix the name casing/values: AMD64, RISCV64, AArch64 (note uppercase here, lowercase in the architecture name)
- Re-record the file on the same build and architecture
- For new backends, extend both this switch and the serializer in error 151
Example fix
// before (hand-edited file): { "tag": "registerConfig", "name": "aarch64", ... }
// after: { "tag": "registerConfig", "name": "AArch64", ... } Defensive patterns
Strategy: validation
Validate before calling
static final Set<String> VALID_REGISTER_CONFIG_KINDS = Set.of("AMD64", "RISCV64", "AArch64");
if (!VALID_REGISTER_CONFIG_KINDS.contains(name)) {
throw new IllegalArgumentException("Unsupported register config kind in replay file: " + name);
} Prevention
- Remember casing differs: architecture names are lowercase ('riscv64') but register-config kinds are uppercase ('RISCV64')
- Validate replay JSON with a schema checker that enforces these enumerations before deserialization
When it happens
Trigger: Replaying a JSON replay file whose registerConfig.name is unknown or wrongly cased — e.g. hand-edited from 'aarch64' (architecture spelling) instead of 'AArch64' (register-config spelling), or written by a codec with additional backends.
Common situations: Manual JSON edits with case mismatch; cross-version replay; fork architectures not upstreamed.
Related errors
- No singleton found for ${registration}
- Unknown class ${className} for constant${value}
- Invalid marker type.
- Invalid constant.
- Unexpected value: ${name}
AI-assisted analysis of oracle/graal@a66e9ccd1d (2026-08-14).
Data as JSON: /api/errors/088e90d408b0ec01.
Report an issue: GitHub.