|
RPNX::Cortado
C++23 JVM class-file, bytecode, validation, and JAR toolkit
|
Use deserialize_class_file_prefix when a class file is embedded at the start of a larger byte range. It reports the exact number of consumed bytes. The ordinary deserialize_class_file entry point instead requires the input range to contain exactly one class file.
Branch targets must be labels created by the same code_builder. Bind every referenced label exactly once before calling finish indirectly through class_file_builder::add_method.
Entry data is always uncompressed in memory. jar_entry::compression selects how serialization stores it in the ZIP stream. Deserialization inflates and verifies each entry before returning the owning jar_file.
parse_error, a std::logic_error, means input bytes deterministically cannot be decoded under the selected mode and limits.validation_error, a std::logic_error, means a caller-supplied structured model cannot be emitted as a valid class file.assembly_error, a std::logic_error, means caller-supplied symbolic bytecode cannot be resolved or analyzed.unsupported_feature_error, a std::logic_error, means the requested format or analysis case is deliberately outside the supported builder boundary.The diagnostic vector returned by validate_class_file is for expected model validation failures. Exceptions remain appropriate for entry points that cannot return their requested result.
The tutorial series develops the code-generation API in depth, including symbolic control flow, switch layout, exception tables, automatic verifier frames, exact instruction encodings, class transformation, and JAR packaging.