@@ -183,12 +183,12 @@ as an operand to `memory.init` or `table.init`.
183
183
184
184
Segments can also be discarded by using the following new instructions:
185
185
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
188
188
189
189
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.
192
192
193
193
The new encoding of a data segment is now:
194
194
@@ -261,23 +261,23 @@ target offset, and length as given by the `memory.init` operands.
261
261
It is a validation error to use ` memory.init ` with an out-of-bounds segment index.
262
262
263
263
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
265
265
active segments that were dropped after being copied into memory during module
266
266
instantiation.
267
267
* any of the accessed bytes lies outside the source data segment or the target memory
268
268
269
269
Note that it is allowed to use ` memory.init ` on the same data segment more than
270
270
once.
271
271
272
- ### ` memory .drop` instruction
272
+ ### ` data .drop` instruction
273
273
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
275
275
data segment has been dropped, it is no longer valid to use it in a ` memory.init `
276
276
instruction. This instruction is intended to be used as an optimization hint to
277
277
the WebAssembly implementation. After a memory segment is dropped its data can
278
278
no longer be retrieved, so the memory used by this segment may be freed.
279
279
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.
281
281
282
282
A trap occurs if the segment was already dropped. This includes active segments
283
283
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
307
307
- top-1: byte value to set
308
308
- top-0: size of memory region in bytes
309
309
310
- ### ` table.init ` , ` table .drop` , and ` table.copy ` instructions
310
+ ### ` table.init ` , ` elem .drop` , and ` table.copy ` instructions
311
311
312
312
The ` table.* ` instructions behave similary to the ` memory.* ` instructions, with
313
313
the difference that they operate on element segments and tables, instead of
@@ -337,7 +337,7 @@ implemented as follows:
337
337
338
338
;; The memory used by this segment is no longer needed, so this segment can
339
339
;; be dropped.
340
- (memory .drop 1))
340
+ (data .drop 1))
341
341
)
342
342
```
343
343
@@ -354,11 +354,11 @@ instr ::= ...
354
354
| Name | Opcode | Immediate | Description |
355
355
| ---- | ---- | ---- | ---- |
356
356
| ` 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 |
358
358
| ` memory.copy ` | ` 0xfc 0x0a ` | ` memory_src:0x00 ` ` memory_dst:0x00 ` | :thinking : copy from one region of linear memory to another region |
359
359
| ` memory.fill ` | ` 0xfc 0x0b ` | ` memory:0x00 ` | :thinking : fill a region of linear memory with a given byte value |
360
360
| ` 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 |
362
362
| ` table.copy ` | ` 0xfc 0x0e ` | ` table_src:0x00 ` ` table_dst:0x00 ` | :thinking : copy from one region of a table to another region |
363
363
364
364
### ` DataCount ` section
@@ -403,4 +403,4 @@ segments in the `Data` section:
403
403
404
404
It is a validation error if ` count ` is not equal to the number of data segments
405
405
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