Skip to content

Commit 58ce4ef

Browse files
committed
Minor spec refactoring
1 parent f4757de commit 58ce4ef

File tree

1 file changed

+9
-15
lines changed

1 file changed

+9
-15
lines changed

design/mvp/CanonicalABI.md

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2743,18 +2743,6 @@ present, is validated as such:
27432743
Additionally some options are required depending on lift/lower operations
27442744
performed for a component. These are defined as:
27452745

2746-
* `lower_func(ft)`
2747-
* requires options based on `lower(param)` for all parameters in `ft`
2748-
* requires options based on `lift(result)` if `ft` has a result
2749-
* if `len(flatten_types(ft.param_types())) > MAX_FLAT_PARAMS`, `memory` is required
2750-
* if `len(flatten_types(ft.result_types())) > MAX_FLAT_RESULTS`, `realloc` is required
2751-
2752-
* `lift_func(ft)`
2753-
* requires options based on `lift(param)` for all parameters in `ft`
2754-
* requires options based on `lower(result)` if `ft` has a result
2755-
* if `len(flatten_types(ft.param_types())) > MAX_FLAT_PARAMS`, `realloc` is required
2756-
* if `len(flatten_types(ft.result_types())) > MAX_FLAT_RESULTS`, `memory` is required
2757-
27582746
* `lower(T)`
27592747
* requires `memory` if `T` contains a `list` or `string`
27602748

@@ -2775,7 +2763,10 @@ validation is performed:
27752763
* `$callee` must have type `flatten_functype($opts, $ft, 'lift')`
27762764
* `$f` is given type `$ft`
27772765
* if a `post-return` is present, it has type `(func (param flatten_functype({}, $ft, 'lift').results))`
2778-
* [`lift_func($ft)` above](#canonopt-validation) defines extra required options.
2766+
* requires options based on [`lift(param)`](#canonopt-validation) for all parameters in `ft`
2767+
* requires options based on [`lower(result)`](#canonopt-validation) if `ft` has a result
2768+
* if `len(flatten_types(ft.param_types())) > MAX_FLAT_PARAMS`, `realloc` is required
2769+
* if `len(flatten_types(ft.result_types())) > MAX_FLAT_RESULTS`, `memory` is required
27792770

27802771
When instantiating component instance `$inst`:
27812772
* Define `$f` to be the partially-bound closure `canon_lift($opts, $inst, $ft, $callee)`
@@ -2937,7 +2928,10 @@ In addition to [general validation of `$opts`](#canonopt-validation) the additio
29372928
validation is performed where `$callee` has type `$ft`:
29382929

29392930
* `$f` is given type `flatten_functype($opts, $ft, 'lower')`
2940-
* [`lower_func($ft)` above](#canonopt-validation) defines extra required options.
2931+
* requires options [based on `lower(param)`](#canonopt-validation) for all parameters in `ft`
2932+
* requires options [based on `lift(result)`](#canonopt-validation) if `ft` has a result
2933+
* if `len(flatten_types(ft.param_types())) > max_flat_params`, `memory` is required
2934+
* if `len(flatten_types(ft.result_types())) > max_flat_results`, `realloc` is required
29412935
* if `async` is specified, `memory` must be present
29422936

29432937
When instantiating component instance `$inst`:
@@ -3254,7 +3248,7 @@ specifies:
32543248

32553249
* `$f` is given type `flatten_functype($opts, (func (param $t)?), 'lower')`
32563250
* `$opts` may only contain `memory` and `string-encoding`
3257-
* [`lift_func($f.result)` above](#canonopt-validation) defines required options
3251+
* [`lift($f.result)` above](#canonopt-validation) defines required options
32583252

32593253
Calling `$f` invokes the following function which uses `Task.return_` to lift
32603254
and pass the results to the caller:

0 commit comments

Comments
 (0)