Add support for multi-memory proposal in classic interpreter (#3742)

Implement multi-memory for classic-interpreter. Support core spec (and bulk memory) opcodes now,
and will support atomic opcodes, and add multi-memory export APIs in the future. 

PS: Multi-memory spec test patched a lot for linking test to adapt for multi-module implementation.
This commit is contained in:
Wenyong Huang
2024-08-21 12:22:23 +08:00
committed by GitHub
parent f4383a9e62
commit 1329e1d3e1
22 changed files with 1658 additions and 262 deletions

View File

@ -94,6 +94,14 @@ extern "C" {
#define SHARED_MEMORY_FLAG 0x02
#define MEMORY64_FLAG 0x04
/**
* In the multi-memory proposal, the memarg in loads and stores are
* reinterpreted as a bitfield, bit 6 serves as a flag indicating the presence
* of the optional memory index, if it is set, then an i32 memory index follows
* after the alignment bitfield
*/
#define OPT_MEMIDX_FLAG 0x40
#define DEFAULT_NUM_BYTES_PER_PAGE 65536
#define DEFAULT_MAX_PAGES 65536
#define DEFAULT_MEM64_MAX_PAGES UINT32_MAX