-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
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 NCritical: 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.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels