From cc1112ad32d13a67fe2534a4e47e3177e736f95b Mon Sep 17 00:00:00 2001 From: Sam Clegg Date: Fri, 8 Jul 2022 12:01:04 -0700 Subject: [PATCH] Remove special handling of stackSave/stackRestore/stackAlloc (#17399) There is no different between how these symbols are handled under the standard an minimal runtime (unlike the other symbols that are added separately there). I'm working changes to remove all the different in the library vs runtime split that exist between minimal runtime and regular runtime. For most symbols this means moving them to JS library functions but for these three they are already handled the same in both runtimes. --- src/modules.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/modules.js b/src/modules.js index 0e154d116618b..159c7b23dd219 100644 --- a/src/modules.js +++ b/src/modules.js @@ -446,6 +446,11 @@ function exportRuntime() { 'abort', 'keepRuntimeAlive', 'wasmMemory', + // These last three are actually native wasm functions these days but we + // allow exporting them via EXPORTED_RUNTIME_METHODS for backwards compat. + 'stackSave', + 'stackRestore', + 'stackAlloc', ]; if (USE_PTHREADS && ALLOW_MEMORY_GROWTH) { @@ -473,9 +478,6 @@ function exportRuntime() { runtimeElements = runtimeElements.concat([ 'run', 'warnOnce', - 'stackSave', - 'stackRestore', - 'stackAlloc', 'AsciiToString', 'stringToAscii', 'UTF16ToString',