From 90a35c41bb676b5e68212f63b187d2c50439714c Mon Sep 17 00:00:00 2001 From: Cheng Shao <terrorjack@type.dance> Date: Thu, 19 Sep 2024 18:24:19 +0000 Subject: [PATCH] rts: drop interpretBCO support from non-dyn ways on wasm This commit drops interpretBCO support from non dynamic rts ways on wasm. The bytecode interpreter is only useful when the RTS linker also works, and on wasm it only works for dynamic ways anyway. An additional benefit of dropping interpretBCO is reduction in code size of linked wasm modules, especially since interpretBCO references ffi_call which is an auto-generated large function in libffi-wasm and unused by most user applications. --- rts/Schedule.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/rts/Schedule.c b/rts/Schedule.c index 172f46fa5e4..9a648639284 100644 --- a/rts/Schedule.c +++ b/rts/Schedule.c @@ -485,9 +485,14 @@ run_thread: } case ThreadInterpret: + +#if defined(wasm32_HOST_ARCH) && !defined(DYNAMIC) + barf("bytecode interpreter is unsupported in static RTS on wasm"); +#else cap = interpretBCO(cap); ret = cap->r.rRet; break; +#endif default: barf("schedule: invalid prev_what_next=%u field", prev_what_next); -- GitLab