Skip to content

Commit 2bf9283

Browse files
committed
Fix inconsistencies in CanonicalABI.md with definitions.py
1 parent fd7ddaa commit 2bf9283

2 files changed

Lines changed: 11 additions & 11 deletions

File tree

design/mvp/CanonicalABI.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -565,7 +565,7 @@ per `ResourceHandle`.
565565

566566
The `num_lends` field maintains a conservative approximation of the number of
567567
live handles that were lent from this `own` handle (by calls to `borrow`-taking
568-
functions). This count is maintained by the `ImportCall` bookkeeping functions
568+
functions). This count is maintained by the `Subtask` bookkeeping functions
569569
(above) and is ensured to be zero when an `own` handle is dropped.
570570

571571
The `ResourceType` class represents a runtime instance of a resource type that
@@ -666,7 +666,7 @@ class Thread:
666666
The `index` field stores the index of the thread in its containing component
667667
instance's `threads` table and is initialized only once a thread is allowed to
668668
start executing (after the backpressure gate). The `storage` field holds the
669-
[thread-local storage] accessed by the `storage.{get,set}` built-ins. All the
669+
[thread-local storage] accessed by the `context.{get,set}` built-ins. All the
670670
other fields are used directly by `Thread` methods as shown next.
671671

672672
When a `Thread` is created, an internal `threading.Thread` is started and
@@ -1765,7 +1765,7 @@ class SharedFutureImpl(ReadableFuture, WritableFuture):
17651765
pending_on_copy_done(result)
17661766

17671767
def cancel(self):
1768-
self.reset_pending_and_notify_pending(CopyResult.CANCELLED)
1768+
self.reset_and_notify_pending(CopyResult.CANCELLED)
17691769
```
17701770
Dropping works the same in futures as in streams, except that a future
17711771
writable end cannot be dropped without having written a value. This is guarded
@@ -2439,7 +2439,7 @@ The integral value of a `char` (a [Unicode Scalar Value]) is a valid unsigned
24392439
```python
24402440
def char_to_i32(c):
24412441
i = ord(c)
2442-
assert(0 <= i <= 0xD7FF or 0xD800 <= i <= 0x10FFFF)
2442+
assert(0 <= i <= 0xD7FF or 0xE000 <= i <= 0x10FFFF)
24432443
return i
24442444
```
24452445

@@ -2839,7 +2839,7 @@ def flatten_types(ts, opts):
28392839
return [ft for t in ts for ft in flatten_type(t, opts)]
28402840
```
28412841
As shown here, the core signatures `async` functions use a lower limit on the
2842-
maximum number of parameters (1) and results (0) passed as scalars before
2842+
maximum number of parameters (4) and results (0) passed as scalars before
28432843
falling back to passing through memory.
28442844

28452845
Presenting the definition of `flatten_type` piecewise, we start with the
@@ -3366,7 +3366,7 @@ In both of the `async` cases below (with or without `callback`), the
33663366
`task.return` built-in must be called, providing the return value as core wasm
33673367
*parameters* to the `task.return` built-in (rather than as core function
33683368
results as in the synchronous case). If `task.return` is *not* called by the
3369-
time the `Task`'s last `Thread` exits, there is a trap (in `Task.thread_stop`).
3369+
time the `Task`'s last `Thread` exits, there is a trap (in `Task.unregister_thread`).
33703370

33713371
In the `async` non-`callback` ("stackful async") case, there is a single call
33723372
to the core wasm callee which must return empty core results. Waiting for async
@@ -4491,13 +4491,13 @@ If the copy hasn't been cancelled, the synchronous case suspends the thread to
44914491
wait for one of the `on_*` callbacks to eventually be called (which will set
44924492
the pending event).
44934493

4494-
The asynchronous case simply returns `BLOCKING` and the client code must wait
4494+
The asynchronous case simply returns `BLOCKED` and the client code must wait
44954495
as usual for a `{STREAM,FUTURE}_{READ,WRITE}` event. In this case, cancellation
44964496
has served only to asynchronously request that the host relinquish the buffer
44974497
ASAP without waiting for anything to be read or written.
44984498

4499-
If `BLOCKING` is *not* returned, the pending event (which is necessarily a
4500-
`stream_event`) is eagerly delivered to core wasm as the return value, thereby
4499+
If `BLOCKED` is *not* returned, the pending event (which is necessarily a
4500+
`stream_event` or `future_event`) is eagerly delivered to core wasm as the return value, thereby
45014501
saving an additional turn of the event loop. In this case, the core wasm
45024502
caller can assume that ownership of the buffer has been returned.
45034503

design/mvp/canonical-abi/definitions.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -989,7 +989,7 @@ def reset_and_notify_pending(self, result):
989989
pending_on_copy_done(result)
990990

991991
def cancel(self):
992-
self.reset_pending_and_notify_pending(CopyResult.CANCELLED)
992+
self.reset_and_notify_pending(CopyResult.CANCELLED)
993993

994994
def drop(self):
995995
if not self.dropped:
@@ -1453,7 +1453,7 @@ def core_i64_reinterpret_f64(f):
14531453

14541454
def char_to_i32(c):
14551455
i = ord(c)
1456-
assert(0 <= i <= 0xD7FF or 0xD800 <= i <= 0x10FFFF)
1456+
assert(0 <= i <= 0xD7FF or 0xE000 <= i <= 0x10FFFF)
14571457
return i
14581458

14591459
def store_string(cx, v: String, ptr):

0 commit comments

Comments
 (0)