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:
@ -14,7 +14,7 @@ import time
|
||||
|
||||
"""
|
||||
The script itself has to be put under the same directory with the "spec".
|
||||
To run a single non-GC and non-memory64 case with interpreter mode:
|
||||
To run a single non-GC case with interpreter mode:
|
||||
cd workspace
|
||||
python3 runtest.py --wast2wasm wabt/bin/wat2wasm --interpreter iwasm \
|
||||
spec/test/core/xxx.wast
|
||||
@ -22,7 +22,7 @@ To run a single non-GC case with aot mode:
|
||||
cd workspace
|
||||
python3 runtest.py --aot --wast2wasm wabt/bin/wat2wasm --interpreter iwasm \
|
||||
--aot-compiler wamrc spec/test/core/xxx.wast
|
||||
To run a single GC case or single memory64 case:
|
||||
To run a single GC case case:
|
||||
cd workspace
|
||||
python3 runtest.py --wast2wasm spec/interpreter/wasm --interpreter iwasm \
|
||||
--aot-compiler wamrc --gc spec/test/core/xxx.wast
|
||||
@ -79,6 +79,7 @@ def ignore_the_case(
|
||||
simd_flag=False,
|
||||
gc_flag=False,
|
||||
memory64_flag=False,
|
||||
multi_memory_flag=False,
|
||||
xip_flag=False,
|
||||
eh_flag=False,
|
||||
qemu_flag=False,
|
||||
@ -165,6 +166,7 @@ def test_case(
|
||||
verbose_flag=True,
|
||||
gc_flag=False,
|
||||
memory64_flag=False,
|
||||
multi_memory_flag=False,
|
||||
qemu_flag=False,
|
||||
qemu_firmware="",
|
||||
log="",
|
||||
@ -223,6 +225,9 @@ def test_case(
|
||||
if memory64_flag:
|
||||
CMD.append("--memory64")
|
||||
|
||||
if multi_memory_flag:
|
||||
CMD.append("--multi-memory")
|
||||
|
||||
if log != "":
|
||||
CMD.append("--log-dir")
|
||||
CMD.append(log)
|
||||
@ -291,6 +296,7 @@ def test_suite(
|
||||
verbose_flag=True,
|
||||
gc_flag=False,
|
||||
memory64_flag=False,
|
||||
multi_memory_flag=False,
|
||||
parl_flag=False,
|
||||
qemu_flag=False,
|
||||
qemu_firmware="",
|
||||
@ -316,6 +322,10 @@ def test_suite(
|
||||
eh_case_list_include = [test for test in eh_case_list if test.stem in ["throw", "tag", "try_catch", "rethrow", "try_delegate"]]
|
||||
case_list.extend(eh_case_list_include)
|
||||
|
||||
if multi_memory_flag:
|
||||
multi_memory_list = sorted(suite_path.glob("multi-memory/*.wast"))
|
||||
case_list.extend(multi_memory_list)
|
||||
|
||||
# ignore based on command line options
|
||||
filtered_case_list = []
|
||||
for case_path in case_list:
|
||||
@ -330,6 +340,7 @@ def test_suite(
|
||||
simd_flag,
|
||||
gc_flag,
|
||||
memory64_flag,
|
||||
multi_memory_flag,
|
||||
xip_flag,
|
||||
eh_flag,
|
||||
qemu_flag,
|
||||
@ -366,6 +377,7 @@ def test_suite(
|
||||
verbose_flag,
|
||||
gc_flag,
|
||||
memory64_flag,
|
||||
multi_memory_flag,
|
||||
qemu_flag,
|
||||
qemu_firmware,
|
||||
log,
|
||||
@ -408,6 +420,7 @@ def test_suite(
|
||||
verbose_flag,
|
||||
gc_flag,
|
||||
memory64_flag,
|
||||
multi_memory_flag,
|
||||
qemu_flag,
|
||||
qemu_firmware,
|
||||
log,
|
||||
@ -546,6 +559,13 @@ def main():
|
||||
dest="memory64_flag",
|
||||
help="Running with memory64 feature",
|
||||
)
|
||||
parser.add_argument(
|
||||
"--multi-memory",
|
||||
action="store_true",
|
||||
default=False,
|
||||
dest="multi_memory_flag",
|
||||
help="Running with multi-memory feature",
|
||||
)
|
||||
parser.add_argument(
|
||||
"cases",
|
||||
metavar="path_to__case",
|
||||
@ -591,6 +611,7 @@ def main():
|
||||
options.verbose_flag,
|
||||
options.gc_flag,
|
||||
options.memory64_flag,
|
||||
options.multi_memory_flag,
|
||||
options.parl_flag,
|
||||
options.qemu_flag,
|
||||
options.qemu_firmware,
|
||||
@ -619,6 +640,7 @@ def main():
|
||||
options.verbose_flag,
|
||||
options.gc_flag,
|
||||
options.memory64_flag,
|
||||
options.multi_memory_flag,
|
||||
options.qemu_flag,
|
||||
options.qemu_firmware,
|
||||
options.log,
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -327,6 +327,9 @@ parser.add_argument('--gc', default=False, action='store_true',
|
||||
parser.add_argument('--memory64', default=False, action='store_true',
|
||||
help='Test with Memory64')
|
||||
|
||||
parser.add_argument('--multi-memory', default=False, action='store_true',
|
||||
help='Test with multi-memory(with multi-module auto enabled)')
|
||||
|
||||
parser.add_argument('--qemu', default=False, action='store_true',
|
||||
help="Enable QEMU")
|
||||
|
||||
@ -1097,6 +1100,8 @@ def compile_wast_to_wasm(form, wast_tempfile, wasm_tempfile, opts):
|
||||
cmd = [opts.wast2wasm, "--enable-threads", "--no-check", "--enable-exceptions", "--enable-tail-call", wast_tempfile, "-o", wasm_tempfile ]
|
||||
elif opts.memory64:
|
||||
cmd = [opts.wast2wasm, "--enable-memory64", "--no-check", wast_tempfile, "-o", wasm_tempfile ]
|
||||
elif opts.multi_memory:
|
||||
cmd = [opts.wast2wasm, "--enable-multi-memory", "--no-check", wast_tempfile, "-o", wasm_tempfile ]
|
||||
else:
|
||||
cmd = [opts.wast2wasm, "--enable-threads", "--no-check",
|
||||
wast_tempfile, "-o", wasm_tempfile ]
|
||||
|
||||
Reference in New Issue
Block a user