You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: implement DynamicBox auto-boxing infrastructure for ZRTL plugins
Added automatic DynamicBox wrapping for opaque type parameters when calling
ZRTL plugin functions that expect DynamicBox arguments.
Changes:
- Added symbol_signatures HashMap to CraneliftBackend to track parameter types
- Implemented register_symbol_signatures() to populate signatures from ZRTL plugins
- Added param_needs_boxing() helper to check if parameter expects DynamicBox
- Pre-compute boxing requirements before FunctionBuilder to avoid borrow issues
- Generate DynamicBox wrapping code for parameters marked as dynamic
- Updated ZPack to expose runtime_symbols_with_signatures()
- Updated ZrtlRegistry with collect_symbols_with_signatures()
- Modified zyntax_embed Runtime to register signatures when loading plugins
- Updated cranelift_jit compile_jit() to pass signatures to backend
DynamicBox structure (24 bytes):
- tag: u32 (TypeCategory::Opaque = 0x12)
- size: u32 (8 bytes for pointer)
- data: i64 (pointer to opaque value)
- dropper: i64 (null for now)
Current status:
- Boxing detection works correctly (println_dynamic param 0 shows needs_boxing=true)
- DynamicBox structure is created on stack with proper layout
- Remaining issue: ABI calling convention for passing struct by value vs pointer
Need to investigate proper struct passing in Cranelift
0 commit comments