- Fixed deadlock in FileBox plugin copyFrom implementation (single lock) - Added TLV Handle (tag=8) parsing in calls.rs for returned BoxRefs - Improved plugin loader with config path consistency and detailed logging - Fixed loader routing for proper Handle type_id/fini_method_id resolution - Added detailed logging for TLV encoding/decoding in plugin_loader_v2 Test docs/examples/plugin_boxref_return.nyash now works correctly: - cloneSelf() returns FileBox Handle properly - copyFrom(Box) accepts plugin Box arguments - Both FileBox instances close and fini correctly 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
807 B
807 B
Nyash VM 実行基盤ガイド(更新)
- プラグインBox引数の最小対応を追加(TLV: BoxRef)
- TLVタグ: 1=Bool, 2=I32, 3=I64, 4=F32, 5=F64, 6=String, 7=Bytes, 8=Handle(BoxRef)
- BoxRefはプラグインBox参照(type_id:u32, instance_id:u32)を8バイトでエンコード
- ユーザー定義Box・複雑なビルトインは当面非対応(toStringフォールバック)
現状のルーティング:
- User-defined: MIR関数({Box}.{method}/{N}) にCall化(関数存在時)。それ以外はBoxCall。
- Builtin: BoxCall → VM内の簡易ディスパッチ。
- Plugin: BoxCall → PluginLoaderV2.invoke_instance_method。
今後のタスク:
- VM側のfrom Parent.method対応(Builder/VM両対応)
- TLVの型拡張(Float/配列/BoxRef戻り値など)