diff --git a/go.mod b/go.mod index 28f88a4..ba8cb59 100644 --- a/go.mod +++ b/go.mod @@ -2,4 +2,4 @@ module github.com/wago-org/component-model go 1.22.0 -require github.com/wago-org/wago v0.0.0-20260828131729-c1a5d215cab0 +require github.com/wago-org/wago v0.1.0-beta.8.0.20260916050830-c9ed2455acd9 diff --git a/go.sum b/go.sum index 0db3d66..f6a11d5 100644 --- a/go.sum +++ b/go.sum @@ -1,2 +1,2 @@ -github.com/wago-org/wago v0.0.0-20260828131729-c1a5d215cab0 h1:JACyOKg+wp+pnQpu3ApLHDjrKxpN3/5zOFgnk/Xkayo= -github.com/wago-org/wago v0.0.0-20260828131729-c1a5d215cab0/go.mod h1:odr+6v51s1UDezUBJZrBBujWs/iD1pSHHhAVkb8BTQ0= +github.com/wago-org/wago v0.1.0-beta.8.0.20260916050830-c9ed2455acd9 h1:+/8b9bvAnyUZPG+YTvGpDwpAV+jpp6+bBBWOrr+8Xco= +github.com/wago-org/wago v0.1.0-beta.8.0.20260916050830-c9ed2455acd9/go.mod h1:q0pPiPF6W6GZpTXbWwy+GT+r19KHSzB/gRcPUVHyntI= diff --git a/internal/engine/engine.go b/internal/engine/engine.go index c3752f3..331ec44 100644 --- a/internal/engine/engine.go +++ b/internal/engine/engine.go @@ -243,9 +243,10 @@ func (r *runtimeAdapter) instantiateModule(ctx context.Context, c CompiledModule continue } resolvedFuncs[coreImportIdentity{module: spec.Module, name: spec.Name}] = fn - var host core.HostFunc + var host any if hf, ok := fn.(*hostFunction); ok { - host = core.HostFunc(func(caller core.HostModule, params, results []uint64) { + host = func(caller core.Caller, call core.HostCall) { + params, results := call.ParamSlots(), call.ResultSlots() defer func() { if recovered := recover(); recovered != nil { switch recovered.(type) { @@ -266,15 +267,16 @@ func (r *runtimeAdapter) instantiateModule(ctx context.Context, c CompiledModule callCtx := context.WithValue(ctx, activeCallerKey{}, caller) hf.fn.Call(callCtx, callerModule{caller: caller}, stack) copy(results, stack) - }) + } } else if wf, ok := fn.(*wasmFunction); ok { - host = core.HostFunc(func(caller core.HostModule, params, results []uint64) { + host = func(caller core.Caller, call core.HostCall) { + params, results := call.ParamSlots(), call.ResultSlots() out, callErr := wf.mod.in.InvokeFromHost(ctx, caller, wf.name, params...) if callErr != nil { panic(core.HostTrap{Err: callErr}) } copy(results, out) - }) + } } if host != nil { owner, err := r.funcrefs.New(host, core.FuncSig{ diff --git a/testdata/conformance/wasmtime/xfail.json b/testdata/conformance/wasmtime/xfail.json index 94136b3..2bc25a5 100644 --- a/testdata/conformance/wasmtime/xfail.json +++ b/testdata/conformance/wasmtime/xfail.json @@ -16,12 +16,6 @@ "async__cancel-starting-subtask-does-not-leak__0000__L9": "component execution semantics for this regression are incomplete", "async__drop-host__0000__L5": "component execution semantics for this regression are incomplete", "async__drop-waitable-set-stackful__0000__L13": "fixture exceeds the plugin memory authority budget", - "async__exceptions__0001__L67": "core exception handling is disabled in Wago", - "async__exceptions__0003__L69": "core exception handling is disabled in Wago", - "async__exceptions__0006__L143": "core exception handling is disabled in Wago", - "async__exceptions__0008__L145": "core exception handling is disabled in Wago", - "async__exceptions__0011__L215": "core exception handling is disabled in Wago", - "async__exceptions__0013__L217": "core exception handling is disabled in Wago", "async__fused__0004__L104/action/L148": "required component-model trap is not enforced", "async__future-cancel-write-completed__0000__L5": "complete imported and aliased component type retention is not implemented", "async__future-drop-writable-after-notified-drop__0000__L4/action/L160": "this component re-entry shape is not implemented by Wago", @@ -91,10 +85,6 @@ "async__wait-forever2__0000__L5": "fixture exceeds the plugin memory authority budget", "async__yield-when-cancelled__0000__L6/action/L97": "this component re-entry shape is not implemented by Wago", "error-context-trap-in-post-return__0001__L45/action/L46": "required component-model trap is not enforced", - "exceptions__0000__L22": "core exception handling is disabled in Wago", - "exceptions__0002__L54": "core exception handling is disabled in Wago", - "exceptions__0004__L90": "core exception handling is disabled in Wago", - "exceptions__0006__L132": "core exception handling is disabled in Wago", "exceptions__0008__L168": "core exception handling is disabled in Wago", "fixed_length_lists__0000__L18": "114: decode component: nested component[0]: type section: type[0]: instancedecl[0]: unsupported (M1): defvaltype tag 0x67", "gc__empty__0000__L8": "component core-type sections are not implemented", @@ -103,7 +93,6 @@ "implements__0000__L3": "extern-name attributes are not implemented", "import__0000__L1": "complete component semantic validation is not implemented", "import__0001__L7": "114: instantiation succeeded, want trap containing \"expected instance found func\"", - "instance__0003__L34": "this component re-entry shape is not implemented by Wago", "instance__0006__L104": "component execution semantics for this regression are incomplete", "instance__0007__L130": "component execution semantics for this regression are incomplete", "instance__0008__L161": "component execution semantics for this regression are incomplete", diff --git a/testdata/conformance/wasmtime/xfail_windows.json b/testdata/conformance/wasmtime/xfail_windows.json index 75f55c5..02ec91d 100644 --- a/testdata/conformance/wasmtime/xfail_windows.json +++ b/testdata/conformance/wasmtime/xfail_windows.json @@ -1,4 +1,14 @@ { - "async__intra-streams__0004__L118": "Wago's Windows backend does not yet implement core multi-memory", + "async__exceptions__0001__L67": "Wago's Windows backend does not yet implement core exception handling", + "async__exceptions__0003__L69": "Wago's Windows backend does not yet implement core exception handling", + "async__exceptions__0006__L143": "Wago's Windows backend does not yet implement core exception handling", + "async__exceptions__0008__L145": "Wago's Windows backend does not yet implement core exception handling", + "async__exceptions__0011__L215": "Wago's Windows backend does not yet implement core exception handling", + "async__exceptions__0013__L217": "Wago's Windows backend does not yet implement core exception handling", + "exceptions__0000__L22": "Wago's Windows backend does not yet implement core exception handling", + "exceptions__0002__L54": "Wago's Windows backend does not yet implement core exception handling", + "exceptions__0004__L90": "Wago's Windows backend does not yet implement core exception handling", + "exceptions__0006__L132": "Wago's Windows backend does not yet implement core exception handling", + "async__intra-streams__0004__L118": "Wago's Windows backend does not yet implement core multi-memory", "async__intra-streams__0006__L179": "Wago's Windows backend does not yet implement core multi-memory" } diff --git a/testdata/conformance/xfail.json b/testdata/conformance/xfail.json index e936afb..37c3d6a 100644 --- a/testdata/conformance/xfail.json +++ b/testdata/conformance/xfail.json @@ -151,7 +151,6 @@ "binary__binary__0117__L1465": "complete component semantic validation is not implemented", "linking__link-time-virtualization__0000__L2": "component core-type sections are not implemented", "linking__shared-everything-dynamic-linking__0000__L4": "component core-type sections are not implemented", - "linking__shared-everything-dynamic-linking__0010__L152": "component re-entry leaves a host funcref importer live during teardown", "linking__shared-everything-dynamic-linking__0010__L152/action/L191": "this component re-entry shape is not implemented by Wago", "linking__tags__0000__L7": "core exception handling is disabled in Wago", "linking__tags__0003__L36": "core exception handling is disabled in Wago",