Skip to content
This repository was archived by the owner on Nov 3, 2021. It is now read-only.

Commit af60ffe

Browse files
lars-t-hansenbinji
authored andcommitted
Rename memory.drop and table.drop as per agreement (#46)
1 parent 446b9c2 commit af60ffe

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

proposals/bulk-memory-operations/Overview.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -183,12 +183,12 @@ as an operand to `memory.init` or `table.init`.
183183

184184
Segments can also be discarded by using the following new instructions:
185185

186-
* `memory.drop`: prevent further use of a data segment
187-
* `table.drop`: prevent further use of an element segment
186+
* `data.drop`: prevent further use of a data segment
187+
* `elem.drop`: prevent further use of an element segment
188188

189189
An active segment is equivalent to a passive segment, but with an implicit
190-
`memory.init` followed by a `memory.drop` (or `table.init` followed by a
191-
`table.drop`) that is prepended to the module's start function.
190+
`memory.init` followed by a `data.drop` (or `table.init` followed by a
191+
`elem.drop`) that is prepended to the module's start function.
192192

193193
The new encoding of a data segment is now:
194194

@@ -261,23 +261,23 @@ target offset, and length as given by the `memory.init` operands.
261261
It is a validation error to use `memory.init` with an out-of-bounds segment index.
262262

263263
A trap occurs if:
264-
* the segment is used after it has been dropped via `memory.drop`. This includes
264+
* the segment is used after it has been dropped via `data.drop`. This includes
265265
active segments that were dropped after being copied into memory during module
266266
instantiation.
267267
* any of the accessed bytes lies outside the source data segment or the target memory
268268

269269
Note that it is allowed to use `memory.init` on the same data segment more than
270270
once.
271271

272-
### `memory.drop` instruction
272+
### `data.drop` instruction
273273

274-
The `memory.drop` instruction prevents further use of a given segment. After a
274+
The `data.drop` instruction prevents further use of a given segment. After a
275275
data segment has been dropped, it is no longer valid to use it in a `memory.init`
276276
instruction. This instruction is intended to be used as an optimization hint to
277277
the WebAssembly implementation. After a memory segment is dropped its data can
278278
no longer be retrieved, so the memory used by this segment may be freed.
279279

280-
It is a validation error to use `memory.drop` with an out-of-bounds segment index.
280+
It is a validation error to use `data.drop` with an out-of-bounds segment index.
281281

282282
A trap occurs if the segment was already dropped. This includes active segments
283283
that were dropped after being copied into memory during module instantiation.
@@ -307,7 +307,7 @@ The instruction has the signature `[i32 i32 i32] -> []`. The parameters are, in
307307
- top-1: byte value to set
308308
- top-0: size of memory region in bytes
309309

310-
### `table.init`, `table.drop`, and `table.copy` instructions
310+
### `table.init`, `elem.drop`, and `table.copy` instructions
311311

312312
The `table.*` instructions behave similary to the `memory.*` instructions, with
313313
the difference that they operate on element segments and tables, instead of
@@ -337,7 +337,7 @@ implemented as follows:
337337
338338
;; The memory used by this segment is no longer needed, so this segment can
339339
;; be dropped.
340-
(memory.drop 1))
340+
(data.drop 1))
341341
)
342342
```
343343

@@ -354,11 +354,11 @@ instr ::= ...
354354
| Name | Opcode | Immediate | Description |
355355
| ---- | ---- | ---- | ---- |
356356
| `memory.init` | `0xfc 0x08` | `segment:varuint32`, `memory:0x00` | :thinking: copy from a passive data segment to linear memory |
357-
| `memory.drop` | `0xfc 0x09` | `segment:varuint32` | :thinking: prevent further use of passive data segment |
357+
| `data.drop` | `0xfc 0x09` | `segment:varuint32` | :thinking: prevent further use of passive data segment |
358358
| `memory.copy` | `0xfc 0x0a` | `memory_src:0x00` `memory_dst:0x00` | :thinking: copy from one region of linear memory to another region |
359359
| `memory.fill` | `0xfc 0x0b` | `memory:0x00` | :thinking: fill a region of linear memory with a given byte value |
360360
| `table.init` | `0xfc 0x0c` | `segment:varuint32`, `table:0x00` | :thinking: copy from a passive element segment to a table |
361-
| `table.drop` | `0xfc 0x0d` | `segment:varuint32` | :thinking: prevent further use of a passive element segment |
361+
| `elem.drop` | `0xfc 0x0d` | `segment:varuint32` | :thinking: prevent further use of a passive element segment |
362362
| `table.copy` | `0xfc 0x0e` | `table_src:0x00` `table_dst:0x00` | :thinking: copy from one region of a table to another region |
363363

364364
### `DataCount` section
@@ -403,4 +403,4 @@ segments in the `Data` section:
403403

404404
It is a validation error if `count` is not equal to the number of data segments
405405
in the `Data` section. It is also a validation error if the `DataCount` section
406-
is omitted and a `memory.init` or `memory.drop` instruction is used.
406+
is omitted and a `memory.init` or `data.drop` instruction is used.

0 commit comments

Comments
 (0)