{"record":{"id":"289ed3c7864c6187","repo":"oracle/graal","slug":"register-not-found","errorCode":null,"errorMessage":"Register not found","messagePattern":"Register not found","errorType":"exception","errorClass":"DeserializationException","httpStatus":null,"severity":"error","filePath":"compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/hotspot/replaycomp/JsonReplayCodec.java","lineNumber":785,"sourceCode":"        public String tag() {\n            return \"register\";\n        }\n\n        @Override\n        public void serialize(Object instance, JsonBuilder.ObjectBuilder objectBuilder, RecursiveSerializer serializer) throws IOException {\n            Register register = (Register) instance;\n            objectBuilder.append(\"number\", register.number);\n        }\n\n        @Override\n        public Object deserialize(EconomicMap<String, Object> json, RecursiveDeserializer deserializer, CompilationProxies.ProxyFactory proxyFactory) throws DeserializationException {\n            int number = (int) json.get(\"number\");\n            for (Register register : deserializer.getArchitecture().getRegisters()) {\n                if (register.number == number) {\n                    return register;\n                }\n            }\n            throw new DeserializationException(this, json, \"Register not found\");\n        }\n    }\n\n    private static final class FieldSerializer implements ObjectSerializer {\n\n        @Override\n        public Class<?> clazz() {\n            return Field.class;\n        }\n\n        @Override\n        public String tag() {\n            return \"field\";\n        }\n\n        @Override\n        public void serialize(Object instance, JsonBuilder.ObjectBuilder objectBuilder, RecursiveSerializer serializer) throws IOException {\n            Field field = (Field) instance;","sourceCodeStart":767,"sourceCodeEnd":803,"githubUrl":"https://github.com/oracle/graal/blob/a66e9ccd1d7bf2552883939aa0788dfd0e294aab/compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/hotspot/replaycomp/JsonReplayCodec.java#L767-L803","documentation":"RegisterSerializer identifies a Register purely by its 'number' field and resolves it by scanning deserializer.getArchitecture().getRegisters() for a matching register.number. DeserializationException('Register not found') means the recorded register number does not exist in the architecture instance the replay session constructed.","triggerScenarios":"Replaying a file recorded on a machine whose register numbering differs from the replaying Architecture object — e.g. an AMD64 file replayed against an AArch64 architecture, or an Architecture constructed with a different feature set that changes the register array.","commonSituations":"Cross-architecture replay; version skew where register tables changed; the Architecture entry in the replay file was overridden or the architecture was set from the host rather than the file.","solutions":["Replay on the same architecture as the recording (AMD64 file on AMD64, etc.)","Verify the architecture entry in the replay file was deserialized before the register entry (the codec calls setArchitecture when it reads the architecture)","Re-record the replay file with the same CPU/OS/JVM combination"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Verify the register number exists in the replay architecture before use\nint number = (int) json.get(\"number\");\nboolean found = Arrays.stream(architecture.getRegisters()).anyMatch(r -> r.number == number);\nif (!found) throw new DeserializationException(this, json, \"Register \" + number + \" not in \" + architecture);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Replay register-bearing files only on the same architecture as the recording","Ensure the architecture section is deserialized (setArchitecture called) before register entries are processed"],"tags":["graalvm","replay","register","architecture"],"backgroundTag":null,"analyzedSha":"a66e9ccd1d7bf2552883939aa0788dfd0e294aab","analyzedAt":"2026-08-14T13:58:47.161Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}