@@ -33,7 +33,6 @@ being specified here.
33
33
* [ Canonical definitions] ( #canonical-definitions )
34
34
* [ ` canon lift ` ] ( #canon-lift )
35
35
* [ ` canon lower ` ] ( #canon-lower )
36
- * [ ` canon $opts ` ] ( #canon-opts )
37
36
* [ ` canon resource.new ` ] ( #canon-resourcenew )
38
37
* [ ` canon resource.drop ` ] ( #canon-resourcedrop )
39
38
* [ ` canon resource.rep ` ] ( #canon-resourcerep )
@@ -2728,14 +2727,12 @@ For a canonical definition:
2728
2727
``` wat
2729
2728
(canon lift $callee:<funcidx> $opts:<canonopt>* (func $f (type $ft)))
2730
2729
```
2731
-
2732
- In addition to [ general validation of ` $opts ` ] ( #canon-opts ) the additional
2733
- validation is performed:
2734
-
2730
+ validation specifies:
2735
2731
* ` $callee ` must have type ` flatten_functype($opts, $ft, 'lift') `
2736
2732
* ` $f ` is given type ` $ft `
2737
- * a ` memory ` is present if required by lifting
2738
- * a ` realloc ` is present if required by lifting
2733
+ * a ` memory ` is present if required by lifting and is a subtype of ` (memory 1) `
2734
+ * a ` realloc ` is present if required by lifting and has type ` (func (param i32 i32 i32 i32) (result i32)) `
2735
+ * if ` async ` is set, a ` post-return ` function may not be set
2739
2736
* if a ` post-return ` is present, it has type ` (func (param flatten_functype({}, $ft, 'lift').results)) `
2740
2737
2741
2738
When instantiating component instance ` $inst ` :
@@ -2893,13 +2890,11 @@ For a canonical definition:
2893
2890
``` wat
2894
2891
(canon lower $callee:<funcidx> $opts:<canonopt>* (core func $f))
2895
2892
```
2896
-
2897
- In addition to [ general validation of ` $opts ` ] ( #canon-opts ) the additional
2898
- validation is performed where ` $callee ` has type ` $ft ` :
2899
-
2893
+ where ` $callee ` has type ` $ft ` , validation specifies:
2900
2894
* ` $f ` is given type ` flatten_functype($opts, $ft, 'lower') `
2901
- * a ` memory ` is present if required by lowering
2902
- * a ` realloc ` is present if required by lowering
2895
+ * a ` memory ` is present if required by lifting and is a subtype of ` (memory 1) `
2896
+ * a ` realloc ` is present if required by lifting and has type ` (func (param i32 i32 i32 i32) (result i32)) `
2897
+ * there is no ` post-return ` in ` $opts `
2903
2898
* if ` contains_async_value($ft) ` , then ` $opts.async ` must be set
2904
2899
2905
2900
When instantiating component instance ` $inst ` :
@@ -3039,26 +3034,6 @@ elimination of string operations on the labels of records and variants) as well
3039
3034
as post-MVP [ adapter functions] .
3040
3035
3041
3036
3042
- ### ` canon $opts `
3043
-
3044
- Canonical options, specified here as ` $opts ` in a number of locations
3045
- throughout this document, can be specified at most once per ` $opts ` . For example
3046
- specifying ` string-encoding=utf8 ` twice is an error. Each individual option, if
3047
- present, is validated as such:
3048
-
3049
- * ` string-encoding=utf8 ` - cannot be combined with ` utf16 ` or ` latin1+utf16 `
3050
- * ` string-encoding=utf16 ` - cannot be combined with ` utf8 ` or ` latin1+utf16 `
3051
- * ` string-encoding=latin1+utf16 ` - cannot be combined with ` utf8 ` or ` utf16 `
3052
- * ` memory ` - this is a subtype of ` (memory 1) `
3053
- * ` realloc ` - the function has type ` (func (param i32 i32 i32 i32) (result i32)) `
3054
- * ` post-return ` - only allowed on [ ` canon lift ` ] ( #canon-lift ) , which has rules
3055
- for validation
3056
- * 🔀 ` async ` - cannot be present with ` post-return `
3057
- * 🔀 ` callback ` - the function has type `(func (param i32 i32 i32 i32) (result
3058
- i32))` and cannot be present without ` async` and is only allowed with [ ` canon
3059
- lift`] ( #canon-lift )
3060
-
3061
-
3062
3037
### ` canon resource.new `
3063
3038
3064
3039
For a canonical definition:
@@ -3230,10 +3205,7 @@ For a canonical definition:
3230
3205
``` wat
3231
3206
(canon task.return (result $t)? $opts (core func $f))
3232
3207
```
3233
-
3234
- In addition to [ general validation of ` $opts ` ] ( #canon-opts ) validation
3235
- specifies:
3236
-
3208
+ validation specifies:
3237
3209
* ` $f ` is given type ` flatten_functype($opts, (func (param $t)?), 'lower') `
3238
3210
* ` $opts ` may only contain ` memory ` , ` string-encoding ` and ` realloc `
3239
3211
@@ -3489,12 +3461,8 @@ For canonical definitions:
3489
3461
(canon stream.read $t $opts (core func $f))
3490
3462
(canon stream.write $t $opts (core func $f))
3491
3463
```
3492
- In addition to [ general validation of ` $opts ` ] ( #canon-opts ) validation
3493
- specifies:
3464
+ validation specifies:
3494
3465
* ` $f ` is given type ` (func (param i32 i32 i32) (result i32)) `
3495
- * ` memory ` is required for ` stream.write ` if required by lowering
3496
- * ` memory ` is required for ` stream.read ` if required by lifting
3497
- * ` realloc ` is required for ` stream.read ` if required by lifting
3498
3466
3499
3467
For canonical definitions:
3500
3468
``` wat
@@ -3503,9 +3471,6 @@ For canonical definitions:
3503
3471
```
3504
3472
validation specifies:
3505
3473
* ` $f ` is given type ` (func (param i32 i32) (result i32)) `
3506
- * ` memory ` is required for ` future.write ` if required by lowering
3507
- * ` memory ` is required for ` future.read ` if required by lifting
3508
- * ` realloc ` is required for ` future.read ` if required by lifting
3509
3474
3510
3475
The implementation of these four built-ins all funnel down to a single
3511
3476
parameterized ` copy ` function:
@@ -3739,8 +3704,6 @@ For a canonical definition:
3739
3704
```
3740
3705
validation specifies:
3741
3706
* ` $f ` is given type ` (func (param i32 i32) (result i32)) `
3742
- * ` async ` is not present
3743
- * ` memory ` must be present
3744
3707
3745
3708
Calling ` $f ` calls the following function which uses the ` $opts ` immediate to
3746
3709
(non-deterministically) lift the debug message, create a new ` ErrorContext `
@@ -3780,9 +3743,6 @@ For a canonical definition:
3780
3743
```
3781
3744
validation specifies:
3782
3745
* ` $f ` is given type ` (func (param i32 i32)) `
3783
- * ` async ` is not present
3784
- * ` memory ` must be present
3785
- * ` realloc ` must be present
3786
3746
3787
3747
Calling ` $f ` calls the following function which uses the ` $opts ` immediate to
3788
3748
lowers the ` ErrorContext ` 's debug message. While * producing* an ` error-context `
0 commit comments