Skip to content

Commit 4068dbc

Browse files
committed
Wrap long lines in CanonicalABI.md and update one missed constant in last commit
1 parent a6dfd37 commit 4068dbc

File tree

2 files changed

+12
-7
lines changed

2 files changed

+12
-7
lines changed

design/mvp/CanonicalABI.md

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2594,7 +2594,7 @@ after every Latin-1 byte (iterating in reverse to avoid clobbering later
25942594
bytes):
25952595
```python
25962596
def store_string_to_latin1_or_utf16(cx, src, src_code_units):
2597-
assert(src_code_units <= MAX_STRING_BYTE_LENGTH)
2597+
assert(src_code_units <= REALLOC_I32_MAX)
25982598
ptr = cx.opts.realloc(0, 0, 2, src_code_units)
25992599
trap_if(ptr != align_to(ptr, 2))
26002600
trap_if(ptr + src_code_units > len(cx.opts.memory))
@@ -3982,7 +3982,8 @@ For a canonical definition:
39823982
(canon waitable-set.wait $cancellable? (memory $mem) (core func $f))
39833983
```
39843984
validation specifies:
3985-
* `$f` is given type `(func (param $si i32) (param $ptr T) (result i32))` where `T` is `i32`
3985+
* `$f` is given type `(func (param $si i32) (param $ptr T) (result i32))` where
3986+
`T` is `i32`
39863987
* 🐘 - `T` is `i32` or `i64` as determined by the address type of `$mem`
39873988

39883989
Calling `$f` invokes the following function which waits for progress to be made
@@ -4026,7 +4027,8 @@ For a canonical definition:
40264027
(canon waitable-set.poll $cancellable? (memory $mem) (core func $f))
40274028
```
40284029
validation specifies:
4029-
* `$f` is given type `(func (param $si i32) (param $ptr T) (result i32))` where `T` is `i32`
4030+
* `$f` is given type `(func (param $si i32) (param $ptr T) (result i32))` where
4031+
`T` is `i32`
40304032
* 🐘 - `T` is `i32` or `i64` as determined by the address type of `$mem`
40314033

40324034
Calling `$f` invokes the following function, which either returns an event that
@@ -4593,7 +4595,8 @@ validation specifies
45934595
* `$ft` must refer to the type `(func (param $c T))` where `T` is `i32`
45944596
* 🐘 - `T` may be `i32` or `i64`
45954597
* `$ftbl` must refer to a table whose element type matches `funcref`
4596-
* `$new_indirect` is given type `(func (param $fi U) (param $c T) (result i32))` where `T` comes from `$ft`, as described above, and `U` is `i32`
4598+
* `$new_indirect` is given type `(func (param $fi U) (param $c T) (result i32))`
4599+
where `T` comes from `$ft`, as described above, and `U` is `i32`
45974600
* 🐘 - `U` is `i32` or `i64` as determined by `$ftbl`'s address type
45984601

45994602
Calling `$new_indirect` invokes the following function which reads a `funcref`
@@ -4789,7 +4792,8 @@ For a canonical definition:
47894792
(canon error-context.new $opts (core func $f))
47904793
```
47914794
validation specifies:
4792-
* `$f` is given type `(func (param $ptr T) (param $units T) (result i32))` where `T` is `i32`
4795+
* `$f` is given type `(func (param $ptr T) (param $units T) (result i32))` where
4796+
`T` is `i32`
47934797
* 🐘 - `T` is `i32` or `i64` as determined by the `memory` field of `$opts`
47944798
* `async` is not present
47954799
* `memory` must be present
@@ -4887,7 +4891,8 @@ validation specifies:
48874891
* `$ft` must refer to the type `(shared? (func (param $c T)))` where `T` is `i32`
48884892
* 🐘 - `T` may be `i32` or `i64`.
48894893
* `$spawn_ref` is given type
4890-
`(shared? (func (param $f (ref null $ft)) (param $c T) (result $e i32)))` where `T` comes from `$ft` as defined above
4894+
`(shared? (func (param $f (ref null $ft)) (param $c T) (result $e i32)))`
4895+
where `T` comes from `$ft` as defined above
48914896

48924897
When the `shared` immediate is not present, the spawned thread is
48934898
*cooperative*, only switching at specific program points. When the `shared`

design/mvp/canonical-abi/definitions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1575,7 +1575,7 @@ def store_utf8_to_utf16(cx, src, src_code_units):
15751575
return (ptr, code_units)
15761576

15771577
def store_string_to_latin1_or_utf16(cx, src, src_code_units):
1578-
assert(src_code_units <= MAX_STRING_BYTE_LENGTH)
1578+
assert(src_code_units <= REALLOC_I32_MAX)
15791579
ptr = cx.opts.realloc(0, 0, 2, src_code_units)
15801580
trap_if(ptr != align_to(ptr, 2))
15811581
trap_if(ptr + src_code_units > len(cx.opts.memory))

0 commit comments

Comments
 (0)