Part of #69, depends on #70
Task
For each re-exporter, generate three wasm functions in the fused core module that operate on the handle table allocated in #70.
Implementation
Files: meld-core/src/merger.rs (or new meld-core/src/handle_table.rs)
Generate using wasm_encoder::Function + wasm_encoder::Instruction:
;; ht_new: store rep, return aligned handle
(func (param i32) (result i32)
global.get $next_ptr
local.tee $handle
local.get 0 ;; rep
i32.store ;; store in memory N at handle addr
local.get $handle
i32.const 4
i32.add
global.set $next_ptr
local.get $handle)
;; ht_rep: load rep from handle address
(func (param i32) (result i32)
local.get 0
i32.load) ;; load from memory N
;; ht_drop: zero out entry
(func (param i32)
local.get 0
i32.const 0
i32.store) ;; store in memory N
Critical: i32.load/i32.store must specify the correct memory index for multi-memory mode.
Add new_func, rep_func, drop_func merged function indices to HandleTableInfo.
Branch
feat/per-component-handle-tables
Acceptance
cargo test --package meld-core passes. Functions generated but not yet wired.
Part of #69, depends on #70
Task
For each re-exporter, generate three wasm functions in the fused core module that operate on the handle table allocated in #70.
Implementation
Files:
meld-core/src/merger.rs(or newmeld-core/src/handle_table.rs)Generate using
wasm_encoder::Function+wasm_encoder::Instruction:Critical:
i32.load/i32.storemust specify the correct memory index for multi-memory mode.Add
new_func,rep_func,drop_funcmerged function indices toHandleTableInfo.Branch
feat/per-component-handle-tablesAcceptance
cargo test --package meld-corepasses. Functions generated but not yet wired.