Expand description
Pure-Rust JVM bytecode generator, JAR SDK indexer, and Rust binding emitter for FLR v2.
fabric-rs-codegen synthesizes verifiable .class files (complete with automatic StackMapTable
frames) without requiring javac or Java ASM at package time:
jvm_writer: Constant pool builder, bytecode instruction emitter (CodeWriter), annotations, and.classserializer.class_reader: Classfile parser for JAR indexing (build_sdk_index_from_jars) and constant-pool relocation (relocate_class_bytes).bootstrap_gen: Isolated per-modFlrLoader.class,RustBootstrap.class, and optionalNativeBridge.class.mixin_gen: SpongePowered Mixin.classsynthesis,MixinTrampolines.class,*.mixins.json, and*.refmap.json.subclass_gen: Custom Java subclass.classemission withflrHandle, overrides, andinvokespecialsuper bridges.rust_emitter: Generates typed Rust wrappers (emit_rust_binding) used bybind_class!andcargo fabric bindings.
Re-exports§
pub use bootstrap_gen::generate_native_bridge;pub use bootstrap_gen::generate_neoforge_bootstrap;pub use bootstrap_gen::generate_neoforge_event_relay;pub use bootstrap_gen::generate_rust_bootstrap;pub use bootstrap_gen::relocate_runtime_loader;pub use class_reader::build_sdk_index_from_jars;pub use class_reader::parse_class_bytes;pub use class_reader::relocate_class_bytes;pub use jvm_writer::access_flags;pub use jvm_writer::opcodes;pub use jvm_writer::Annotation;pub use jvm_writer::BootstrapMethod;pub use jvm_writer::ClassWriter;pub use jvm_writer::CodeWriter;pub use jvm_writer::ElementValue;pub use jvm_writer::ExceptionHandler;pub use jvm_writer::FieldWriter;pub use jvm_writer::InnerClassEntry;pub use jvm_writer::LabelId;pub use jvm_writer::MethodHandleKind;pub use jvm_writer::MethodWriter;pub use jvm_writer::VerificationType;pub use mixin_gen::generate_mixin_class;pub use mixin_gen::generate_mixins_json;pub use mixin_gen::generate_refmap_json;pub use rust_emitter::emit_rust_binding;pub use subclass_gen::generate_subclass_bytes;
Modules§
- bootstrap_
gen - Isolated per-mod loader,
RustBootstrap, and dynamicNativeBridgegenerators. Isolated per-modFlrLoader.class,RustBootstrap.class, andNativeBridge.classgenerators. - class_
reader - JVM
.classreader, constant-pool class relocator, and JAR SDK indexer. JVM classfile parser for SDK indexing and constant-pool class relocation. - jvm_
writer - Pure-Rust JVM classfile writer with basic-block label patching and
StackMapTablegeneration. Pure-Rust JVM.classfile builder supportingStackMapTable, annotations, and labels. - mixin_
gen - Mixin classfile, trampoline, config, and Intermediary refmap generators.
SpongePowered Mixin
.class,MixinTrampolines.class, JSON config, and refmap generators. - rust_
emitter - Rust wrapper struct/method code emitter backing
bind_class!andcargo fabric bindings. Typed Rust wrapper code emitter forbind_class!andcargo fabric bindings. - stack_
map - Automatic CFG dataflow bytecode analyzer for
StackMapTableand frame limits. Automatic JVM CFG dataflow analyzer forStackMapTablegeneration andmax_stack/max_locals. - subclass_
gen - Custom Java subclass
.classandSubclassTrampolinesgenerators. Custom Java subclass.classandSubclassTrampolines.classbytecode generators.