wasm-micro-runtime/core/iwasm/fast-jit/fe
Wenyong Huang 313ce8cb61
Fix memory/table segment checks in memory.init/table.init (#3081)
According to the wasm core spec, the checks for the table segments in
`table.init` opcode are similar to the checks for `memory.init` opcode:
- The size of a passive segment is shrunk to zero after `data.drop`
  (or `elem.drop`) opcode is executed, and the segment can be used to do
  `memory.init` (or `table.init`) again
- The `memory.init` only traps when `s+n > len(data.data)` or `d+n > len(mem.data)`
  and `table.init` only traps when `s+n > len(elem.elem)` or `d+n > len(tab.elem)`
- The active segment can also be used to do `memory.init` (or `table.init`),
  while it behaves like a dropped passive segment

https://github.com/WebAssembly/bulk-memory-operations/blob/master/proposals/bulk-memory-operations/Overview.md
```
Segments can also be shrunk to size zero by using the following new instructions:
- data.drop: discard the data in an data segment
- elem.drop: discard the data in an element segment

An active segment is equivalent to a passive segment, but with an implicit
memory.init followed by a data.drop (or table.init followed by a elem.drop)
that is prepended to the module's start function.
```
ps.
https://webassembly.github.io/spec/core/bikeshed/#-hrefsyntax-instr-memorymathsfmemoryinitx%E2%91%A0
https://webassembly.github.io/spec/core/bikeshed/#-hrefsyntax-instr-tablemathsftableinitxy%E2%91%A0
https://github.com/bytecodealliance/wasm-micro-runtime/issues/3020
2024-01-26 09:45:59 +08:00
..
jit_emit_compare.c Fix invalid use of jit_reg_is_const_val in fast-jit (#2718) 2023-11-03 14:25:26 +08:00
jit_emit_compare.h Import WAMR Fast JIT (#1343) 2022-08-02 16:03:50 +08:00
jit_emit_const.c Import WAMR Fast JIT (#1343) 2022-08-02 16:03:50 +08:00
jit_emit_const.h Import WAMR Fast JIT (#1343) 2022-08-02 16:03:50 +08:00
jit_emit_control.c Enhancements on wasm function execution time statistic (#2985) 2024-01-17 09:51:54 +08:00
jit_emit_control.h Import WAMR Fast JIT (#1343) 2022-08-02 16:03:50 +08:00
jit_emit_conversion.c Fix fast-jit f32/f64 truncate to i32/i64 (#2671) 2023-10-27 12:20:25 +08:00
jit_emit_conversion.h Import WAMR Fast JIT (#1343) 2022-08-02 16:03:50 +08:00
jit_emit_exception.c Refactor interpreter/AOT module instance layout (#1559) 2022-10-18 10:59:28 +08:00
jit_emit_exception.h Import WAMR Fast JIT (#1343) 2022-08-02 16:03:50 +08:00
jit_emit_function.c Fix fast-jit callnative translation (#2765) 2023-11-15 18:30:51 +08:00
jit_emit_function.h Import WAMR Fast JIT (#1343) 2022-08-02 16:03:50 +08:00
jit_emit_memory.c Fix fast-jit accessing shared memory's fields issue (#2841) 2023-12-01 17:41:24 +08:00
jit_emit_memory.h Implement Fast JIT multi-threading feature (#2134) 2023-04-20 10:09:34 +08:00
jit_emit_numberic.c fast-jit: Fix const shift and const i64 compare issues (#2969) 2024-01-02 17:56:34 +08:00
jit_emit_numberic.h Import WAMR Fast JIT (#1343) 2022-08-02 16:03:50 +08:00
jit_emit_parametric.c Import WAMR Fast JIT (#1343) 2022-08-02 16:03:50 +08:00
jit_emit_parametric.h Import WAMR Fast JIT (#1343) 2022-08-02 16:03:50 +08:00
jit_emit_table.c Fix memory/table segment checks in memory.init/table.init (#3081) 2024-01-26 09:45:59 +08:00
jit_emit_table.h Import WAMR Fast JIT (#1343) 2022-08-02 16:03:50 +08:00
jit_emit_variable.c Implement Fast JIT dump call stack and perf profiling (#1633) 2022-10-27 09:28:32 +08:00
jit_emit_variable.h Import WAMR Fast JIT (#1343) 2022-08-02 16:03:50 +08:00