Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove a few hardcoded spec test knowledge from the core library #3648

Merged
merged 1 commit into from
Jul 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 1 addition & 10 deletions core/iwasm/aot/aot_runtime.c
Original file line number Diff line number Diff line change
Expand Up @@ -1748,16 +1748,7 @@ aot_instantiate(AOTModule *module, AOTModuleInstance *parent,
/* Initialize the thread related data */
if (stack_size == 0)
stack_size = DEFAULT_WASM_STACK_SIZE;
#if WASM_ENABLE_SPEC_TEST != 0
#if WASM_ENABLE_TAIL_CALL == 0
if (stack_size < 128 * 1024)
stack_size = 128 * 1024;
#else
/* Some tail-call cases require large operand stack */
if (stack_size < 10 * 1024 * 1024)
stack_size = 10 * 1024 * 1024;
#endif
#endif

module_inst->default_wasm_stack_size = stack_size;

extra->stack_sizes =
Expand Down
11 changes: 1 addition & 10 deletions core/iwasm/interpreter/wasm_runtime.c
Original file line number Diff line number Diff line change
Expand Up @@ -2990,16 +2990,7 @@ wasm_instantiate(WASMModule *module, WASMModuleInstance *parent,
/* Initialize the thread related data */
if (stack_size == 0)
stack_size = DEFAULT_WASM_STACK_SIZE;
#if WASM_ENABLE_SPEC_TEST != 0
#if WASM_ENABLE_TAIL_CALL == 0
if (stack_size < 128 * 1024)
stack_size = 128 * 1024;
#else
/* Some tail-call cases require large operand stack */
if (stack_size < 10 * 1024 * 1024)
stack_size = 10 * 1024 * 1024;
#endif
#endif

module_inst->default_wasm_stack_size = stack_size;

if (module->malloc_function != (uint32)-1) {
Expand Down
18 changes: 12 additions & 6 deletions tests/wamr-test-suites/spec-test-script/runtest.py
Original file line number Diff line number Diff line change
Expand Up @@ -1159,13 +1159,19 @@ def run_wasm_with_repl(wasm_tempfile, aot_tempfile, opts, r):
if opts.qemu:
tmpfile = f"/tmp/{os.path.basename(tmpfile)}"

if opts.verbose:
cmd_iwasm = [opts.interpreter, "--heap-size=0", "-v=5", "--repl", tmpfile]
else:
cmd_iwasm = [opts.interpreter, "--heap-size=0", "--repl", tmpfile]

cmd_iwasm = [opts.interpreter, "--heap-size=0", "--repl"]
if opts.multi_module:
cmd_iwasm.insert(1, "--module-path=" + (tempfile.gettempdir() if not opts.qemu else "/tmp" ))
cmd_iwasm.append("--module-path=" + (tempfile.gettempdir() if not opts.qemu else "/tmp" ))
if opts.gc:
# our tail-call implementation is known broken.
# work it around by using a huge stack.
# cf. https://github.com/bytecodealliance/wasm-micro-runtime/issues/2231
cmd_iwasm.append("--stack-size=10485760") # 10MB (!)
else:
cmd_iwasm.append("--stack-size=131072") # 128KB
if opts.verbose:
cmd_iwasm.append("-v=5")
cmd_iwasm.append(tmpfile)

if opts.qemu:
if opts.qemu_firmware == '':
Expand Down
Loading