Wagon实现log函数的第二种方法
host接口
func NewVM(module *wasm.Module) (*VM, error) {
var vm VM
vm.funcs = make([]function, len(module.FunctionIndexSpace))
vm.globals = make([]uint64, len(module.GlobalIndexSpace))
vm.newFuncTable()
vm.module = module
nNatives := 0 for i, fn := range module.FunctionIndexSpace { if fn.IsHost() {
vm.funcs[i] = goFunction{
typ: fn.Host.Type(), val: fn.Host, }
nNatives++
continue }外部导入部分
resolveImports中解决引用的方法
importer方式解决引用
最后更新于