-
Notifications
You must be signed in to change notification settings - Fork 5.2k
[RyuJit/WASM] Create a WASM-targeting RyuJit #121341
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?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -22,7 +22,7 @@ function(create_standalone_jit) | |
|
|
||
| if(TARGETDETAILS_OS STREQUAL "unix_osx" OR TARGETDETAILS_OS STREQUAL "unix_anyos") | ||
| set(JIT_ARCH_LINK_LIBRARIES gcinfo_unix_${TARGETDETAILS_ARCH}) | ||
| else() | ||
| elseif(NOT ${TARGETDETAILS_ARCH} MATCHES "wasm") | ||
| set(JIT_ARCH_LINK_LIBRARIES gcinfo_${TARGETDETAILS_OS}_${TARGETDETAILS_ARCH}) | ||
| endif() | ||
|
|
||
|
|
@@ -53,6 +53,9 @@ function(create_standalone_jit) | |
| elseif(TARGETDETAILS_ARCH STREQUAL "riscv64") | ||
| set(JIT_ARCH_SOURCES ${JIT_RISCV64_SOURCES}) | ||
| set(JIT_ARCH_HEADERS ${JIT_RISCV64_HEADERS}) | ||
| elseif(TARGETDETAILS_ARCH STREQUAL "wasm") | ||
| set(JIT_ARCH_SOURCES ${JIT_WASM_SOURCES}) | ||
| set(JIT_ARCH_HEADERS ${JIT_WASM_HEADERS}) | ||
| else() | ||
| clr_unknown_arch() | ||
| endif() | ||
|
|
@@ -94,7 +97,6 @@ set( JIT_SOURCES | |
| block.cpp | ||
| buildstring.cpp | ||
| codegencommon.cpp | ||
| codegenlinear.cpp | ||
| compiler.cpp | ||
| copyprop.cpp | ||
| debuginfo.cpp | ||
|
|
@@ -115,8 +117,6 @@ set( JIT_SOURCES | |
| fgstmt.cpp | ||
| flowgraph.cpp | ||
| forwardsub.cpp | ||
| gcdecode.cpp | ||
| gcencode.cpp | ||
| gcinfo.cpp | ||
| gentree.cpp | ||
| gschecks.cpp | ||
|
|
@@ -145,8 +145,6 @@ set( JIT_SOURCES | |
| liveness.cpp | ||
| loopcloning.cpp | ||
| lower.cpp | ||
| lsra.cpp | ||
| lsrabuild.cpp | ||
| morph.cpp | ||
| morphblock.cpp | ||
| objectalloc.cpp | ||
|
|
@@ -163,8 +161,6 @@ set( JIT_SOURCES | |
| rangecheckcloning.cpp | ||
| rationalize.cpp | ||
| redundantbranchopts.cpp | ||
| regalloc.cpp | ||
| regMaskTPOps.cpp | ||
| regset.cpp | ||
| scev.cpp | ||
| scopeinfo.cpp | ||
|
|
@@ -178,11 +174,21 @@ set( JIT_SOURCES | |
| stacklevelsetter.cpp | ||
| switchrecognition.cpp | ||
| treelifeupdater.cpp | ||
| unwind.cpp | ||
| utils.cpp | ||
| valuenum.cpp | ||
| ) | ||
|
|
||
| set ( JIT_NATIVE_TARGET_SOURCES | ||
| lsra.cpp | ||
| lsrabuild.cpp | ||
| regalloc.cpp | ||
| regMaskTPOps.cpp | ||
| codegenlinear.cpp | ||
| gcdecode.cpp | ||
| gcencode.cpp | ||
| unwind.cpp | ||
| ) | ||
|
|
||
| if (CLR_CMAKE_TARGET_WIN32) | ||
| # Append clrjit.natvis file | ||
| list (APPEND JIT_SOURCES | ||
|
|
@@ -192,6 +198,7 @@ endif(CLR_CMAKE_TARGET_WIN32) | |
| # Define all the architecture-specific source files | ||
|
|
||
| set( JIT_AMD64_SOURCES | ||
| ${JIT_NATIVE_TARGET_SOURCES} | ||
| codegenxarch.cpp | ||
| emitxarch.cpp | ||
| lowerxarch.cpp | ||
|
|
@@ -205,6 +212,7 @@ set( JIT_AMD64_SOURCES | |
| ) | ||
|
|
||
| set( JIT_ARM_SOURCES | ||
| ${JIT_NATIVE_TARGET_SOURCES} | ||
| codegenarmarch.cpp | ||
| codegenarm.cpp | ||
| decomposelongs.cpp | ||
|
|
@@ -217,6 +225,7 @@ set( JIT_ARM_SOURCES | |
| ) | ||
|
|
||
| set( JIT_I386_SOURCES | ||
| ${JIT_NATIVE_TARGET_SOURCES} | ||
| codegenxarch.cpp | ||
| decomposelongs.cpp | ||
| emitxarch.cpp | ||
|
|
@@ -231,6 +240,7 @@ set( JIT_I386_SOURCES | |
| ) | ||
|
|
||
| set( JIT_ARM64_SOURCES | ||
| ${JIT_NATIVE_TARGET_SOURCES} | ||
| codegenarmarch.cpp | ||
| codegenarm64.cpp | ||
| codegenarm64test.cpp | ||
|
|
@@ -260,6 +270,7 @@ set( JIT_POWERPC64_SOURCES | |
| ) | ||
|
|
||
| set( JIT_LOONGARCH64_SOURCES | ||
| ${JIT_NATIVE_TARGET_SOURCES} | ||
| codegenloongarch64.cpp | ||
| emitloongarch64.cpp | ||
| lowerloongarch64.cpp | ||
|
|
@@ -269,6 +280,7 @@ set( JIT_LOONGARCH64_SOURCES | |
| ) | ||
|
|
||
| set( JIT_RISCV64_SOURCES | ||
| ${JIT_NATIVE_TARGET_SOURCES} | ||
| codegenriscv64.cpp | ||
| emitriscv64.cpp | ||
| lowerriscv64.cpp | ||
|
|
@@ -277,6 +289,14 @@ set( JIT_RISCV64_SOURCES | |
| unwindriscv64.cpp | ||
| ) | ||
|
|
||
| set( JIT_WASM_SOURCES | ||
| codegenwasm.cpp | ||
| emitwasm.cpp | ||
| lowerwasm.cpp | ||
| regallocwasm.cpp | ||
| targetwasm.cpp | ||
| ) | ||
|
|
||
| # We include the headers here for better experience in IDEs. | ||
| set( JIT_HEADERS | ||
| ../inc/corinfo.h | ||
|
|
@@ -448,6 +468,15 @@ set( JIT_RISCV64_HEADERS | |
| registerriscv64.h | ||
| ) | ||
|
|
||
| set( JIT_WASM_HEADERS | ||
| regallocwasm.h | ||
| targetwasm.h | ||
| emitwasm.h | ||
| emitfmtswasm.h | ||
| instrswasm.h | ||
| registerwasm.h | ||
| ) | ||
|
|
||
| convert_to_absolute_path(JIT_SOURCES ${JIT_SOURCES}) | ||
| convert_to_absolute_path(JIT_HEADERS ${JIT_HEADERS}) | ||
| convert_to_absolute_path(JIT_RESOURCES ${JIT_RESOURCES}) | ||
|
|
@@ -470,6 +499,8 @@ convert_to_absolute_path(JIT_LOONGARCH64_SOURCES ${JIT_LOONGARCH64_SOURCES}) | |
| convert_to_absolute_path(JIT_LOONGARCH64_HEADERS ${JIT_LOONGARCH64_HEADERS}) | ||
| convert_to_absolute_path(JIT_RISCV64_SOURCES ${JIT_RISCV64_SOURCES}) | ||
| convert_to_absolute_path(JIT_RISCV64_HEADERS ${JIT_RISCV64_HEADERS}) | ||
| convert_to_absolute_path(JIT_WASM_SOURCES ${JIT_WASM_SOURCES}) | ||
| convert_to_absolute_path(JIT_WASM_HEADERS ${JIT_WASM_HEADERS}) | ||
|
|
||
| if(CLR_CMAKE_TARGET_ARCH_AMD64) | ||
| set(JIT_ARCH_SOURCES ${JIT_AMD64_SOURCES}) | ||
|
|
@@ -499,13 +530,12 @@ elseif(CLR_CMAKE_TARGET_ARCH_RISCV64) | |
| set(JIT_ARCH_SOURCES ${JIT_RISCV64_SOURCES}) | ||
| set(JIT_ARCH_HEADERS ${JIT_RISCV64_HEADERS}) | ||
| elseif(CLR_CMAKE_TARGET_ARCH_WASM) | ||
| set(JIT_ARCH_SOURCES ${JIT_WASM32_SOURCES}) | ||
| set(JIT_ARCH_HEADERS ${JIT_WASM32_HEADERS}) | ||
| set(JIT_ARCH_SOURCES ${JIT_WASM_SOURCES}) | ||
| set(JIT_ARCH_HEADERS ${JIT_WASM_HEADERS}) | ||
| else() | ||
| clr_unknown_arch() | ||
| endif() | ||
|
|
||
|
|
||
| set(JIT_DLL_MAIN_FILE ${CMAKE_CURRENT_LIST_DIR}/dllmain.cpp) | ||
|
|
||
| if(CLR_CMAKE_HOST_WIN32) | ||
|
|
@@ -623,7 +653,12 @@ function(add_jit jitName) | |
| target_compile_definitions(${jitName} PRIVATE JIT_STANDALONE_BUILD) | ||
|
|
||
| # add the install targets | ||
| install_clr(TARGETS ${jitName} DESTINATIONS . COMPONENT alljits) | ||
| if (${jitName} MATCHES "clrjit_universal_wasm") | ||
| # TODO-WASM: add the WASM Jit to alljits once that becomes necessary. | ||
| install_clr(TARGETS ${jitName} DESTINATIONS . COMPONENT wasmjit) | ||
| else() | ||
| install_clr(TARGETS ${jitName} DESTINATIONS . COMPONENT alljits) | ||
| endif() | ||
| endfunction() | ||
|
|
||
| set(JIT_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}) | ||
|
|
@@ -653,6 +688,7 @@ add_pgo(clrjit) | |
|
|
||
| if (CLR_CMAKE_TARGET_ARCH_ARM64 OR CLR_CMAKE_TARGET_ARCH_AMD64) | ||
| create_standalone_jit(TARGET clrjit_universal_arm64_${ARCH_HOST_NAME} OS universal ARCH arm64) | ||
| create_standalone_jit(TARGET clrjit_universal_wasm_${ARCH_HOST_NAME} OS universal ARCH wasm) | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I went back and forth a bit on whether to use the "more proper" |
||
| create_standalone_jit(TARGET clrjit_unix_x64_${ARCH_HOST_NAME} OS unix_anyos ARCH x64) | ||
| create_standalone_jit(TARGET clrjit_win_x64_${ARCH_HOST_NAME} OS win ARCH x64) | ||
| if (CLR_CMAKE_BUILD_COMMUNITY_ALTJITS EQUAL 1) | ||
|
|
@@ -678,13 +714,13 @@ if (CLR_CMAKE_TARGET_ARCH_I386 AND CLR_CMAKE_TARGET_UNIX) | |
| endif (CLR_CMAKE_TARGET_ARCH_I386 AND CLR_CMAKE_TARGET_UNIX) | ||
|
|
||
| if (CLR_CMAKE_TARGET_UNIX) | ||
| if (NOT ARCH_TARGET_NAME STREQUAL s390x AND NOT ARCH_TARGET_NAME STREQUAL armv6 AND NOT ARCH_TARGET_NAME STREQUAL ppc64le AND NOT ARCH_TARGET_NAME STREQUAL riscv64) | ||
| if (NOT ARCH_TARGET_NAME STREQUAL s390x AND NOT ARCH_TARGET_NAME STREQUAL armv6 AND NOT ARCH_TARGET_NAME STREQUAL ppc64le AND NOT ARCH_TARGET_NAME STREQUAL riscv64 AND NOT ARCH_TARGET_NAME STREQUAL wasm) | ||
| if(CLR_CMAKE_TARGET_ARCH_ARM OR CLR_CMAKE_TARGET_ARCH_ARM64) | ||
| install_clr(TARGETS clrjit_universal_${ARCH_TARGET_NAME}_${ARCH_HOST_NAME} DESTINATIONS . COMPONENT jit) | ||
| else() | ||
| install_clr(TARGETS clrjit_unix_${ARCH_TARGET_NAME}_${ARCH_HOST_NAME} DESTINATIONS . COMPONENT jit) | ||
| endif() | ||
| endif(NOT ARCH_TARGET_NAME STREQUAL s390x AND NOT ARCH_TARGET_NAME STREQUAL armv6 AND NOT ARCH_TARGET_NAME STREQUAL ppc64le AND NOT ARCH_TARGET_NAME STREQUAL riscv64) | ||
| endif() | ||
| endif() | ||
|
|
||
| if (CLR_CMAKE_TARGET_WIN32 AND CLR_CMAKE_PGO_INSTRUMENT) | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.