-
Notifications
You must be signed in to change notification settings - Fork 5k
[wasm][coreclr] Interpret everything on wasm #115788
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
base: main
Are you sure you want to change the base?
[wasm][coreclr] Interpret everything on wasm #115788
Conversation
Do not try to setup the jit and use it, instead use the interpreter
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR ensures that on the WebAssembly (WASM) target, the runtime uses the interpreter exclusively and skips loading or invoking the JIT.
- Wraps JIT-loading calls in
#ifndef TARGET_WASM
to disable JIT on WASM - Statically links interpreter startup and
getJit
entry points for WASM incodeman.cpp
- Defines
INTERP_API
for symbol visibility and forces interpretation of all methods ineeinterp.cpp
when building for WASM
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
File | Description |
---|---|
src/coreclr/vm/jitinterface.cpp | Add TARGET_WASM guards to bypass JIT loading and runtime paths |
src/coreclr/vm/codeman.cpp | Conditionally include interpreter headers and stub JIT startup/getJit |
src/coreclr/interpreter/interpretershared.h | Define INTERP_API macro for cross-platform symbol visibility |
src/coreclr/interpreter/eeinterp.cpp | Force doInterpret = true on WASM builds |
Comments suppressed due to low confidence (2)
src/coreclr/vm/jitinterface.cpp:13365
- The preprocessor directive
#elif
without a condition is invalid here. Replace it with#else
or#elif !defined(TARGET_WASM)
to properly handle the non-WASM branch.
#elif // !TARGET_WASM
src/coreclr/vm/codeman.cpp:1781
- This
#elif
directive is missing an expression and will not compile. Use#else
to cover the non-WASM case.
#elif
Tagging subscribers to this area: @BrzVlad, @janvorli, @kg |
The armel build was broken in main too and was fixed with #115767 |
{ | ||
EEPOLICY_HANDLE_FATAL_ERROR_WITH_MESSAGE(COR_E_EXECUTIONENGINE, W("Failed to load interpreter")); | ||
} | ||
#endif // FEATURE_INTERPRETER | ||
|
||
#ifndef TARGET_WASM |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we add FEATURE_JIT
and start moving JIT specific code under it over time? I expect we will want to compile for both iOS and Wasm with FEATURE_JIT
undefined eventually.
@@ -1827,7 +1839,11 @@ static void LoadAndInitializeJIT(LPCWSTR pwzJitName DEBUGARG(LPCWSTR pwzJitPath) | |||
EX_TRY | |||
{ | |||
typedef void (* pjitStartup)(ICorJitHost*); | |||
#ifdef TARGET_WASM |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar here, we may want to introduce a named define for everything statically linked together.
We have FEATURE_MERGE_JIT_AND_ENGINE
to do this for the JIT that we may be able to reuse here (we can rename it to avoid confusion if it applies to both JIT and interpreter).
Do not try to setup the jit and use it, instead use the interpreter