From a65d04673d52a7e2ec4f8060393f29663893a56d Mon Sep 17 00:00:00 2001 From: Radek Doulik Date: Thu, 15 Jan 2026 18:39:34 +0100 Subject: [PATCH 001/123] Fix calls to IL helpers from tailcalls Set `isTailcall` to `false`, when preparing the call. This is similar to how we set other state vars for the call, so I did it this way. Alternatively we can reset the `isTailcall` after updating the stack and frame for tailcalls. That would invalidate the meaning of the variable for the rest of the tailcall though, so we would need to rename it at least to signal, that it is valid only in the beginning of the tailcall. --- src/coreclr/vm/interpexec.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/coreclr/vm/interpexec.cpp b/src/coreclr/vm/interpexec.cpp index acfefa8eb55c8c..616e32eb613b24 100644 --- a/src/coreclr/vm/interpexec.cpp +++ b/src/coreclr/vm/interpexec.cpp @@ -2316,6 +2316,7 @@ void InterpExecMethod(InterpreterFrame *pInterpreterFrame, InterpMethodContextFr targetMethod = pILTargetMethod; ip += 4; + isTailcall = false; goto CALL_INTERP_METHOD; } @@ -2340,6 +2341,7 @@ void InterpExecMethod(InterpreterFrame *pInterpreterFrame, InterpMethodContextFr LOCAL_VAR(callArgsOffset, void*) = helperArg; targetMethod = pILTargetMethod; ip += 4; + isTailcall = false; goto CALL_INTERP_METHOD; } @@ -2367,6 +2369,7 @@ void InterpExecMethod(InterpreterFrame *pInterpreterFrame, InterpMethodContextFr targetMethod = pILTargetMethod; ip += 5; + isTailcall = false; goto CALL_INTERP_METHOD; } @@ -2394,6 +2397,7 @@ void InterpExecMethod(InterpreterFrame *pInterpreterFrame, InterpMethodContextFr targetMethod = pILTargetMethod; ip += 5; + isTailcall = false; goto CALL_INTERP_METHOD; } @@ -2420,6 +2424,7 @@ void InterpExecMethod(InterpreterFrame *pInterpreterFrame, InterpMethodContextFr targetMethod = pILTargetMethod; ip += 5; + isTailcall = false; goto CALL_INTERP_METHOD; } @@ -2448,6 +2453,7 @@ void InterpExecMethod(InterpreterFrame *pInterpreterFrame, InterpMethodContextFr targetMethod = pILTargetMethod; ip += 6; + isTailcall = false; goto CALL_INTERP_METHOD; } @@ -2476,6 +2482,7 @@ void InterpExecMethod(InterpreterFrame *pInterpreterFrame, InterpMethodContextFr targetMethod = pILTargetMethod; ip += 6; + isTailcall = false; goto CALL_INTERP_METHOD; } @@ -2503,6 +2510,7 @@ void InterpExecMethod(InterpreterFrame *pInterpreterFrame, InterpMethodContextFr targetMethod = pILTargetMethod; ip += 5; + isTailcall = false; goto CALL_INTERP_METHOD; } @@ -2532,6 +2540,7 @@ void InterpExecMethod(InterpreterFrame *pInterpreterFrame, InterpMethodContextFr targetMethod = pILTargetMethod; ip += 6; + isTailcall = false; goto CALL_INTERP_METHOD; } @@ -2561,6 +2570,7 @@ void InterpExecMethod(InterpreterFrame *pInterpreterFrame, InterpMethodContextFr targetMethod = pILTargetMethod; ip += 5; + isTailcall = false; goto CALL_INTERP_METHOD; } @@ -2588,6 +2598,7 @@ void InterpExecMethod(InterpreterFrame *pInterpreterFrame, InterpMethodContextFr targetMethod = pILTargetMethod; ip += 4; + isTailcall = false; goto CALL_INTERP_METHOD; } @@ -2613,6 +2624,7 @@ void InterpExecMethod(InterpreterFrame *pInterpreterFrame, InterpMethodContextFr targetMethod = pILTargetMethod; ip += 4; + isTailcall = false; goto CALL_INTERP_METHOD; } @@ -2641,6 +2653,7 @@ void InterpExecMethod(InterpreterFrame *pInterpreterFrame, InterpMethodContextFr targetMethod = pILTargetMethod; ip += 5; + isTailcall = false; goto CALL_INTERP_METHOD; } @@ -3199,6 +3212,7 @@ void InterpExecMethod(InterpreterFrame *pInterpreterFrame, InterpMethodContextFr targetMethod = pILTargetMethod; ip += 5; + isTailcall = false; goto CALL_INTERP_METHOD; } @@ -3243,6 +3257,7 @@ void InterpExecMethod(InterpreterFrame *pInterpreterFrame, InterpMethodContextFr targetMethod = pILTargetMethod; ip += 6; + isTailcall = false; goto CALL_INTERP_METHOD; } @@ -3914,6 +3929,7 @@ do \ pInterpreterFrame->SetContinuation(NULL); targetMethod = pILTargetMethod; ip += ipAdjust; + isTailcall = false; goto CALL_INTERP_METHOD; } From 1016c3c79a68a9cb8303f9e4c572474a5a09f4b3 Mon Sep 17 00:00:00 2001 From: Radek Doulik Date: Mon, 19 Jan 2026 20:56:08 +0100 Subject: [PATCH 002/123] Alternative implementation --- src/coreclr/vm/interpexec.cpp | 72 +++++++++++++---------------------- 1 file changed, 26 insertions(+), 46 deletions(-) diff --git a/src/coreclr/vm/interpexec.cpp b/src/coreclr/vm/interpexec.cpp index 616e32eb613b24..784b224ea45dd4 100644 --- a/src/coreclr/vm/interpexec.cpp +++ b/src/coreclr/vm/interpexec.cpp @@ -912,6 +912,19 @@ static void DECLSPEC_NORETURN HandleInterpreterStackOverflow(InterpreterFrame* p EEPolicy::HandleFatalStackOverflow(&exceptionInfo); } +static void UpdateFrameForTailCall(InterpMethodContextFrame *pFrame, PTR_InterpByteCodeStart targetIp, int8_t *callArgsAddress) +{ + InterpMethod *pTargetMethod = targetIp->Method; + // Move args from callArgsOffset to start of stack frame. + _ASSERTE(pTargetMethod->CheckIntegrity()); + // It is safe to use memcpy because the source and destination are both on the interp stack, not in the GC heap. + // We need to use the target method's argsSize, not our argsSize, because tail calls (unlike CEE_JMP) can have a + // different signature from the caller. + memcpy(pFrame->pStack, callArgsAddress, pTargetMethod->argsSize); + // Reuse current stack frame. We discard the call insn's returnOffset because it's not important and tail calls are + // required to be followed by a ret, so we know nothing is going to read from stack[returnOffset] after the call. + pFrame->ReInit(pFrame->pParent, targetIp, pFrame->pRetVal, pFrame->pStack); +} void InterpExecMethod(InterpreterFrame *pInterpreterFrame, InterpMethodContextFrame *pFrame, InterpThreadContext *pThreadContext, ExceptionClauseArgs *pExceptionClauseArgs) { @@ -967,7 +980,7 @@ void InterpExecMethod(InterpreterFrame *pInterpreterFrame, InterpMethodContextFr } int32_t returnOffset, callArgsOffset, methodSlot; - bool isTailcall = false; + bool frameNeedsTailcallUpdate = false; MethodDesc* targetMethod; SAVE_THE_LOWEST_SP; @@ -2316,7 +2329,6 @@ void InterpExecMethod(InterpreterFrame *pInterpreterFrame, InterpMethodContextFr targetMethod = pILTargetMethod; ip += 4; - isTailcall = false; goto CALL_INTERP_METHOD; } @@ -2341,7 +2353,6 @@ void InterpExecMethod(InterpreterFrame *pInterpreterFrame, InterpMethodContextFr LOCAL_VAR(callArgsOffset, void*) = helperArg; targetMethod = pILTargetMethod; ip += 4; - isTailcall = false; goto CALL_INTERP_METHOD; } @@ -2369,7 +2380,6 @@ void InterpExecMethod(InterpreterFrame *pInterpreterFrame, InterpMethodContextFr targetMethod = pILTargetMethod; ip += 5; - isTailcall = false; goto CALL_INTERP_METHOD; } @@ -2397,7 +2407,6 @@ void InterpExecMethod(InterpreterFrame *pInterpreterFrame, InterpMethodContextFr targetMethod = pILTargetMethod; ip += 5; - isTailcall = false; goto CALL_INTERP_METHOD; } @@ -2424,7 +2433,6 @@ void InterpExecMethod(InterpreterFrame *pInterpreterFrame, InterpMethodContextFr targetMethod = pILTargetMethod; ip += 5; - isTailcall = false; goto CALL_INTERP_METHOD; } @@ -2453,7 +2461,6 @@ void InterpExecMethod(InterpreterFrame *pInterpreterFrame, InterpMethodContextFr targetMethod = pILTargetMethod; ip += 6; - isTailcall = false; goto CALL_INTERP_METHOD; } @@ -2482,7 +2489,6 @@ void InterpExecMethod(InterpreterFrame *pInterpreterFrame, InterpMethodContextFr targetMethod = pILTargetMethod; ip += 6; - isTailcall = false; goto CALL_INTERP_METHOD; } @@ -2510,7 +2516,6 @@ void InterpExecMethod(InterpreterFrame *pInterpreterFrame, InterpMethodContextFr targetMethod = pILTargetMethod; ip += 5; - isTailcall = false; goto CALL_INTERP_METHOD; } @@ -2540,7 +2545,6 @@ void InterpExecMethod(InterpreterFrame *pInterpreterFrame, InterpMethodContextFr targetMethod = pILTargetMethod; ip += 6; - isTailcall = false; goto CALL_INTERP_METHOD; } @@ -2570,7 +2574,6 @@ void InterpExecMethod(InterpreterFrame *pInterpreterFrame, InterpMethodContextFr targetMethod = pILTargetMethod; ip += 5; - isTailcall = false; goto CALL_INTERP_METHOD; } @@ -2598,7 +2601,6 @@ void InterpExecMethod(InterpreterFrame *pInterpreterFrame, InterpMethodContextFr targetMethod = pILTargetMethod; ip += 4; - isTailcall = false; goto CALL_INTERP_METHOD; } @@ -2624,7 +2626,6 @@ void InterpExecMethod(InterpreterFrame *pInterpreterFrame, InterpMethodContextFr targetMethod = pILTargetMethod; ip += 4; - isTailcall = false; goto CALL_INTERP_METHOD; } @@ -2653,7 +2654,6 @@ void InterpExecMethod(InterpreterFrame *pInterpreterFrame, InterpMethodContextFr targetMethod = pILTargetMethod; ip += 5; - isTailcall = false; goto CALL_INTERP_METHOD; } @@ -2666,7 +2666,7 @@ void InterpExecMethod(InterpreterFrame *pInterpreterFrame, InterpMethodContextFr case INTOP_CALLVIRT_TAIL: case INTOP_CALLVIRT: { - isTailcall = (*ip == INTOP_CALLVIRT_TAIL); + frameNeedsTailcallUpdate = (*ip == INTOP_CALLVIRT_TAIL); returnOffset = ip[1]; callArgsOffset = ip[2]; methodSlot = ip[3]; @@ -2691,7 +2691,7 @@ void InterpExecMethod(InterpreterFrame *pInterpreterFrame, InterpMethodContextFr case INTOP_CALLI_TAIL: case INTOP_CALLI: { - isTailcall = (*ip == INTOP_CALLI_TAIL); + frameNeedsTailcallUpdate = (*ip == INTOP_CALLI_TAIL); returnOffset = ip[1]; int8_t* returnValueAddress = LOCAL_VAR_ADDR(returnOffset, int8_t); callArgsOffset = ip[2]; @@ -2725,7 +2725,7 @@ void InterpExecMethod(InterpreterFrame *pInterpreterFrame, InterpMethodContextFr // somewhat expensive, we only do it for tailcalls which are relatively rare. // TODO-Interpreter: It is plausible that we might want to do the NonVirtualEntry2MethodDesc check for non-tailcall calli as well // or possibly a slight variant where we build a path for NonVitualEntry2MethodDesc which is lock-free but might fail - else if (isTailcall && (targetMethod = NonVirtualEntry2MethodDesc(calliFunctionPointer)) != NULL) + else if (frameNeedsTailcallUpdate && (targetMethod = NonVirtualEntry2MethodDesc(calliFunctionPointer)) != NULL) { goto CALL_INTERP_METHOD; } @@ -2754,7 +2754,7 @@ void InterpExecMethod(InterpreterFrame *pInterpreterFrame, InterpMethodContextFr // This opcode handles p/invokes that don't use a managed wrapper for marshaling. These // calls are special in that they need an InlinedCallFrame in order for proper EH to happen - isTailcall = false; + frameNeedsTailcallUpdate = false; returnOffset = ip[1]; callArgsOffset = ip[2]; int8_t* callArgsAddress = LOCAL_VAR_ADDR(callArgsOffset, int8_t); @@ -2787,7 +2787,7 @@ void InterpExecMethod(InterpreterFrame *pInterpreterFrame, InterpMethodContextFr case INTOP_CALLDELEGATE_TAIL: case INTOP_CALLDELEGATE: { - isTailcall = (*ip == INTOP_CALLDELEGATE_TAIL); + frameNeedsTailcallUpdate = (*ip == INTOP_CALLDELEGATE_TAIL); returnOffset = ip[1]; callArgsOffset = ip[2]; methodSlot = ip[3]; @@ -2852,17 +2852,10 @@ void InterpExecMethod(InterpreterFrame *pInterpreterFrame, InterpMethodContextFr { pFrame->ip = ip; InterpMethod* pTargetMethod = targetIp->Method; - if (isTailcall) + if (frameNeedsTailcallUpdate) { - // Move args from callArgsOffset to start of stack frame. - _ASSERTE(pTargetMethod->CheckIntegrity()); - // It is safe to use memcpy because the source and destination are both on the interp stack, not in the GC heap. - // We need to use the target method's argsSize, not our argsSize, because tail calls (unlike CEE_JMP) can have a - // different signature from the caller. - memcpy(pFrame->pStack, LOCAL_VAR_ADDR(callArgsOffset + INTERP_STACK_SLOT_SIZE, int8_t), pTargetMethod->argsSize); - // Reuse current stack frame. We discard the call insn's returnOffset because it's not important and tail calls are - // required to be followed by a ret, so we know nothing is going to read from stack[returnOffset] after the call. - pFrame->ReInit(pFrame->pParent, targetIp, pFrame->pRetVal, pFrame->pStack); + UpdateFrameForTailCall(pFrame, targetIp, LOCAL_VAR_ADDR(callArgsOffset + INTERP_STACK_SLOT_SIZE, int8_t)); + frameNeedsTailcallUpdate = false; } else { @@ -2933,7 +2926,7 @@ void InterpExecMethod(InterpreterFrame *pInterpreterFrame, InterpMethodContextFr case INTOP_CALL_TAIL: case INTOP_CALL: { - isTailcall = (*ip == INTOP_CALL_TAIL); + frameNeedsTailcallUpdate = (*ip == INTOP_CALL_TAIL); returnOffset = ip[1]; callArgsOffset = ip[2]; methodSlot = ip[3]; @@ -2987,18 +2980,11 @@ void InterpExecMethod(InterpreterFrame *pInterpreterFrame, InterpMethodContextFr } } - if (isTailcall) + if (frameNeedsTailcallUpdate) { - // Move args from callArgsOffset to start of stack frame. InterpMethod* pTargetMethod = targetIp->Method; - _ASSERTE(pTargetMethod->CheckIntegrity()); - // It is safe to use memcpy because the source and destination are both on the interp stack, not in the GC heap. - // We need to use the target method's argsSize, not our argsSize, because tail calls (unlike CEE_JMP) can have a - // different signature from the caller. - memcpy(pFrame->pStack, callArgsAddress, pTargetMethod->argsSize); - // Reuse current stack frame. We discard the call insn's returnOffset because it's not important and tail calls are - // required to be followed by a ret, so we know nothing is going to read from stack[returnOffset] after the call. - pFrame->ReInit(pFrame->pParent, targetIp, pFrame->pRetVal, pFrame->pStack); + UpdateFrameForTailCall(pFrame, targetIp, callArgsAddress); + frameNeedsTailcallUpdate = false; } else { @@ -3038,7 +3024,6 @@ void InterpExecMethod(InterpreterFrame *pInterpreterFrame, InterpMethodContextFr } case INTOP_NEWOBJ_GENERIC: { - isTailcall = false; returnOffset = ip[1]; callArgsOffset = ip[2]; methodSlot = ip[4]; @@ -3057,7 +3042,6 @@ void InterpExecMethod(InterpreterFrame *pInterpreterFrame, InterpMethodContextFr } case INTOP_NEWOBJ: { - isTailcall = false; returnOffset = ip[1]; callArgsOffset = ip[2]; methodSlot = ip[3]; @@ -3089,7 +3073,6 @@ void InterpExecMethod(InterpreterFrame *pInterpreterFrame, InterpMethodContextFr } case INTOP_NEWOBJ_VT: { - isTailcall = false; returnOffset = ip[1]; callArgsOffset = ip[2]; methodSlot = ip[3]; @@ -3212,7 +3195,6 @@ void InterpExecMethod(InterpreterFrame *pInterpreterFrame, InterpMethodContextFr targetMethod = pILTargetMethod; ip += 5; - isTailcall = false; goto CALL_INTERP_METHOD; } @@ -3257,7 +3239,6 @@ void InterpExecMethod(InterpreterFrame *pInterpreterFrame, InterpMethodContextFr targetMethod = pILTargetMethod; ip += 6; - isTailcall = false; goto CALL_INTERP_METHOD; } @@ -3929,7 +3910,6 @@ do \ pInterpreterFrame->SetContinuation(NULL); targetMethod = pILTargetMethod; ip += ipAdjust; - isTailcall = false; goto CALL_INTERP_METHOD; } From 237de712304fab8348cdfd529364d2957cad9afb Mon Sep 17 00:00:00 2001 From: Radek Doulik Date: Tue, 20 Jan 2026 12:30:12 +0100 Subject: [PATCH 003/123] [wasm][coreclr] Build and run runtime tests on node Based on changes from the previous branch (https://github.com/radekdoulik/runtime/tree/clr-wasm-runtime-tests-with-node) --- eng/liveBuilds.targets | 2 +- src/tests/Common/CLRTest.Execute.Bash.targets | 70 +++++++++++++++---- .../XUnitWrapperGenerator.cs | 4 +- src/tests/Common/mergedrunner.targets | 2 +- src/tests/run.py | 11 +++ src/tests/run.sh | 9 +++ 6 files changed, 82 insertions(+), 16 deletions(-) diff --git a/eng/liveBuilds.targets b/eng/liveBuilds.targets index 0eb29f9db7da28..e602f23f060464 100644 --- a/eng/liveBuilds.targets +++ b/eng/liveBuilds.targets @@ -24,7 +24,6 @@ $([MSBuild]::NormalizeDirectory('$(CoreCLRArtifactsPath)', 'sharedFramework')) - $([MSBuild]::NormalizeDirectory('$(LibrariesNativeArtifactsPath)','sharedFramework')) $([MSBuild]::NormalizeDirectory('$(HostArtifactsPath)','sharedFramework')) $([MSBuild]::NormalizeDirectory('$(CoreCLRArtifactsPath)', 'corehost')) $([MSBuild]::NormalizeDirectory('$(CoreCLRArtifactsPath)', 'ilc-published')) @@ -51,6 +50,7 @@ $(MicrosoftNetCoreAppRuntimePackRidLibTfmDir) $([MSBuild]::NormalizeDirectory('$(LibrariesArtifactsPath)', 'bin', 'runtime', '$(NetCoreAppCurrent)-$(LibrariesTargetOSConfigurationArchitecture)')) $([MSBuild]::NormalizeDirectory('$(LibrariesArtifactsPath)', 'bin', 'native', '$(NetCoreAppCurrent)-$(LibrariesTargetOSConfigurationArchitecture)')) + $([MSBuild]::NormalizeDirectory('$(LibrariesNativeArtifactsPath)','sharedFramework')) x64 x86 diff --git a/src/tests/Common/CLRTest.Execute.Bash.targets b/src/tests/Common/CLRTest.Execute.Bash.targets index 01cdef055c8035..0ca8b695105b82 100644 --- a/src/tests/Common/CLRTest.Execute.Bash.targets +++ b/src/tests/Common/CLRTest.Execute.Bash.targets @@ -280,19 +280,20 @@ fi @@ -338,8 +339,51 @@ fi ]]> /dev/null; then + kill -9 "$pid" 2>/dev/null + fi + ) & + local watchdog=$! + + # Wait for the command to finish + wait "$pid" + local exit_code=$? + + # Kill watchdog if still running + kill "$watchdog" 2>/dev/null + + # If the process was killed by SIGKILL (128+9 = 137), map to 99 + if [ $exit_code -eq 137 ]; then + return 99 + else + return $exit_code + fi +} + +if [ -z ${RunWithNodeJS} ] ; then + cd WasmApp + ./run-v8.sh +else + echo Running with node + echo CORE_ROOT: ${CORE_ROOT} + echo ExePath: ${PWD}/${ExePath} + echo CLRTestExecutionArguments: ${CLRTestExecutionArguments[@]} + cmd="node ${CORE_ROOT}/corerun.js -c ${CORE_ROOT} ${PWD}/${ExePath} ${CLRTestExecutionArguments[@]}" + echo Running: $cmd + run_with_timeout 300 $cmd +fi CLRTestExitCode=$? ]]> diff --git a/src/tests/Common/XUnitWrapperGenerator/XUnitWrapperGenerator.cs b/src/tests/Common/XUnitWrapperGenerator/XUnitWrapperGenerator.cs index 424a04fb39ec63..732addbbaec88c 100644 --- a/src/tests/Common/XUnitWrapperGenerator/XUnitWrapperGenerator.cs +++ b/src/tests/Common/XUnitWrapperGenerator/XUnitWrapperGenerator.cs @@ -254,10 +254,12 @@ private static void AddRunnerSource(SourceProductionContext context, ImmutableAr bool isMergedTestRunnerAssembly = configOptions.GlobalOptions.IsMergedTestRunnerAssembly(); configOptions.GlobalOptions.TryGetValue("build_property.TargetOS", out string? targetOS); string assemblyName = compData.AssemblyName; + string? targetOSLower = targetOS?.ToLowerInvariant(); if (isMergedTestRunnerAssembly) { - if (targetOS?.ToLowerInvariant() is "ios" or "iossimulator" or "tvos" or "tvossimulator" or "maccatalyst" or "android" or "browser") + if ((targetOSLower is "ios" or "iossimulator" or "tvos" or "tvossimulator" or "maccatalyst" or "android") + || targetOSLower is "browser" && configOptions.GlobalOptions.RuntimeFlavor().ToLowerInvariant() == "mono") { context.AddSource("XHarnessRunner.g.cs", GenerateXHarnessTestRunner(methods, aliasMap, assemblyName, targetOS)); } diff --git a/src/tests/Common/mergedrunner.targets b/src/tests/Common/mergedrunner.targets index 50fc1ee151a6b0..bff5cf387a99ab 100644 --- a/src/tests/Common/mergedrunner.targets +++ b/src/tests/Common/mergedrunner.targets @@ -18,5 +18,5 @@ - + diff --git a/src/tests/run.py b/src/tests/run.py index a8706ac7a9ab80..56e7db79f209e0 100755 --- a/src/tests/run.py +++ b/src/tests/run.py @@ -106,6 +106,7 @@ parser.add_argument("--synthesize_pgo", dest="synthesize_pgo", action="store_true", default=False) parser.add_argument("--sequential", dest="sequential", action="store_true", default=False) parser.add_argument("--interpreter", dest="interpreter", action="store_true", default=False) +parser.add_argument("--node", dest="node", action="store_true", default=False) parser.add_argument("--analyze_results_only", dest="analyze_results_only", action="store_true", default=False) parser.add_argument("--verbose", dest="verbose", action="store_true", default=False) @@ -859,6 +860,11 @@ def run_tests(args, print("Setting RunInterpreter=1") os.environ["RunInterpreter"] = "1" + if args.node: + print("Running tests with the NodeJS") + print("Setting RunWithNodeJS=1") + os.environ["RunWithNodeJS"] = "1" + if gc_stress: per_test_timeout *= 8 print("Running GCStress, extending test timeout to cater for slower runtime.") @@ -1018,6 +1024,11 @@ def setup_args(args): lambda arg: True, "Error setting interpreter") + coreclr_setup_args.verify(args, + "node", + lambda arg: True, + "Error setting node") + if coreclr_setup_args.sequential and coreclr_setup_args.parallel: print("Error: don't specify both --sequential and -parallel") sys.exit(1) diff --git a/src/tests/run.sh b/src/tests/run.sh index 20ab2b04a3e014..491796b36faff9 100755 --- a/src/tests/run.sh +++ b/src/tests/run.sh @@ -42,6 +42,7 @@ function print_usage { echo ' --tieringtest : Run each test to encourage tier1 rejitting' echo ' --runnativeaottests : Run NativeAOT compiled tests' echo ' --interpreter : Runs the tests with the interpreter enabled' + echo ' --node. : Runs the tests with the NodeJS (wasm only)' echo ' --limitedDumpGeneration : ' } @@ -191,6 +192,9 @@ do --interpreter) export RunInterpreter=1 ;; + --node) + export RunWithNode=1 + ;; *) echo "Unknown switch: $i" print_usage @@ -302,6 +306,11 @@ if [[ -n "$RunInterpreter" ]]; then runtestPyArguments+=("--interpreter") fi +if [[ -n "$RunWithNode" ]]; then + echo "Running tests with NodeJS" + runtestPyArguments+=("--node") +fi + # Default to python3 if it is installed __Python=python if command -v python3 &>/dev/null; then From c7217c1ddfd184f5d1fd15d6969c1bd0a5578b50 Mon Sep 17 00:00:00 2001 From: Radek Doulik Date: Mon, 12 Jan 2026 10:33:53 +0100 Subject: [PATCH 004/123] Conditinally disable tests with threads on wasm in ST scenario --- .../CoreCLRTestLibrary/PlatformDetection.cs | 18 ++++++++++++++++++ src/tests/Directory.Build.targets | 2 +- .../JIT/CodeGenBringUpTests/LocallocLarge.cs | 3 ++- .../function_pointer/MutualThdRecur-fptr.il | 17 ++++++++++++++--- .../JIT/jit64/opt/rngchk/ArrayWithThread.cs | 3 ++- .../coverage/OSThreadId/OSThreadId.cs | 3 ++- 6 files changed, 39 insertions(+), 7 deletions(-) diff --git a/src/tests/Common/CoreCLRTestLibrary/PlatformDetection.cs b/src/tests/Common/CoreCLRTestLibrary/PlatformDetection.cs index 828c0695d269fb..2cf78050d60aed 100644 --- a/src/tests/Common/CoreCLRTestLibrary/PlatformDetection.cs +++ b/src/tests/Common/CoreCLRTestLibrary/PlatformDetection.cs @@ -73,5 +73,23 @@ public static bool IsNonZeroLowerBoundArraySupported public static bool PlatformDoesNotSupportNativeTestAssets => OperatingSystem.IsIOS() || OperatingSystem.IsTvOS() || OperatingSystem.IsAndroid() || OperatingSystem.IsBrowser() || OperatingSystem.IsWasi(); public static bool IsAppleMobile => OperatingSystem.IsIOS() || OperatingSystem.IsTvOS() || OperatingSystem.IsMacCatalyst(); + + // wasm properties + public static bool IsBrowser => RuntimeInformation.IsOSPlatform(OSPlatform.Create("BROWSER")); + public static bool IsWasi => RuntimeInformation.IsOSPlatform(OSPlatform.Create("WASI")); + public static bool IsWasm => IsBrowser || IsWasi; + public static bool IsNotBrowser => !IsBrowser; + public static bool IsNotWasi => !IsWasi; + public static bool IsThreadingSupported => (!IsWasi && !IsBrowser) || IsWasmThreadingSupported; + public static bool IsWasmThreadingSupported => IsBrowser && IsEnvironmentVariableTrue("IsBrowserThreadingSupported"); + public static bool IsNotWasmThreadingSupported => !IsWasmThreadingSupported; + + private static bool IsEnvironmentVariableTrue(string variableName) + { + if (!IsBrowser) + return false; + + return Environment.GetEnvironmentVariable(variableName) is "true"; + } } } diff --git a/src/tests/Directory.Build.targets b/src/tests/Directory.Build.targets index 74c89c69514ca5..494b3c97efcc59 100644 --- a/src/tests/Directory.Build.targets +++ b/src/tests/Directory.Build.targets @@ -74,7 +74,7 @@ - + @@ -181,7 +183,7 @@ $(HelixRuntimeRid) - + sdk $([System.IO.File]::ReadAllText('$(RepoRoot)global.json')) $([System.Text.RegularExpressions.Regex]::Match($(GlobalJsonContent), '(%3F<="dotnet": ").*(%3F=")')) @@ -260,7 +262,7 @@ - + <_AppBundleRunScriptName>RunTests <_AppBundleRunScriptName Condition="'$(TargetsAppleMobile)' == 'true' and '$(NeedsToBuildAppsOnHelix)' == 'true'">build-apple-app @@ -445,7 +447,7 @@ @@ -565,7 +567,7 @@ + Condition="'$(TargetsMonoBrowser)' == 'true' or ('$(TargetsAppleMobile)' == 'true' and '$(NeedsToBuildAppsOnHelix)' == 'true')"> @@ -739,7 +741,7 @@ - + sos https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/flat2/dotnet-sos/$(DotnetSosVersion)/dotnet-sos.$(DotnetSosVersion).nupkg From c4ef0ef461d52cd89598682d0a726f0857e1a33d Mon Sep 17 00:00:00 2001 From: Radek Doulik Date: Thu, 5 Feb 2026 22:05:33 +0100 Subject: [PATCH 041/123] Put the Test target back --- src/tests/Common/helixpublishwitharcade.proj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tests/Common/helixpublishwitharcade.proj b/src/tests/Common/helixpublishwitharcade.proj index f4f6d144f56399..df2485fae44127 100644 --- a/src/tests/Common/helixpublishwitharcade.proj +++ b/src/tests/Common/helixpublishwitharcade.proj @@ -150,7 +150,7 @@ <_BuildInParallel Condition=" '@(_ProjectsToBuild->Count())' > '1' ">true - + From 3c06fd3a6f48467c4a9bbc0ff4f4ae21570e9621 Mon Sep 17 00:00:00 2001 From: Radek Doulik Date: Thu, 5 Feb 2026 23:24:03 +0100 Subject: [PATCH 042/123] Use the host OS DotnetCliRuntime --- src/tests/Common/helixpublishwitharcade.proj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tests/Common/helixpublishwitharcade.proj b/src/tests/Common/helixpublishwitharcade.proj index df2485fae44127..1c7688a63eb441 100644 --- a/src/tests/Common/helixpublishwitharcade.proj +++ b/src/tests/Common/helixpublishwitharcade.proj @@ -183,7 +183,7 @@ $(HelixRuntimeRid) - + sdk $([System.IO.File]::ReadAllText('$(RepoRoot)global.json')) $([System.Text.RegularExpressions.Regex]::Match($(GlobalJsonContent), '(%3F<="dotnet": ").*(%3F=")')) From 1e85271b04cc815558ef04b39befc0036fc77293 Mon Sep 17 00:00:00 2001 From: Radek Doulik Date: Fri, 6 Feb 2026 08:18:24 +0100 Subject: [PATCH 043/123] Do not set sdk style cli package type Also fix env variable name in run.sh --- src/tests/Common/helixpublishwitharcade.proj | 2 +- src/tests/run.sh | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/tests/Common/helixpublishwitharcade.proj b/src/tests/Common/helixpublishwitharcade.proj index 1c7688a63eb441..8091671fa1f7de 100644 --- a/src/tests/Common/helixpublishwitharcade.proj +++ b/src/tests/Common/helixpublishwitharcade.proj @@ -184,7 +184,7 @@ - sdk + sdk $([System.IO.File]::ReadAllText('$(RepoRoot)global.json')) $([System.Text.RegularExpressions.Regex]::Match($(GlobalJsonContent), '(%3F<="dotnet": ").*(%3F=")')) diff --git a/src/tests/run.sh b/src/tests/run.sh index 1b121333ff3f0c..d731b474ec87a8 100755 --- a/src/tests/run.sh +++ b/src/tests/run.sh @@ -193,7 +193,7 @@ do export RunInterpreter=1 ;; --node) - export RunWithNode=1 + export RunWithNodeJS=1 ;; *) echo "Unknown switch: $i" @@ -205,7 +205,7 @@ done # Set default for RunWithNode when using wasm architecture if [ "$buildArch" = "wasm" ] && [ -z "$RunWithNode" ]; then - export RunWithNode=1 + export RunWithNodeJS=1 fi ################################################################################ From 26f8282ad92524ba6b2b89e934c67b8e32ac9898 Mon Sep 17 00:00:00 2001 From: Radek Doulik Date: Fri, 6 Feb 2026 10:35:57 +0100 Subject: [PATCH 044/123] Use node --- src/tests/Common/helixpublishwitharcade.proj | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/tests/Common/helixpublishwitharcade.proj b/src/tests/Common/helixpublishwitharcade.proj index 8091671fa1f7de..30fb9a9488626b 100644 --- a/src/tests/Common/helixpublishwitharcade.proj +++ b/src/tests/Common/helixpublishwitharcade.proj @@ -73,6 +73,7 @@ $(TestBinDir)MergedPayloads\ $([MSBuild]::NormalizeDirectory($(MergedPayloadsRootDirectory))) true + true false AppBundle wwwroot @@ -184,7 +185,7 @@ - sdk + sdk $([System.IO.File]::ReadAllText('$(RepoRoot)global.json')) $([System.Text.RegularExpressions.Regex]::Match($(GlobalJsonContent), '(%3F<="dotnet": ").*(%3F=")')) @@ -626,6 +627,7 @@ + @@ -680,6 +682,7 @@ + From 3640a38f60756a7f87ab41e4fdccd8b6816fd895 Mon Sep 17 00:00:00 2001 From: Radek Doulik Date: Fri, 6 Feb 2026 12:51:15 +0100 Subject: [PATCH 045/123] Print node version before running the test --- src/tests/Common/CLRTest.Execute.Bash.targets | 1 + 1 file changed, 1 insertion(+) diff --git a/src/tests/Common/CLRTest.Execute.Bash.targets b/src/tests/Common/CLRTest.Execute.Bash.targets index c13575b66d8517..b35898f8d078bf 100644 --- a/src/tests/Common/CLRTest.Execute.Bash.targets +++ b/src/tests/Common/CLRTest.Execute.Bash.targets @@ -372,6 +372,7 @@ else echo CORE_ROOT: ${CORE_ROOT} echo ExePath: ${PWD}/${ExePath} echo CLRTestExecutionArguments: ${CLRTestExecutionArguments[@]} + echo node version: `node -v` cmd="node ${CORE_ROOT}/corerun.js -c ${CORE_ROOT} ${PWD}/${ExePath} ${CLRTestExecutionArguments[@]}" echo Running: $cmd run_with_timeout 300 $cmd From 9916aec0e68a96bddd5c56c090c0b1783b808f62 Mon Sep 17 00:00:00 2001 From: Radek Doulik Date: Fri, 6 Feb 2026 14:24:58 +0100 Subject: [PATCH 046/123] Disable DOTNET_DbgEnableMiniDump --- src/tests/Common/CLRTest.Execute.Bash.targets | 3 +++ src/tests/run.sh | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/tests/Common/CLRTest.Execute.Bash.targets b/src/tests/Common/CLRTest.Execute.Bash.targets index b35898f8d078bf..3c7129c52fe2a2 100644 --- a/src/tests/Common/CLRTest.Execute.Bash.targets +++ b/src/tests/Common/CLRTest.Execute.Bash.targets @@ -373,6 +373,9 @@ else echo ExePath: ${PWD}/${ExePath} echo CLRTestExecutionArguments: ${CLRTestExecutionArguments[@]} echo node version: `node -v` + # Disable minidump generation for browser tests + # active issue https://github.com/dotnet/runtime/issues/124088 + export DOTNET_DbgEnableMiniDump=0 cmd="node ${CORE_ROOT}/corerun.js -c ${CORE_ROOT} ${PWD}/${ExePath} ${CLRTestExecutionArguments[@]}" echo Running: $cmd run_with_timeout 300 $cmd diff --git a/src/tests/run.sh b/src/tests/run.sh index d731b474ec87a8..e3929ce7478627 100755 --- a/src/tests/run.sh +++ b/src/tests/run.sh @@ -203,8 +203,8 @@ do esac done -# Set default for RunWithNode when using wasm architecture -if [ "$buildArch" = "wasm" ] && [ -z "$RunWithNode" ]; then +# Set default for RunWithNodeJS when using wasm architecture +if [ "$buildArch" = "wasm" ] && [ -z "$RunWithNodeJS" ]; then export RunWithNodeJS=1 fi From 4c9b395bf0154ea21a3bb384de486287f23dc598 Mon Sep 17 00:00:00 2001 From: Radek Doulik Date: Mon, 9 Feb 2026 10:25:40 +0100 Subject: [PATCH 047/123] Call dotnetBrowserUtilsExports.abortBackgroundTimers() unconditionaly in exitJS --- src/coreclr/hosts/corerun/wasm/libCorerun.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/coreclr/hosts/corerun/wasm/libCorerun.js b/src/coreclr/hosts/corerun/wasm/libCorerun.js index 088fdc9849b0e7..11a455092665bc 100644 --- a/src/coreclr/hosts/corerun/wasm/libCorerun.js +++ b/src/coreclr/hosts/corerun/wasm/libCorerun.js @@ -30,9 +30,9 @@ function libCoreRunFactory() { if (!implicit) { EXITSTATUS = status; ABORT = true; - if (dotnetBrowserUtilsExports.abortBackgroundTimers) { - dotnetBrowserUtilsExports.abortBackgroundTimers(); - } + } + if (dotnetBrowserUtilsExports.abortBackgroundTimers) { + dotnetBrowserUtilsExports.abortBackgroundTimers(); } if (!keepRuntimeAlive()) { ABORT = true; From e3486892c353becb25210a68e1ff507c852d962c Mon Sep 17 00:00:00 2001 From: Radek Doulik Date: Mon, 9 Feb 2026 12:59:02 +0100 Subject: [PATCH 048/123] Add few signatures for tests, comment and regenerate call helpers --- src/coreclr/hosts/corerun/wasm/libCorerun.js | 1 + .../vm/wasm/callhelpers-interp-to-managed.cpp | 29 +++ src/coreclr/vm/wasm/callhelpers-pinvoke.cpp | 4 +- src/coreclr/vm/wasm/callhelpers-reverse.cpp | 180 +++++++----------- .../coreclr/ManagedToNativeGenerator.cs | 3 + 5 files changed, 104 insertions(+), 113 deletions(-) diff --git a/src/coreclr/hosts/corerun/wasm/libCorerun.js b/src/coreclr/hosts/corerun/wasm/libCorerun.js index 11a455092665bc..8ac4292b3c4fe2 100644 --- a/src/coreclr/hosts/corerun/wasm/libCorerun.js +++ b/src/coreclr/hosts/corerun/wasm/libCorerun.js @@ -31,6 +31,7 @@ function libCoreRunFactory() { EXITSTATUS = status; ABORT = true; } + // WASM-TODO temporary workaround to get exit code from runtime tests if (dotnetBrowserUtilsExports.abortBackgroundTimers) { dotnetBrowserUtilsExports.abortBackgroundTimers(); } diff --git a/src/coreclr/vm/wasm/callhelpers-interp-to-managed.cpp b/src/coreclr/vm/wasm/callhelpers-interp-to-managed.cpp index df3705f48eb3ad..8b9b6df093348f 100644 --- a/src/coreclr/vm/wasm/callhelpers-interp-to-managed.cpp +++ b/src/coreclr/vm/wasm/callhelpers-interp-to-managed.cpp @@ -49,6 +49,12 @@ namespace *((double*)pRet) = (*fptr)(ARG_F64(0), ARG_I32(1)); } + static void CallFunc_F64_I32_F64_RetF64(PCODE pcode, int8_t* pArgs, int8_t* pRet) + { + double (*fptr)(double, int32_t, double) = (double (*)(double, int32_t, double))pcode; + *((double*)pRet) = (*fptr)(ARG_F64(0), ARG_I32(1), ARG_F64(2)); + } + static void CallFunc_I32_RetF64(PCODE pcode, int8_t* pArgs, int8_t* pRet) { double (*fptr)(int32_t) = (double (*)(int32_t))pcode; @@ -103,6 +109,12 @@ namespace *((int32_t*)pRet) = (*fptr)(ARG_F64(0)); } + static void CallFunc_F64_F32_I32_RetI32(PCODE pcode, int8_t* pArgs, int8_t* pRet) + { + int32_t (*fptr)(double, float, int32_t) = (int32_t (*)(double, float, int32_t))pcode; + *((int32_t*)pRet) = (*fptr)(ARG_F64(0), ARG_F32(1), ARG_I32(2)); + } + static void CallFunc_F64_I32_RetI32(PCODE pcode, int8_t* pArgs, int8_t* pRet) { int32_t (*fptr)(double, int32_t) = (int32_t (*)(double, int32_t))pcode; @@ -463,6 +475,13 @@ namespace *((int32_t*)pRet) = (*fptr)(ARG_IND(0), ARG_I32(1)); } + static void CallFunc_IND_IND_RetIND(PCODE pcode, int8_t* pArgs, int8_t* pRet) + { + int32_t (*fptr)(int32_t, int32_t) = (int32_t (*)(int32_t, int32_t))pcode; + PORTABILITY_ASSERT("Indirect struct return is not yet implemented."); + *((int32_t*)pRet) = (*fptr)(ARG_IND(0), ARG_IND(1)); + } + static void CallFunc_Void_RetVoid(PCODE pcode, int8_t* pArgs, int8_t* pRet) { void (*fptr)() = (void (*)())pcode; @@ -499,6 +518,12 @@ namespace (*fptr)(ARG_I32(0)); } + static void CallFunc_I32_F64_RetVoid(PCODE pcode, int8_t* pArgs, int8_t* pRet) + { + void (*fptr)(int32_t, double) = (void (*)(int32_t, double))pcode; + (*fptr)(ARG_I32(0), ARG_F64(1)); + } + static void CallFunc_I32_I32_RetVoid(PCODE pcode, int8_t* pArgs, int8_t* pRet) { void (*fptr)(int32_t, int32_t) = (void (*)(int32_t, int32_t))pcode; @@ -656,6 +681,7 @@ const StringToWasmSigThunk g_wasmThunks[] = { { "ddd", (void*)&CallFunc_F64_F64_RetF64 }, { "dddd", (void*)&CallFunc_F64_F64_F64_RetF64 }, { "ddi", (void*)&CallFunc_F64_I32_RetF64 }, + { "ddid", (void*)&CallFunc_F64_I32_F64_RetF64 }, { "di", (void*)&CallFunc_I32_RetF64 }, { "dii", (void*)&CallFunc_I32_I32_RetF64 }, { "f", (void*)&CallFunc_Void_RetF32 }, @@ -665,6 +691,7 @@ const StringToWasmSigThunk g_wasmThunks[] = { { "ffi", (void*)&CallFunc_F32_I32_RetF32 }, { "i", (void*)&CallFunc_Void_RetI32 }, { "id", (void*)&CallFunc_F64_RetI32 }, + { "idfi", (void*)&CallFunc_F64_F32_I32_RetI32 }, { "idi", (void*)&CallFunc_F64_I32_RetI32 }, { "if", (void*)&CallFunc_F32_RetI32 }, { "iff", (void*)&CallFunc_F32_F32_RetI32 }, @@ -724,12 +751,14 @@ const StringToWasmSigThunk g_wasmThunks[] = { { "niii", (void*)&CallFunc_I32_I32_I32_RetIND }, { "nn", (void*)&CallFunc_IND_RetIND }, { "nni", (void*)&CallFunc_IND_I32_RetIND }, + { "nnn", (void*)&CallFunc_IND_IND_RetIND }, { "v", (void*)&CallFunc_Void_RetVoid }, { "vd", (void*)&CallFunc_F64_RetVoid }, { "vdii", (void*)&CallFunc_F64_I32_I32_RetVoid }, { "vf", (void*)&CallFunc_F32_RetVoid }, { "vfii", (void*)&CallFunc_F32_I32_I32_RetVoid }, { "vi", (void*)&CallFunc_I32_RetVoid }, + { "vid", (void*)&CallFunc_I32_F64_RetVoid }, { "vii", (void*)&CallFunc_I32_I32_RetVoid }, { "viii", (void*)&CallFunc_I32_I32_I32_RetVoid }, { "viiii", (void*)&CallFunc_I32_I32_I32_I32_RetVoid }, diff --git a/src/coreclr/vm/wasm/callhelpers-pinvoke.cpp b/src/coreclr/vm/wasm/callhelpers-pinvoke.cpp index 50487f83a2a844..73e32aeefe51be 100644 --- a/src/coreclr/vm/wasm/callhelpers-pinvoke.cpp +++ b/src/coreclr/vm/wasm/callhelpers-pinvoke.cpp @@ -82,6 +82,7 @@ extern "C" { int32_t SystemNative_FTruncate (void *, int64_t); int32_t SystemNative_FUTimens (void *, void *); int32_t SystemNative_FcntlSetFD (void *, int32_t); + int32_t SystemNative_FileSystemSupportsLocking (void *, int32_t, int32_t); void SystemNative_Free (void *); void SystemNative_FreeLibrary (void *); int32_t SystemNative_GetAddressFamily (void *, int32_t, void *); @@ -90,7 +91,6 @@ extern "C" { void * SystemNative_GetCwd (void *, int32_t); void * SystemNative_GetDefaultSearchOrderPseudoHandle (); int32_t SystemNative_GetErrNo (); - uint32_t SystemNative_FileSystemSupportsLocking (void *, int32_t, int32_t); int32_t SystemNative_GetIPv4Address (void *, int32_t, void *); int32_t SystemNative_GetIPv6Address (void *, int32_t, void *, int32_t, void *); void * SystemNative_GetLoadLibraryError (); @@ -230,6 +230,7 @@ static const Entry s_libSystem_Native [] = { DllImportEntry(SystemNative_FTruncate) // System.IO.MemoryMappedFiles, System.Private.CoreLib DllImportEntry(SystemNative_FUTimens) // System.Private.CoreLib DllImportEntry(SystemNative_FcntlSetFD) // System.IO.MemoryMappedFiles + DllImportEntry(SystemNative_FileSystemSupportsLocking) // System.Private.CoreLib DllImportEntry(SystemNative_Free) // System.Private.CoreLib DllImportEntry(SystemNative_FreeLibrary) // System.Private.CoreLib DllImportEntry(SystemNative_GetAddressFamily) // System.Net.Primitives @@ -238,7 +239,6 @@ static const Entry s_libSystem_Native [] = { DllImportEntry(SystemNative_GetCwd) // System.Private.CoreLib DllImportEntry(SystemNative_GetDefaultSearchOrderPseudoHandle) // System.Private.CoreLib DllImportEntry(SystemNative_GetErrNo) // System.Private.CoreLib - DllImportEntry(SystemNative_FileSystemSupportsLocking) // System.Private.CoreLib DllImportEntry(SystemNative_GetIPv4Address) // System.Net.Primitives DllImportEntry(SystemNative_GetIPv6Address) // System.Net.Primitives DllImportEntry(SystemNative_GetLoadLibraryError) // System.Private.CoreLib diff --git a/src/coreclr/vm/wasm/callhelpers-reverse.cpp b/src/coreclr/vm/wasm/callhelpers-reverse.cpp index 9a64e6954c1a47..36810aeda0c76d 100644 --- a/src/coreclr/vm/wasm/callhelpers-reverse.cpp +++ b/src/coreclr/vm/wasm/callhelpers-reverse.cpp @@ -92,131 +92,92 @@ static void Call_System_Runtime_InteropServices_JavaScript_System_Runtime_Intero ExecuteInterpretedMethodFromUnmanaged(MD_System_Runtime_InteropServices_JavaScript_System_Runtime_InteropServices_JavaScript_JavaScriptExports_CallJSExport_I32_I32_RetVoid, (int8_t*)args, sizeof(args), nullptr, (PCODE)&Call_System_Runtime_InteropServices_JavaScript_System_Runtime_InteropServices_JavaScript_JavaScriptExports_CallJSExport_I32_I32_RetVoid); } -static MethodDesc* MD_System_Private_CoreLib_System_Runtime_Loader_AssemblyLoadContext_OnAssemblyLoad_I32_I32_RetVoid = nullptr; -static void Call_System_Private_CoreLib_System_Runtime_Loader_AssemblyLoadContext_OnAssemblyLoad_I32_I32_RetVoid(void * arg0, void * arg1) +extern "C" void SystemInteropJS_CallJSExport(int32_t arg0, void * arg1) { - int64_t args[2] = { (int64_t)arg0, (int64_t)arg1 }; - - // Lazy lookup of MethodDesc for the function export scenario. - if (!MD_System_Private_CoreLib_System_Runtime_Loader_AssemblyLoadContext_OnAssemblyLoad_I32_I32_RetVoid) - { - LookupMethodByName("System.Runtime.Loader.AssemblyLoadContext, System.Private.CoreLib", "OnAssemblyLoad", &MD_System_Private_CoreLib_System_Runtime_Loader_AssemblyLoadContext_OnAssemblyLoad_I32_I32_RetVoid); - } - ExecuteInterpretedMethodFromUnmanaged(MD_System_Private_CoreLib_System_Runtime_Loader_AssemblyLoadContext_OnAssemblyLoad_I32_I32_RetVoid, (int8_t*)args, sizeof(args), nullptr, (PCODE)&Call_System_Private_CoreLib_System_Runtime_Loader_AssemblyLoadContext_OnAssemblyLoad_I32_I32_RetVoid); + Call_System_Runtime_InteropServices_JavaScript_System_Runtime_InteropServices_JavaScript_JavaScriptExports_CallJSExport_I32_I32_RetVoid(arg0, arg1); } -static MethodDesc* MD_System_Private_CoreLib_System_Runtime_Loader_AssemblyLoadContext_OnAssemblyResolve_I32_I32_I32_I32_RetVoid = nullptr; -static void Call_System_Private_CoreLib_System_Runtime_Loader_AssemblyLoadContext_OnAssemblyResolve_I32_I32_I32_I32_RetVoid(void * arg0, void * arg1, void * arg2, void * arg3) +static MethodDesc* MD_System_Private_CoreLib_System_StubHelpers_MngdRefCustomMarshaler_ClearManaged_I32_I32_I32_I32_RetVoid = nullptr; +static void Call_System_Private_CoreLib_System_StubHelpers_MngdRefCustomMarshaler_ClearManaged_I32_I32_I32_I32_RetVoid(void * arg0, void * arg1, void * arg2, void * arg3) { int64_t args[4] = { (int64_t)arg0, (int64_t)arg1, (int64_t)arg2, (int64_t)arg3 }; // Lazy lookup of MethodDesc for the function export scenario. - if (!MD_System_Private_CoreLib_System_Runtime_Loader_AssemblyLoadContext_OnAssemblyResolve_I32_I32_I32_I32_RetVoid) + if (!MD_System_Private_CoreLib_System_StubHelpers_MngdRefCustomMarshaler_ClearManaged_I32_I32_I32_I32_RetVoid) { - LookupMethodByName("System.Runtime.Loader.AssemblyLoadContext, System.Private.CoreLib", "OnAssemblyResolve", &MD_System_Private_CoreLib_System_Runtime_Loader_AssemblyLoadContext_OnAssemblyResolve_I32_I32_I32_I32_RetVoid); + LookupMethodByName("System.StubHelpers.MngdRefCustomMarshaler, System.Private.CoreLib", "ClearManaged", &MD_System_Private_CoreLib_System_StubHelpers_MngdRefCustomMarshaler_ClearManaged_I32_I32_I32_I32_RetVoid); } - ExecuteInterpretedMethodFromUnmanaged(MD_System_Private_CoreLib_System_Runtime_Loader_AssemblyLoadContext_OnAssemblyResolve_I32_I32_I32_I32_RetVoid, (int8_t*)args, sizeof(args), nullptr, (PCODE)&Call_System_Private_CoreLib_System_Runtime_Loader_AssemblyLoadContext_OnAssemblyResolve_I32_I32_I32_I32_RetVoid); + ExecuteInterpretedMethodFromUnmanaged(MD_System_Private_CoreLib_System_StubHelpers_MngdRefCustomMarshaler_ClearManaged_I32_I32_I32_I32_RetVoid, (int8_t*)args, sizeof(args), nullptr, (PCODE)&Call_System_Private_CoreLib_System_StubHelpers_MngdRefCustomMarshaler_ClearManaged_I32_I32_I32_I32_RetVoid); } -static MethodDesc* MD_System_Private_CoreLib_System_Runtime_Loader_AssemblyLoadContext_OnResourceResolve_I32_I32_I32_I32_RetVoid = nullptr; -static void Call_System_Private_CoreLib_System_Runtime_Loader_AssemblyLoadContext_OnResourceResolve_I32_I32_I32_I32_RetVoid(void * arg0, void * arg1, void * arg2, void * arg3) +static MethodDesc* MD_System_Private_CoreLib_System_StubHelpers_MngdRefCustomMarshaler_ClearNative_I32_I32_I32_I32_RetVoid = nullptr; +static void Call_System_Private_CoreLib_System_StubHelpers_MngdRefCustomMarshaler_ClearNative_I32_I32_I32_I32_RetVoid(void * arg0, void * arg1, void * arg2, void * arg3) { int64_t args[4] = { (int64_t)arg0, (int64_t)arg1, (int64_t)arg2, (int64_t)arg3 }; // Lazy lookup of MethodDesc for the function export scenario. - if (!MD_System_Private_CoreLib_System_Runtime_Loader_AssemblyLoadContext_OnResourceResolve_I32_I32_I32_I32_RetVoid) + if (!MD_System_Private_CoreLib_System_StubHelpers_MngdRefCustomMarshaler_ClearNative_I32_I32_I32_I32_RetVoid) { - LookupMethodByName("System.Runtime.Loader.AssemblyLoadContext, System.Private.CoreLib", "OnResourceResolve", &MD_System_Private_CoreLib_System_Runtime_Loader_AssemblyLoadContext_OnResourceResolve_I32_I32_I32_I32_RetVoid); + LookupMethodByName("System.StubHelpers.MngdRefCustomMarshaler, System.Private.CoreLib", "ClearNative", &MD_System_Private_CoreLib_System_StubHelpers_MngdRefCustomMarshaler_ClearNative_I32_I32_I32_I32_RetVoid); } - ExecuteInterpretedMethodFromUnmanaged(MD_System_Private_CoreLib_System_Runtime_Loader_AssemblyLoadContext_OnResourceResolve_I32_I32_I32_I32_RetVoid, (int8_t*)args, sizeof(args), nullptr, (PCODE)&Call_System_Private_CoreLib_System_Runtime_Loader_AssemblyLoadContext_OnResourceResolve_I32_I32_I32_I32_RetVoid); + ExecuteInterpretedMethodFromUnmanaged(MD_System_Private_CoreLib_System_StubHelpers_MngdRefCustomMarshaler_ClearNative_I32_I32_I32_I32_RetVoid, (int8_t*)args, sizeof(args), nullptr, (PCODE)&Call_System_Private_CoreLib_System_StubHelpers_MngdRefCustomMarshaler_ClearNative_I32_I32_I32_I32_RetVoid); } -static MethodDesc* MD_System_Private_CoreLib_System_Runtime_Loader_AssemblyLoadContext_OnTypeResolve_I32_I32_I32_I32_RetVoid = nullptr; -static void Call_System_Private_CoreLib_System_Runtime_Loader_AssemblyLoadContext_OnTypeResolve_I32_I32_I32_I32_RetVoid(void * arg0, void * arg1, void * arg2, void * arg3) +static MethodDesc* MD_System_Runtime_InteropServices_JavaScript_System_Runtime_InteropServices_JavaScript_JavaScriptExports_CompleteTask_I32_RetVoid = nullptr; +static void Call_System_Runtime_InteropServices_JavaScript_System_Runtime_InteropServices_JavaScript_JavaScriptExports_CompleteTask_I32_RetVoid(void * arg0) { - int64_t args[4] = { (int64_t)arg0, (int64_t)arg1, (int64_t)arg2, (int64_t)arg3 }; + int64_t args[1] = { (int64_t)arg0 }; // Lazy lookup of MethodDesc for the function export scenario. - if (!MD_System_Private_CoreLib_System_Runtime_Loader_AssemblyLoadContext_OnTypeResolve_I32_I32_I32_I32_RetVoid) + if (!MD_System_Runtime_InteropServices_JavaScript_System_Runtime_InteropServices_JavaScript_JavaScriptExports_CompleteTask_I32_RetVoid) { - LookupMethodByName("System.Runtime.Loader.AssemblyLoadContext, System.Private.CoreLib", "OnTypeResolve", &MD_System_Private_CoreLib_System_Runtime_Loader_AssemblyLoadContext_OnTypeResolve_I32_I32_I32_I32_RetVoid); + LookupMethodByName("System.Runtime.InteropServices.JavaScript.JavaScriptExports, System.Runtime.InteropServices.JavaScript", "CompleteTask", &MD_System_Runtime_InteropServices_JavaScript_System_Runtime_InteropServices_JavaScript_JavaScriptExports_CompleteTask_I32_RetVoid); } - ExecuteInterpretedMethodFromUnmanaged(MD_System_Private_CoreLib_System_Runtime_Loader_AssemblyLoadContext_OnTypeResolve_I32_I32_I32_I32_RetVoid, (int8_t*)args, sizeof(args), nullptr, (PCODE)&Call_System_Private_CoreLib_System_Runtime_Loader_AssemblyLoadContext_OnTypeResolve_I32_I32_I32_I32_RetVoid); + ExecuteInterpretedMethodFromUnmanaged(MD_System_Runtime_InteropServices_JavaScript_System_Runtime_InteropServices_JavaScript_JavaScriptExports_CompleteTask_I32_RetVoid, (int8_t*)args, sizeof(args), nullptr, (PCODE)&Call_System_Runtime_InteropServices_JavaScript_System_Runtime_InteropServices_JavaScript_JavaScriptExports_CompleteTask_I32_RetVoid); } -static MethodDesc* MD_System_Private_CoreLib_System_Runtime_Loader_AssemblyLoadContext_Resolve_I32_I32_I32_I32_RetVoid = nullptr; -static void Call_System_Private_CoreLib_System_Runtime_Loader_AssemblyLoadContext_Resolve_I32_I32_I32_I32_RetVoid(void * arg0, void * arg1, void * arg2, void * arg3) +extern "C" void SystemInteropJS_CompleteTask(void * arg0) { - int64_t args[4] = { (int64_t)arg0, (int64_t)arg1, (int64_t)arg2, (int64_t)arg3 }; - - // Lazy lookup of MethodDesc for the function export scenario. - if (!MD_System_Private_CoreLib_System_Runtime_Loader_AssemblyLoadContext_Resolve_I32_I32_I32_I32_RetVoid) - { - LookupMethodByName("System.Runtime.Loader.AssemblyLoadContext, System.Private.CoreLib", "Resolve", &MD_System_Private_CoreLib_System_Runtime_Loader_AssemblyLoadContext_Resolve_I32_I32_I32_I32_RetVoid); - } - ExecuteInterpretedMethodFromUnmanaged(MD_System_Private_CoreLib_System_Runtime_Loader_AssemblyLoadContext_Resolve_I32_I32_I32_I32_RetVoid, (int8_t*)args, sizeof(args), nullptr, (PCODE)&Call_System_Private_CoreLib_System_Runtime_Loader_AssemblyLoadContext_Resolve_I32_I32_I32_I32_RetVoid); + Call_System_Runtime_InteropServices_JavaScript_System_Runtime_InteropServices_JavaScript_JavaScriptExports_CompleteTask_I32_RetVoid(arg0); } -static MethodDesc* MD_System_Private_CoreLib_System_Runtime_Loader_AssemblyLoadContext_ResolveSatelliteAssembly_I32_I32_I32_I32_RetVoid = nullptr; -static void Call_System_Private_CoreLib_System_Runtime_Loader_AssemblyLoadContext_ResolveSatelliteAssembly_I32_I32_I32_I32_RetVoid(void * arg0, void * arg1, void * arg2, void * arg3) +static MethodDesc* MD_System_Private_CoreLib_System_GC_ConfigCallback_I32_I32_I32_I32_I64_RetVoid = nullptr; +static void Call_System_Private_CoreLib_System_GC_ConfigCallback_I32_I32_I32_I32_I64_RetVoid(void * arg0, void * arg1, void * arg2, int32_t arg3, int64_t arg4) { - int64_t args[4] = { (int64_t)arg0, (int64_t)arg1, (int64_t)arg2, (int64_t)arg3 }; + int64_t args[5] = { (int64_t)arg0, (int64_t)arg1, (int64_t)arg2, (int64_t)arg3, (int64_t)arg4 }; // Lazy lookup of MethodDesc for the function export scenario. - if (!MD_System_Private_CoreLib_System_Runtime_Loader_AssemblyLoadContext_ResolveSatelliteAssembly_I32_I32_I32_I32_RetVoid) + if (!MD_System_Private_CoreLib_System_GC_ConfigCallback_I32_I32_I32_I32_I64_RetVoid) { - LookupMethodByName("System.Runtime.Loader.AssemblyLoadContext, System.Private.CoreLib", "ResolveSatelliteAssembly", &MD_System_Private_CoreLib_System_Runtime_Loader_AssemblyLoadContext_ResolveSatelliteAssembly_I32_I32_I32_I32_RetVoid); + LookupMethodByName("System.GC, System.Private.CoreLib", "ConfigCallback", &MD_System_Private_CoreLib_System_GC_ConfigCallback_I32_I32_I32_I32_I64_RetVoid); } - ExecuteInterpretedMethodFromUnmanaged(MD_System_Private_CoreLib_System_Runtime_Loader_AssemblyLoadContext_ResolveSatelliteAssembly_I32_I32_I32_I32_RetVoid, (int8_t*)args, sizeof(args), nullptr, (PCODE)&Call_System_Private_CoreLib_System_Runtime_Loader_AssemblyLoadContext_ResolveSatelliteAssembly_I32_I32_I32_I32_RetVoid); + ExecuteInterpretedMethodFromUnmanaged(MD_System_Private_CoreLib_System_GC_ConfigCallback_I32_I32_I32_I32_I64_RetVoid, (int8_t*)args, sizeof(args), nullptr, (PCODE)&Call_System_Private_CoreLib_System_GC_ConfigCallback_I32_I32_I32_I32_I64_RetVoid); } -static MethodDesc* MD_System_Private_CoreLib_System_Runtime_Loader_AssemblyLoadContext_ResolveUsingEvent_I32_I32_I32_I32_RetVoid = nullptr; -static void Call_System_Private_CoreLib_System_Runtime_Loader_AssemblyLoadContext_ResolveUsingEvent_I32_I32_I32_I32_RetVoid(void * arg0, void * arg1, void * arg2, void * arg3) +static MethodDesc* MD_System_Private_CoreLib_System_StubHelpers_MngdRefCustomMarshaler_ConvertContentsToManaged_I32_I32_I32_I32_RetVoid = nullptr; +static void Call_System_Private_CoreLib_System_StubHelpers_MngdRefCustomMarshaler_ConvertContentsToManaged_I32_I32_I32_I32_RetVoid(void * arg0, void * arg1, void * arg2, void * arg3) { int64_t args[4] = { (int64_t)arg0, (int64_t)arg1, (int64_t)arg2, (int64_t)arg3 }; // Lazy lookup of MethodDesc for the function export scenario. - if (!MD_System_Private_CoreLib_System_Runtime_Loader_AssemblyLoadContext_ResolveUsingEvent_I32_I32_I32_I32_RetVoid) - { - LookupMethodByName("System.Runtime.Loader.AssemblyLoadContext, System.Private.CoreLib", "ResolveUsingEvent", &MD_System_Private_CoreLib_System_Runtime_Loader_AssemblyLoadContext_ResolveUsingEvent_I32_I32_I32_I32_RetVoid); - } - ExecuteInterpretedMethodFromUnmanaged(MD_System_Private_CoreLib_System_Runtime_Loader_AssemblyLoadContext_ResolveUsingEvent_I32_I32_I32_I32_RetVoid, (int8_t*)args, sizeof(args), nullptr, (PCODE)&Call_System_Private_CoreLib_System_Runtime_Loader_AssemblyLoadContext_ResolveUsingEvent_I32_I32_I32_I32_RetVoid); -} - -extern "C" void SystemInteropJS_CallJSExport(int32_t arg0, void * arg1) -{ - Call_System_Runtime_InteropServices_JavaScript_System_Runtime_InteropServices_JavaScript_JavaScriptExports_CallJSExport_I32_I32_RetVoid(arg0, arg1); -} - -static MethodDesc* MD_System_Runtime_InteropServices_JavaScript_System_Runtime_InteropServices_JavaScript_JavaScriptExports_CompleteTask_I32_RetVoid = nullptr; -static void Call_System_Runtime_InteropServices_JavaScript_System_Runtime_InteropServices_JavaScript_JavaScriptExports_CompleteTask_I32_RetVoid(void * arg0) -{ - int64_t args[1] = { (int64_t)arg0 }; - - // Lazy lookup of MethodDesc for the function export scenario. - if (!MD_System_Runtime_InteropServices_JavaScript_System_Runtime_InteropServices_JavaScript_JavaScriptExports_CompleteTask_I32_RetVoid) + if (!MD_System_Private_CoreLib_System_StubHelpers_MngdRefCustomMarshaler_ConvertContentsToManaged_I32_I32_I32_I32_RetVoid) { - LookupMethodByName("System.Runtime.InteropServices.JavaScript.JavaScriptExports, System.Runtime.InteropServices.JavaScript", "CompleteTask", &MD_System_Runtime_InteropServices_JavaScript_System_Runtime_InteropServices_JavaScript_JavaScriptExports_CompleteTask_I32_RetVoid); + LookupMethodByName("System.StubHelpers.MngdRefCustomMarshaler, System.Private.CoreLib", "ConvertContentsToManaged", &MD_System_Private_CoreLib_System_StubHelpers_MngdRefCustomMarshaler_ConvertContentsToManaged_I32_I32_I32_I32_RetVoid); } - ExecuteInterpretedMethodFromUnmanaged(MD_System_Runtime_InteropServices_JavaScript_System_Runtime_InteropServices_JavaScript_JavaScriptExports_CompleteTask_I32_RetVoid, (int8_t*)args, sizeof(args), nullptr, (PCODE)&Call_System_Runtime_InteropServices_JavaScript_System_Runtime_InteropServices_JavaScript_JavaScriptExports_CompleteTask_I32_RetVoid); + ExecuteInterpretedMethodFromUnmanaged(MD_System_Private_CoreLib_System_StubHelpers_MngdRefCustomMarshaler_ConvertContentsToManaged_I32_I32_I32_I32_RetVoid, (int8_t*)args, sizeof(args), nullptr, (PCODE)&Call_System_Private_CoreLib_System_StubHelpers_MngdRefCustomMarshaler_ConvertContentsToManaged_I32_I32_I32_I32_RetVoid); } -extern "C" void SystemInteropJS_CompleteTask(void * arg0) -{ - Call_System_Runtime_InteropServices_JavaScript_System_Runtime_InteropServices_JavaScript_JavaScriptExports_CompleteTask_I32_RetVoid(arg0); -} - -static MethodDesc* MD_System_Private_CoreLib_System_GC_ConfigCallback_I32_I32_I32_I32_I64_RetVoid = nullptr; -static void Call_System_Private_CoreLib_System_GC_ConfigCallback_I32_I32_I32_I32_I64_RetVoid(void * arg0, void * arg1, void * arg2, int32_t arg3, int64_t arg4) +static MethodDesc* MD_System_Private_CoreLib_System_StubHelpers_MngdRefCustomMarshaler_ConvertContentsToNative_I32_I32_I32_I32_RetVoid = nullptr; +static void Call_System_Private_CoreLib_System_StubHelpers_MngdRefCustomMarshaler_ConvertContentsToNative_I32_I32_I32_I32_RetVoid(void * arg0, void * arg1, void * arg2, void * arg3) { - int64_t args[5] = { (int64_t)arg0, (int64_t)arg1, (int64_t)arg2, (int64_t)arg3, (int64_t)arg4 }; + int64_t args[4] = { (int64_t)arg0, (int64_t)arg1, (int64_t)arg2, (int64_t)arg3 }; // Lazy lookup of MethodDesc for the function export scenario. - if (!MD_System_Private_CoreLib_System_GC_ConfigCallback_I32_I32_I32_I32_I64_RetVoid) + if (!MD_System_Private_CoreLib_System_StubHelpers_MngdRefCustomMarshaler_ConvertContentsToNative_I32_I32_I32_I32_RetVoid) { - LookupMethodByName("System.GC, System.Private.CoreLib", "ConfigCallback", &MD_System_Private_CoreLib_System_GC_ConfigCallback_I32_I32_I32_I32_I64_RetVoid); + LookupMethodByName("System.StubHelpers.MngdRefCustomMarshaler, System.Private.CoreLib", "ConvertContentsToNative", &MD_System_Private_CoreLib_System_StubHelpers_MngdRefCustomMarshaler_ConvertContentsToNative_I32_I32_I32_I32_RetVoid); } - ExecuteInterpretedMethodFromUnmanaged(MD_System_Private_CoreLib_System_GC_ConfigCallback_I32_I32_I32_I32_I64_RetVoid, (int8_t*)args, sizeof(args), nullptr, (PCODE)&Call_System_Private_CoreLib_System_GC_ConfigCallback_I32_I32_I32_I32_I64_RetVoid); + ExecuteInterpretedMethodFromUnmanaged(MD_System_Private_CoreLib_System_StubHelpers_MngdRefCustomMarshaler_ConvertContentsToNative_I32_I32_I32_I32_RetVoid, (int8_t*)args, sizeof(args), nullptr, (PCODE)&Call_System_Private_CoreLib_System_StubHelpers_MngdRefCustomMarshaler_ConvertContentsToNative_I32_I32_I32_I32_RetVoid); } static MethodDesc* MD_System_Private_CoreLib_System_Globalization_CalendarData_EnumCalendarInfoCallback_I32_I32_RetVoid = nullptr; @@ -378,19 +339,6 @@ static int32_t Call_System_Private_CoreLib_Internal_Runtime_InteropServices_ComA return result; } -static MethodDesc* MD_System_Private_CoreLib_System_AppContext_Setup_I32_I32_I32_I32_RetVoid = nullptr; -static void Call_System_Private_CoreLib_System_AppContext_Setup_I32_I32_I32_I32_RetVoid(void * arg0, void * arg1, int32_t arg2, void * arg3) -{ - int64_t args[4] = { (int64_t)arg0, (int64_t)arg1, (int64_t)arg2, (int64_t)arg3 }; - - // Lazy lookup of MethodDesc for the function export scenario. - if (!MD_System_Private_CoreLib_System_AppContext_Setup_I32_I32_I32_I32_RetVoid) - { - LookupMethodByName("System.AppContext, System.Private.CoreLib", "Setup", &MD_System_Private_CoreLib_System_AppContext_Setup_I32_I32_I32_I32_RetVoid); - } - ExecuteInterpretedMethodFromUnmanaged(MD_System_Private_CoreLib_System_AppContext_Setup_I32_I32_I32_I32_RetVoid, (int8_t*)args, sizeof(args), nullptr, (PCODE)&Call_System_Private_CoreLib_System_AppContext_Setup_I32_I32_I32_I32_RetVoid); -} - static MethodDesc* MD_System_Runtime_InteropServices_JavaScript_System_Runtime_InteropServices_JavaScript_JavaScriptExports_ReleaseJSOwnedObjectByGCHandle_I32_RetVoid = nullptr; static void Call_System_Runtime_InteropServices_JavaScript_System_Runtime_InteropServices_JavaScript_JavaScriptExports_ReleaseJSOwnedObjectByGCHandle_I32_RetVoid(void * arg0) { @@ -409,6 +357,19 @@ extern "C" void SystemInteropJS_ReleaseJSOwnedObjectByGCHandle(void * arg0) Call_System_Runtime_InteropServices_JavaScript_System_Runtime_InteropServices_JavaScript_JavaScriptExports_ReleaseJSOwnedObjectByGCHandle_I32_RetVoid(arg0); } +static MethodDesc* MD_System_Private_CoreLib_System_AppContext_Setup_I32_I32_I32_I32_RetVoid = nullptr; +static void Call_System_Private_CoreLib_System_AppContext_Setup_I32_I32_I32_I32_RetVoid(void * arg0, void * arg1, int32_t arg2, void * arg3) +{ + int64_t args[4] = { (int64_t)arg0, (int64_t)arg1, (int64_t)arg2, (int64_t)arg3 }; + + // Lazy lookup of MethodDesc for the function export scenario. + if (!MD_System_Private_CoreLib_System_AppContext_Setup_I32_I32_I32_I32_RetVoid) + { + LookupMethodByName("System.AppContext, System.Private.CoreLib", "Setup", &MD_System_Private_CoreLib_System_AppContext_Setup_I32_I32_I32_I32_RetVoid); + } + ExecuteInterpretedMethodFromUnmanaged(MD_System_Private_CoreLib_System_AppContext_Setup_I32_I32_I32_I32_RetVoid, (int8_t*)args, sizeof(args), nullptr, (PCODE)&Call_System_Private_CoreLib_System_AppContext_Setup_I32_I32_I32_I32_RetVoid); +} + static MethodDesc* MD_System_Private_CoreLib_System_Threading_TimerQueue_TimerHandler_Void_RetVoid = nullptr; static void Call_System_Private_CoreLib_System_Threading_TimerQueue_TimerHandler_Void_RetVoid() { @@ -443,34 +404,31 @@ static int32_t Call_System_Private_CoreLib_Internal_Runtime_InteropServices_ComA extern const ReverseThunkMapEntry g_ReverseThunks[] = { - { 2644319180, 3863938719, { &MD_System_Private_CoreLib_System_GC__RegisterNoGCRegionCallback_g__Callback_7C_72_0_I32_RetVoid, (void*)&Call_System_Private_CoreLib_System_GC__RegisterNoGCRegionCallback_g__Callback_7C_72_0_I32_RetVoid } } /* alternate key source: g__Callback|72_0#1:System.Private.CoreLib:System:GC */, - { 2644321553, 1336557534, { &MD_System_Private_CoreLib_System_Threading_ThreadPool_BackgroundJobHandler_Void_RetVoid, (void*)&Call_System_Private_CoreLib_System_Threading_ThreadPool_BackgroundJobHandler_Void_RetVoid } } /* alternate key source: BackgroundJobHandler#0:System.Private.CoreLib:System.Threading:ThreadPool */, + { 2644319183, 3863938719, { &MD_System_Private_CoreLib_System_GC__RegisterNoGCRegionCallback_g__Callback_7C_72_0_I32_RetVoid, (void*)&Call_System_Private_CoreLib_System_GC__RegisterNoGCRegionCallback_g__Callback_7C_72_0_I32_RetVoid } } /* alternate key source: g__Callback|72_0#1:System.Private.CoreLib:System:GC */, + { 2644321751, 1336557534, { &MD_System_Private_CoreLib_System_Threading_ThreadPool_BackgroundJobHandler_Void_RetVoid, (void*)&Call_System_Private_CoreLib_System_Threading_ThreadPool_BackgroundJobHandler_Void_RetVoid } } /* alternate key source: BackgroundJobHandler#0:System.Private.CoreLib:System.Threading:ThreadPool */, { 3685902049, 2901966433, { &MD_System_Runtime_InteropServices_JavaScript_System_Runtime_InteropServices_JavaScript_JavaScriptExports_BindAssemblyExports_I32_RetVoid, (void*)&Call_System_Runtime_InteropServices_JavaScript_System_Runtime_InteropServices_JavaScript_JavaScriptExports_BindAssemblyExports_I32_RetVoid } } /* alternate key source: BindAssemblyExports#1:System.Runtime.InteropServices.JavaScript:System.Runtime.InteropServices.JavaScript:JavaScriptExports */, { 3685902050, 2601830388, { &MD_System_Runtime_InteropServices_JavaScript_System_Runtime_InteropServices_JavaScript_JavaScriptExports_CallDelegate_I32_RetVoid, (void*)&Call_System_Runtime_InteropServices_JavaScript_System_Runtime_InteropServices_JavaScript_JavaScriptExports_CallDelegate_I32_RetVoid } } /* alternate key source: CallDelegate#1:System.Runtime.InteropServices.JavaScript:System.Runtime.InteropServices.JavaScript:JavaScriptExports */, { 3685902054, 433365813, { &MD_System_Runtime_InteropServices_JavaScript_System_Runtime_InteropServices_JavaScript_JavaScriptExports_CallJSExport_I32_I32_RetVoid, (void*)&Call_System_Runtime_InteropServices_JavaScript_System_Runtime_InteropServices_JavaScript_JavaScriptExports_CallJSExport_I32_I32_RetVoid } } /* alternate key source: CallJSExport#2:System.Runtime.InteropServices.JavaScript:System.Runtime.InteropServices.JavaScript:JavaScriptExports */, + { 2644335566, 3358042195, { &MD_System_Private_CoreLib_System_StubHelpers_MngdRefCustomMarshaler_ClearManaged_I32_I32_I32_I32_RetVoid, (void*)&Call_System_Private_CoreLib_System_StubHelpers_MngdRefCustomMarshaler_ClearManaged_I32_I32_I32_I32_RetVoid } } /* alternate key source: ClearManaged#4:System.Private.CoreLib:System.StubHelpers:MngdRefCustomMarshaler */, + { 2644335568, 2311968855, { &MD_System_Private_CoreLib_System_StubHelpers_MngdRefCustomMarshaler_ClearNative_I32_I32_I32_I32_RetVoid, (void*)&Call_System_Private_CoreLib_System_StubHelpers_MngdRefCustomMarshaler_ClearNative_I32_I32_I32_I32_RetVoid } } /* alternate key source: ClearNative#4:System.Private.CoreLib:System.StubHelpers:MngdRefCustomMarshaler */, { 3685902051, 3113228365, { &MD_System_Runtime_InteropServices_JavaScript_System_Runtime_InteropServices_JavaScript_JavaScriptExports_CompleteTask_I32_RetVoid, (void*)&Call_System_Runtime_InteropServices_JavaScript_System_Runtime_InteropServices_JavaScript_JavaScriptExports_CompleteTask_I32_RetVoid } } /* alternate key source: CompleteTask#1:System.Runtime.InteropServices.JavaScript:System.Runtime.InteropServices.JavaScript:JavaScriptExports */, - { 2644319191, 3378852959, { &MD_System_Private_CoreLib_System_GC_ConfigCallback_I32_I32_I32_I32_I64_RetVoid, (void*)&Call_System_Private_CoreLib_System_GC_ConfigCallback_I32_I32_I32_I32_I64_RetVoid } } /* alternate key source: ConfigCallback#5:System.Private.CoreLib:System:GC */, - { 2644325221, 1196551088, { &MD_System_Private_CoreLib_System_Globalization_CalendarData_EnumCalendarInfoCallback_I32_I32_RetVoid, (void*)&Call_System_Private_CoreLib_System_Globalization_CalendarData_EnumCalendarInfoCallback_I32_I32_RetVoid } } /* alternate key source: EnumCalendarInfoCallback#2:System.Private.CoreLib:System.Globalization:CalendarData */, - { 2644360529, 2613312799, { &MD_System_Private_CoreLib_Internal_Runtime_InteropServices_ComActivator_GetClassFactoryForTypeInternal_I32_RetI32, (void*)&Call_System_Private_CoreLib_Internal_Runtime_InteropServices_ComActivator_GetClassFactoryForTypeInternal_I32_RetI32 } } /* alternate key source: GetClassFactoryForTypeInternal#1:System.Private.CoreLib:Internal.Runtime.InteropServices:ComActivator */, - { 2644360539, 993231473, { &MD_System_Private_CoreLib_Internal_Runtime_InteropServices_ComponentActivator_GetFunctionPointer_I32_I32_I32_I32_I32_I32_RetI32, (void*)&Call_System_Private_CoreLib_Internal_Runtime_InteropServices_ComponentActivator_GetFunctionPointer_I32_I32_I32_I32_I32_I32_RetI32 } } /* alternate key source: GetFunctionPointer#6:System.Private.CoreLib:Internal.Runtime.InteropServices:ComponentActivator */, + { 2644319190, 3378852959, { &MD_System_Private_CoreLib_System_GC_ConfigCallback_I32_I32_I32_I32_I64_RetVoid, (void*)&Call_System_Private_CoreLib_System_GC_ConfigCallback_I32_I32_I32_I32_I64_RetVoid } } /* alternate key source: ConfigCallback#5:System.Private.CoreLib:System:GC */, + { 2644335570, 823296796, { &MD_System_Private_CoreLib_System_StubHelpers_MngdRefCustomMarshaler_ConvertContentsToManaged_I32_I32_I32_I32_RetVoid, (void*)&Call_System_Private_CoreLib_System_StubHelpers_MngdRefCustomMarshaler_ConvertContentsToManaged_I32_I32_I32_I32_RetVoid } } /* alternate key source: ConvertContentsToManaged#4:System.Private.CoreLib:System.StubHelpers:MngdRefCustomMarshaler */, + { 2644335572, 3788988216, { &MD_System_Private_CoreLib_System_StubHelpers_MngdRefCustomMarshaler_ConvertContentsToNative_I32_I32_I32_I32_RetVoid, (void*)&Call_System_Private_CoreLib_System_StubHelpers_MngdRefCustomMarshaler_ConvertContentsToNative_I32_I32_I32_I32_RetVoid } } /* alternate key source: ConvertContentsToNative#4:System.Private.CoreLib:System.StubHelpers:MngdRefCustomMarshaler */, + { 2644325231, 1196551088, { &MD_System_Private_CoreLib_System_Globalization_CalendarData_EnumCalendarInfoCallback_I32_I32_RetVoid, (void*)&Call_System_Private_CoreLib_System_Globalization_CalendarData_EnumCalendarInfoCallback_I32_I32_RetVoid } } /* alternate key source: EnumCalendarInfoCallback#2:System.Private.CoreLib:System.Globalization:CalendarData */, + { 2644360476, 2613312799, { &MD_System_Private_CoreLib_Internal_Runtime_InteropServices_ComActivator_GetClassFactoryForTypeInternal_I32_RetI32, (void*)&Call_System_Private_CoreLib_Internal_Runtime_InteropServices_ComActivator_GetClassFactoryForTypeInternal_I32_RetI32 } } /* alternate key source: GetClassFactoryForTypeInternal#1:System.Private.CoreLib:Internal.Runtime.InteropServices:ComActivator */, + { 2644360486, 993231473, { &MD_System_Private_CoreLib_Internal_Runtime_InteropServices_ComponentActivator_GetFunctionPointer_I32_I32_I32_I32_I32_I32_RetI32, (void*)&Call_System_Private_CoreLib_Internal_Runtime_InteropServices_ComponentActivator_GetFunctionPointer_I32_I32_I32_I32_I32_I32_RetI32 } } /* alternate key source: GetFunctionPointer#6:System.Private.CoreLib:Internal.Runtime.InteropServices:ComponentActivator */, { 3685902048, 1081971317, { &MD_System_Runtime_InteropServices_JavaScript_System_Runtime_InteropServices_JavaScript_JavaScriptExports_GetManagedStackTrace_I32_RetVoid, (void*)&Call_System_Runtime_InteropServices_JavaScript_System_Runtime_InteropServices_JavaScript_JavaScriptExports_GetManagedStackTrace_I32_RetVoid } } /* alternate key source: GetManagedStackTrace#1:System.Runtime.InteropServices.JavaScript:System.Runtime.InteropServices.JavaScript:JavaScriptExports */, - { 2644360540, 3422156547, { &MD_System_Private_CoreLib_Internal_Runtime_InteropServices_ComponentActivator_LoadAssembly_I32_I32_I32_RetI32, (void*)&Call_System_Private_CoreLib_Internal_Runtime_InteropServices_ComponentActivator_LoadAssembly_I32_I32_I32_RetI32 } } /* alternate key source: LoadAssembly#3:System.Private.CoreLib:Internal.Runtime.InteropServices:ComponentActivator */, - { 2644360543, 542185314, { &MD_System_Private_CoreLib_Internal_Runtime_InteropServices_ComponentActivator_LoadAssemblyAndGetFunctionPointer_I32_I32_I32_I32_I32_I32_RetI32, (void*)&Call_System_Private_CoreLib_Internal_Runtime_InteropServices_ComponentActivator_LoadAssemblyAndGetFunctionPointer_I32_I32_I32_I32_I32_I32_RetI32 } } /* alternate key source: LoadAssemblyAndGetFunctionPointer#6:System.Private.CoreLib:Internal.Runtime.InteropServices:ComponentActivator */, - { 2644360538, 3765950975, { &MD_System_Private_CoreLib_Internal_Runtime_InteropServices_ComponentActivator_LoadAssemblyBytes_I32_I32_I32_I32_I32_I32_RetI32, (void*)&Call_System_Private_CoreLib_Internal_Runtime_InteropServices_ComponentActivator_LoadAssemblyBytes_I32_I32_I32_I32_I32_I32_RetI32 } } /* alternate key source: LoadAssemblyBytes#6:System.Private.CoreLib:Internal.Runtime.InteropServices:ComponentActivator */, - { 2644339378, 343912841, { &MD_System_Private_CoreLib_System_Runtime_InteropServices_TypeMapLazyDictionary_NewExternalTypeEntry_I32_I32_RetI32, (void*)&Call_System_Private_CoreLib_System_Runtime_InteropServices_TypeMapLazyDictionary_NewExternalTypeEntry_I32_I32_RetI32 } } /* alternate key source: NewExternalTypeEntry#2:System.Private.CoreLib:System.Runtime.InteropServices:TypeMapLazyDictionary */, - { 2644339379, 3327247096, { &MD_System_Private_CoreLib_System_Runtime_InteropServices_TypeMapLazyDictionary_NewProxyTypeEntry_I32_I32_RetI32, (void*)&Call_System_Private_CoreLib_System_Runtime_InteropServices_TypeMapLazyDictionary_NewProxyTypeEntry_I32_I32_RetI32 } } /* alternate key source: NewProxyTypeEntry#2:System.Private.CoreLib:System.Runtime.InteropServices:TypeMapLazyDictionary */, - { 2644360526, 4239234100, { &MD_System_Private_CoreLib_Internal_Runtime_InteropServices_ComActivator_RegisterClassForTypeInternal_I32_RetI32, (void*)&Call_System_Private_CoreLib_Internal_Runtime_InteropServices_ComActivator_RegisterClassForTypeInternal_I32_RetI32 } } /* alternate key source: RegisterClassForTypeInternal#1:System.Private.CoreLib:Internal.Runtime.InteropServices:ComActivator */, - { 2644317642, 1963568864, { &MD_System_Private_CoreLib_System_AppContext_Setup_I32_I32_I32_I32_RetVoid, (void*)&Call_System_Private_CoreLib_System_AppContext_Setup_I32_I32_I32_I32_RetVoid } } /* alternate key source: Setup#4:System.Private.CoreLib:System:AppContext */, + { 2644360491, 3422156547, { &MD_System_Private_CoreLib_Internal_Runtime_InteropServices_ComponentActivator_LoadAssembly_I32_I32_I32_RetI32, (void*)&Call_System_Private_CoreLib_Internal_Runtime_InteropServices_ComponentActivator_LoadAssembly_I32_I32_I32_RetI32 } } /* alternate key source: LoadAssembly#3:System.Private.CoreLib:Internal.Runtime.InteropServices:ComponentActivator */, + { 2644360490, 542185314, { &MD_System_Private_CoreLib_Internal_Runtime_InteropServices_ComponentActivator_LoadAssemblyAndGetFunctionPointer_I32_I32_I32_I32_I32_I32_RetI32, (void*)&Call_System_Private_CoreLib_Internal_Runtime_InteropServices_ComponentActivator_LoadAssemblyAndGetFunctionPointer_I32_I32_I32_I32_I32_I32_RetI32 } } /* alternate key source: LoadAssemblyAndGetFunctionPointer#6:System.Private.CoreLib:Internal.Runtime.InteropServices:ComponentActivator */, + { 2644360489, 3765950975, { &MD_System_Private_CoreLib_Internal_Runtime_InteropServices_ComponentActivator_LoadAssemblyBytes_I32_I32_I32_I32_I32_I32_RetI32, (void*)&Call_System_Private_CoreLib_Internal_Runtime_InteropServices_ComponentActivator_LoadAssemblyBytes_I32_I32_I32_I32_I32_I32_RetI32 } } /* alternate key source: LoadAssemblyBytes#6:System.Private.CoreLib:Internal.Runtime.InteropServices:ComponentActivator */, + { 2644339070, 343912841, { &MD_System_Private_CoreLib_System_Runtime_InteropServices_TypeMapLazyDictionary_NewExternalTypeEntry_I32_I32_RetI32, (void*)&Call_System_Private_CoreLib_System_Runtime_InteropServices_TypeMapLazyDictionary_NewExternalTypeEntry_I32_I32_RetI32 } } /* alternate key source: NewExternalTypeEntry#2:System.Private.CoreLib:System.Runtime.InteropServices:TypeMapLazyDictionary */, + { 2644339071, 3327247096, { &MD_System_Private_CoreLib_System_Runtime_InteropServices_TypeMapLazyDictionary_NewProxyTypeEntry_I32_I32_RetI32, (void*)&Call_System_Private_CoreLib_System_Runtime_InteropServices_TypeMapLazyDictionary_NewProxyTypeEntry_I32_I32_RetI32 } } /* alternate key source: NewProxyTypeEntry#2:System.Private.CoreLib:System.Runtime.InteropServices:TypeMapLazyDictionary */, + { 2644360477, 4239234100, { &MD_System_Private_CoreLib_Internal_Runtime_InteropServices_ComActivator_RegisterClassForTypeInternal_I32_RetI32, (void*)&Call_System_Private_CoreLib_Internal_Runtime_InteropServices_ComActivator_RegisterClassForTypeInternal_I32_RetI32 } } /* alternate key source: RegisterClassForTypeInternal#1:System.Private.CoreLib:Internal.Runtime.InteropServices:ComActivator */, { 3685901981, 1403522766, { &MD_System_Runtime_InteropServices_JavaScript_System_Runtime_InteropServices_JavaScript_JavaScriptExports_ReleaseJSOwnedObjectByGCHandle_I32_RetVoid, (void*)&Call_System_Runtime_InteropServices_JavaScript_System_Runtime_InteropServices_JavaScript_JavaScriptExports_ReleaseJSOwnedObjectByGCHandle_I32_RetVoid } } /* alternate key source: ReleaseJSOwnedObjectByGCHandle#1:System.Runtime.InteropServices.JavaScript:System.Runtime.InteropServices.JavaScript:JavaScriptExports */, - { 2644321735, 167179540, { &MD_System_Private_CoreLib_System_Threading_TimerQueue_TimerHandler_Void_RetVoid, (void*)&Call_System_Private_CoreLib_System_Threading_TimerQueue_TimerHandler_Void_RetVoid } } /* alternate key source: TimerHandler#0:System.Private.CoreLib:System.Threading:TimerQueue */, - { 2644360527, 2150642223, { &MD_System_Private_CoreLib_Internal_Runtime_InteropServices_ComActivator_UnregisterClassForTypeInternal_I32_RetI32, (void*)&Call_System_Private_CoreLib_Internal_Runtime_InteropServices_ComActivator_UnregisterClassForTypeInternal_I32_RetI32 } } /* alternate key source: UnregisterClassForTypeInternal#1:System.Private.CoreLib:Internal.Runtime.InteropServices:ComActivator */, - { 2644340193, 3837429452, { &MD_System_Private_CoreLib_System_Runtime_Loader_AssemblyLoadContext_OnAssemblyLoad_I32_I32_RetVoid, (void*)&Call_System_Private_CoreLib_System_Runtime_Loader_AssemblyLoadContext_OnAssemblyLoad_I32_I32_RetVoid } } /* alternate key source: OnAssemblyLoad#2:System.Private.CoreLib:System.Runtime.Loader:AssemblyLoadContext */, - { 2644340188, 1632250712, { &MD_System_Private_CoreLib_System_Runtime_Loader_AssemblyLoadContext_OnAssemblyResolve_I32_I32_I32_I32_RetVoid, (void*)&Call_System_Private_CoreLib_System_Runtime_Loader_AssemblyLoadContext_OnAssemblyResolve_I32_I32_I32_I32_RetVoid } } /* alternate key source: OnAssemblyResolve#4:System.Private.CoreLib:System.Runtime.Loader:AssemblyLoadContext */, - { 2644340191, 2158495436, { &MD_System_Private_CoreLib_System_Runtime_Loader_AssemblyLoadContext_OnResourceResolve_I32_I32_I32_I32_RetVoid, (void*)&Call_System_Private_CoreLib_System_Runtime_Loader_AssemblyLoadContext_OnResourceResolve_I32_I32_I32_I32_RetVoid } } /* alternate key source: OnResourceResolve#4:System.Private.CoreLib:System.Runtime.Loader:AssemblyLoadContext */, - { 2644340190, 3572430398, { &MD_System_Private_CoreLib_System_Runtime_Loader_AssemblyLoadContext_OnTypeResolve_I32_I32_I32_I32_RetVoid, (void*)&Call_System_Private_CoreLib_System_Runtime_Loader_AssemblyLoadContext_OnTypeResolve_I32_I32_I32_I32_RetVoid } } /* alternate key source: OnTypeResolve#4:System.Private.CoreLib:System.Runtime.Loader:AssemblyLoadContext */, - { 2644340189, 225437511, { &MD_System_Private_CoreLib_System_Runtime_Loader_AssemblyLoadContext_Resolve_I32_I32_I32_I32_RetVoid, (void*)&Call_System_Private_CoreLib_System_Runtime_Loader_AssemblyLoadContext_Resolve_I32_I32_I32_I32_RetVoid } } /* alternate key source: Resolve#4:System.Private.CoreLib:System.Runtime.Loader:AssemblyLoadContext */, - { 2644340186, 260403842, { &MD_System_Private_CoreLib_System_Runtime_Loader_AssemblyLoadContext_ResolveSatelliteAssembly_I32_I32_I32_I32_RetVoid, (void*)&Call_System_Private_CoreLib_System_Runtime_Loader_AssemblyLoadContext_ResolveSatelliteAssembly_I32_I32_I32_I32_RetVoid } } /* alternate key source: ResolveSatelliteAssembly#4:System.Private.CoreLib:System.Runtime.Loader:AssemblyLoadContext */, - { 2644340187, 2533042349, { &MD_System_Private_CoreLib_System_Runtime_Loader_AssemblyLoadContext_ResolveUsingEvent_I32_I32_I32_I32_RetVoid, (void*)&Call_System_Private_CoreLib_System_Runtime_Loader_AssemblyLoadContext_ResolveUsingEvent_I32_I32_I32_I32_RetVoid } } /* alternate key source: ResolveUsingEvent#4:System.Private.CoreLib:System.Runtime.Loader:AssemblyLoadContext */ + { 2644317640, 1963568864, { &MD_System_Private_CoreLib_System_AppContext_Setup_I32_I32_I32_I32_RetVoid, (void*)&Call_System_Private_CoreLib_System_AppContext_Setup_I32_I32_I32_I32_RetVoid } } /* alternate key source: Setup#4:System.Private.CoreLib:System:AppContext */, + { 2644321677, 167179540, { &MD_System_Private_CoreLib_System_Threading_TimerQueue_TimerHandler_Void_RetVoid, (void*)&Call_System_Private_CoreLib_System_Threading_TimerQueue_TimerHandler_Void_RetVoid } } /* alternate key source: TimerHandler#0:System.Private.CoreLib:System.Threading:TimerQueue */, + { 2644360474, 2150642223, { &MD_System_Private_CoreLib_Internal_Runtime_InteropServices_ComActivator_UnregisterClassForTypeInternal_I32_RetI32, (void*)&Call_System_Private_CoreLib_Internal_Runtime_InteropServices_ComActivator_UnregisterClassForTypeInternal_I32_RetI32 } } /* alternate key source: UnregisterClassForTypeInternal#1:System.Private.CoreLib:Internal.Runtime.InteropServices:ComActivator */ }; const size_t g_ReverseThunksCount = sizeof(g_ReverseThunks) / sizeof(g_ReverseThunks[0]); diff --git a/src/tasks/WasmAppBuilder/coreclr/ManagedToNativeGenerator.cs b/src/tasks/WasmAppBuilder/coreclr/ManagedToNativeGenerator.cs index 81cb797b2a6080..286af434f5d804 100644 --- a/src/tasks/WasmAppBuilder/coreclr/ManagedToNativeGenerator.cs +++ b/src/tasks/WasmAppBuilder/coreclr/ManagedToNativeGenerator.cs @@ -91,6 +91,7 @@ public override bool Execute() "iinini", "iinn", "il", + "inn", "lii", "ll", "lli", @@ -106,6 +107,8 @@ public override bool Execute() "viiiiiii", "viin", "vid", + "viil", + "vil", "vin", "vinni", "iinini", From cd955e5f19e2891138e7157bc8a9fb63e84435c4 Mon Sep 17 00:00:00 2001 From: Radek Doulik Date: Mon, 9 Feb 2026 13:08:51 +0100 Subject: [PATCH 049/123] Use lighter workaround for exit code --- src/coreclr/hosts/corerun/wasm/libCorerun.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/coreclr/hosts/corerun/wasm/libCorerun.js b/src/coreclr/hosts/corerun/wasm/libCorerun.js index 8ac4292b3c4fe2..bc6b94de945a55 100644 --- a/src/coreclr/hosts/corerun/wasm/libCorerun.js +++ b/src/coreclr/hosts/corerun/wasm/libCorerun.js @@ -30,10 +30,15 @@ function libCoreRunFactory() { if (!implicit) { EXITSTATUS = status; ABORT = true; + if (dotnetBrowserUtilsExports.abortBackgroundTimers) { + dotnetBrowserUtilsExports.abortBackgroundTimers(); + } } // WASM-TODO temporary workaround to get exit code from runtime tests - if (dotnetBrowserUtilsExports.abortBackgroundTimers) { - dotnetBrowserUtilsExports.abortBackgroundTimers(); + if (DOTNET.lastScheduledFinalizationId) { + globalThis.clearTimeout(DOTNET.lastScheduledFinalizationId); + runtimeKeepalivePop(); + DOTNET.lastScheduledFinalizationId = undefined; } if (!keepRuntimeAlive()) { ABORT = true; From 2827c65049b2760d5bb665b5213c62cfedc70a44 Mon Sep 17 00:00:00 2001 From: pavelsavara Date: Mon, 9 Feb 2026 17:06:10 +0100 Subject: [PATCH 050/123] - fix exit_code in more scenarios - make VM shutdown work also for browser host - abort timers when shutting down --- src/coreclr/hosts/corerun/corerun.cpp | 2 +- src/coreclr/hosts/corerun/wasm/libCorerun.js | 36 ++++++++----------- src/mono/sample/wasm/browser/wwwroot/main.js | 2 +- .../corehost/browserhost/browserhost.cpp | 24 +++++++++++-- src/native/corehost/browserhost/host/host.ts | 12 +++---- src/native/corehost/browserhost/host/index.ts | 12 +++++++ .../browserhost/libBrowserHost.footer.js | 4 ++- .../Common/JavaScript/types/ems-ambient.ts | 18 +++++++--- .../libSystem.Native.Browser.Utils.footer.js | 1 + .../System.Native.Browser/native/crypto.ts | 4 +-- .../native/scheduling.ts | 6 ++-- .../libs/System.Native.Browser/utils/host.ts | 4 ++- 12 files changed, 81 insertions(+), 44 deletions(-) diff --git a/src/coreclr/hosts/corerun/corerun.cpp b/src/coreclr/hosts/corerun/corerun.cpp index c0ee6506726282..a5ce53aedd8b44 100644 --- a/src/coreclr/hosts/corerun/corerun.cpp +++ b/src/coreclr/hosts/corerun/corerun.cpp @@ -613,7 +613,7 @@ static int run(const configuration& config) // The NodeJS process is kept alive by pending async work via safeSetTimeout() -> runtimeKeepalivePush() // The actual exit code would be set by SystemJS_ResolveMainPromise if the managed Main() is async. // Or in Module.onExit handler when managed Main() is synchronous. - return 0; + return exit_code; #else // TARGET_BROWSER return corerun_shutdown(exit_code); #endif // TARGET_BROWSER diff --git a/src/coreclr/hosts/corerun/wasm/libCorerun.js b/src/coreclr/hosts/corerun/wasm/libCorerun.js index bc6b94de945a55..40564469cd90d2 100644 --- a/src/coreclr/hosts/corerun/wasm/libCorerun.js +++ b/src/coreclr/hosts/corerun/wasm/libCorerun.js @@ -9,7 +9,8 @@ function libCoreRunFactory() { "$FS", "$NODEFS", "$NODERAWFS", - "corerun_shutdown" + "corerun_shutdown", + "__funcs_on_exit", ]; const mergeCoreRun = { $CORERUN: { @@ -25,30 +26,21 @@ function libCoreRunFactory() { } ENV["DOTNET_SYSTEM_GLOBALIZATION_INVARIANT"] = "true"; - const originalExitJS = exitJS; - exitJS = (status, implicit) => { - if (!implicit) { - EXITSTATUS = status; - ABORT = true; + + Module.preInit = [() => { + const orig_funcs_on_exit = ___funcs_on_exit; + // it would be better to use addOnExit(), but it's called too late. + ___funcs_on_exit = () => { + // this will prevent more timers (like finalizer) to get scheduled during thread destructor if (dotnetBrowserUtilsExports.abortBackgroundTimers) { dotnetBrowserUtilsExports.abortBackgroundTimers(); } - } - // WASM-TODO temporary workaround to get exit code from runtime tests - if (DOTNET.lastScheduledFinalizationId) { - globalThis.clearTimeout(DOTNET.lastScheduledFinalizationId); - runtimeKeepalivePop(); - DOTNET.lastScheduledFinalizationId = undefined; - } - if (!keepRuntimeAlive()) { - ABORT = true; - var latched = _corerun_shutdown(EXITSTATUS || 0); - if (EXITSTATUS === undefined) { - EXITSTATUS = latched; - } - } - return originalExitJS(EXITSTATUS, implicit); - }; + EXITSTATUS = _corerun_shutdown(EXITSTATUS || 0); + orig_funcs_on_exit(); + }; + + }, ...(Module.preInit || [])]; + }, }, $CORERUN__postset: "CORERUN.selfInitialize()", diff --git a/src/mono/sample/wasm/browser/wwwroot/main.js b/src/mono/sample/wasm/browser/wwwroot/main.js index 1435d9eff08f90..61543f3149f522 100644 --- a/src/mono/sample/wasm/browser/wwwroot/main.js +++ b/src/mono/sample/wasm/browser/wwwroot/main.js @@ -27,8 +27,8 @@ try { const exports = await getAssemblyExports("Wasm.Browser.Sample"); await exports.Sample.Test.PrintMeaning(delay(2000).then(() => 42)); - console.log("Program has exited normally."); await dotnet.runMainAndExit(); + console.log("Program has exited normally."); } catch (err) { exit(2, err); diff --git a/src/native/corehost/browserhost/browserhost.cpp b/src/native/corehost/browserhost/browserhost.cpp index f16ebfafa9f8e4..96ba4ef1becc0c 100644 --- a/src/native/corehost/browserhost/browserhost.cpp +++ b/src/native/corehost/browserhost/browserhost.cpp @@ -124,13 +124,31 @@ extern "C" int BrowserHost_InitializeCoreCLR(int propertiesCount, const char** p extern "C" int BrowserHost_ExecuteAssembly(const char* assemblyPath, int argc, const char** argv) { - int ignore_exit_code = 0; - int retval = coreclr_execute_assembly(CurrentClrInstance, CurrentAppDomainId, argc, argv, assemblyPath, (uint32_t*)&ignore_exit_code); + int exit_code = 0; + int retval = coreclr_execute_assembly(CurrentClrInstance, CurrentAppDomainId, argc, argv, assemblyPath, (uint32_t*)&exit_code); if (retval < 0) { std::fprintf(stderr, "coreclr_execute_assembly failed - Error: 0x%08x\n", retval); return -1; } - return 0; + return exit_code; +} + +extern "C" int BrowserHost_ShutdownCoreCLR(int exit_code) +{ + int latched_exit_code = 0; + int result = coreclr_shutdown_2(CurrentClrInstance, CurrentAppDomainId, &latched_exit_code); + if (result < 0) + { + std::fprintf(stderr, "coreclr_shutdown_2 failed - Error: 0x%08x\n", result); + exit_code = -1; + } + + if (exit_code != -1) + { + exit_code = latched_exit_code; + } + + return exit_code; } diff --git a/src/native/corehost/browserhost/host/host.ts b/src/native/corehost/browserhost/host/host.ts index a8107f16ee36e4..5d27dc4faf42b0 100644 --- a/src/native/corehost/browserhost/host/host.ts +++ b/src/native/corehost/browserhost/host/host.ts @@ -81,14 +81,14 @@ export async function runMain(mainAssemblyName?: string, args?: string[]): Promi ptrs.push(ptr); _ems_.HEAPU32[(argsvPtr >>> 2) + i] = ptr; } - const res = _ems_._BrowserHost_ExecuteAssembly(mainAssemblyNamePtr, args.length, argsvPtr); + _ems_.EXITSTATUS = _ems_._BrowserHost_ExecuteAssembly(mainAssemblyNamePtr, args.length, argsvPtr); for (const ptr of ptrs) { _ems_._free(ptr); } - if (res != 0) { + if (_ems_.EXITSTATUS == -1) { const reason = new Error("Failed to execute assembly"); - _ems_.dotnetApi.exit(res, reason); + _ems_.dotnetApi.exit(-1, reason); throw reason; } @@ -107,9 +107,9 @@ export async function runMain(mainAssemblyName?: string, args?: string[]): Promi } export async function runMainAndExit(mainAssemblyName?: string, args?: string[]): Promise { - const res = await runMain(mainAssemblyName, args); + const exitCode = await runMain(mainAssemblyName, args); try { - _ems_.dotnetApi.exit(0, null); + _ems_.dotnetApi.exit(exitCode, null); } catch (error: any) { // do not propagate ExitStatus exception if (!error || typeof error.status !== "number") { @@ -118,6 +118,6 @@ export async function runMainAndExit(mainAssemblyName?: string, args?: string[]) } return error.status; } - return res; + return exitCode; } diff --git a/src/native/corehost/browserhost/host/index.ts b/src/native/corehost/browserhost/host/index.ts index 04e131fb67782c..26b0bbb177edda 100644 --- a/src/native/corehost/browserhost/host/index.ts +++ b/src/native/corehost/browserhost/host/index.ts @@ -67,6 +67,18 @@ function setupEmscripten() { _ems_.Module.preInit = [() => { _ems_.FS.createPath("/", loaderConfig.virtualWorkingDirectory!, true, true); _ems_.FS.chdir(loaderConfig.virtualWorkingDirectory!); + + const orig_funcs_on_exit = _ems_.___funcs_on_exit; + // it would be better to use addOnExit(), but it's called too late. + _ems_.___funcs_on_exit = () => { + // this will prevent more timers (like finalizer) to get scheduled during thread destructor + if (_ems_.dotnetBrowserUtilsExports.abortBackgroundTimers) { + _ems_.dotnetBrowserUtilsExports.abortBackgroundTimers(); + } + _ems_.EXITSTATUS = _ems_._BrowserHost_ShutdownCoreCLR(_ems_.EXITSTATUS || 0); + orig_funcs_on_exit(); + }; + }, ...(_ems_.Module.preInit || [])]; } diff --git a/src/native/corehost/browserhost/libBrowserHost.footer.js b/src/native/corehost/browserhost/libBrowserHost.footer.js index bf9eb0489485f1..59eef44f53daf6 100644 --- a/src/native/corehost/browserhost/libBrowserHost.footer.js +++ b/src/native/corehost/browserhost/libBrowserHost.footer.js @@ -22,7 +22,9 @@ function libBrowserHostFactory() { "wasm_load_icu_data", "BrowserHost_CreateHostContract", "BrowserHost_InitializeCoreCLR", - "BrowserHost_ExecuteAssembly" + "BrowserHost_ExecuteAssembly", + "BrowserHost_ShutdownCoreCLR", + "__funcs_on_exit", ]; let commonDeps = [ "$DOTNET", diff --git a/src/native/libs/Common/JavaScript/types/ems-ambient.ts b/src/native/libs/Common/JavaScript/types/ems-ambient.ts index 15b4f9dcd8611b..058b2d30c382d0 100644 --- a/src/native/libs/Common/JavaScript/types/ems-ambient.ts +++ b/src/native/libs/Common/JavaScript/types/ems-ambient.ts @@ -38,7 +38,7 @@ export type EmsAmbientSymbolsType = EmscriptenModuleInternal & { _SystemInteropJS_ReleaseJSOwnedObjectByGCHandle: (args: JSMarshalerArguments) => void; _SystemInteropJS_BindAssemblyExports: (args: JSMarshalerArguments) => void; _SystemInteropJS_CallJSExport: (methodHandle: CSFnHandle, args: JSMarshalerArguments) => void; - _corerun_shutdown: (code: number) => void; + _BrowserHost_ShutdownCoreCLR: (exitCode: number) => number; FS: { createPath: (parent: string, path: string, canRead?: boolean, canWrite?: boolean) => string; @@ -47,9 +47,18 @@ export type EmsAmbientSymbolsType = EmscriptenModuleInternal & { } ENV: any; - DOTNET: any; - DOTNET_INTEROP: any; - BROWSER_HOST: any; + DOTNET: { + lastScheduledTimerId?: number; + lastScheduledThreadPoolId?: number; + lastScheduledFinalizationId?: number; + cryptoWarnOnce?: boolean; + isAborting?: boolean; + gitHash?: string; + } + DOTNET_INTEROP: { + gitHash?: string; + }; + BROWSER_HOST: {}; Module: EmscriptenModuleInternal; ENVIRONMENT_IS_NODE: boolean; @@ -74,6 +83,7 @@ export type EmsAmbientSymbolsType = EmscriptenModuleInternal & { _exit: (exitCode: number, implicit?: boolean) => void; abort: (reason: any) => void; ___trap: () => void; + ___funcs_on_exit: () => void; safeSetTimeout: (func: Function, timeout: number) => number; exitJS: (status: number, implicit?: boolean | number) => void; runtimeKeepalivePop: () => void; diff --git a/src/native/libs/System.Native.Browser/libSystem.Native.Browser.Utils.footer.js b/src/native/libs/System.Native.Browser/libSystem.Native.Browser.Utils.footer.js index e269e08ec7d850..b8ca15bb6bfc96 100644 --- a/src/native/libs/System.Native.Browser/libSystem.Native.Browser.Utils.footer.js +++ b/src/native/libs/System.Native.Browser/libSystem.Native.Browser.Utils.footer.js @@ -22,6 +22,7 @@ function libBrowserUtilsFactory() { "$DOTNET", "GetDotNetRuntimeContractDescriptor", "_exit", + "abort", "__trap", "$readI53FromU64", "$readI53FromI64", diff --git a/src/native/libs/System.Native.Browser/native/crypto.ts b/src/native/libs/System.Native.Browser/native/crypto.ts index 013ba19e46f873..650b5470dabc3a 100644 --- a/src/native/libs/System.Native.Browser/native/crypto.ts +++ b/src/native/libs/System.Native.Browser/native/crypto.ts @@ -11,9 +11,9 @@ export function SystemJS_RandomBytes(bufferPtr: number, bufferLength: number): n const batchedQuotaMax = 65536; if (!globalThis.crypto || !globalThis.crypto.getRandomValues) { - if (!_ems_.DOTNET["cryptoWarnOnce"]) { + if (!_ems_.DOTNET.cryptoWarnOnce) { _ems_.dotnetLogger.debug("This engine doesn't support crypto.getRandomValues. Please use a modern version or provide polyfill for 'globalThis.crypto.getRandomValues'."); - _ems_.DOTNET["cryptoWarnOnce"] = true; + _ems_.DOTNET.cryptoWarnOnce = true; } return -1; } diff --git a/src/native/libs/System.Native.Browser/native/scheduling.ts b/src/native/libs/System.Native.Browser/native/scheduling.ts index fab98ca141d587..2e3bb534286c80 100644 --- a/src/native/libs/System.Native.Browser/native/scheduling.ts +++ b/src/native/libs/System.Native.Browser/native/scheduling.ts @@ -4,7 +4,7 @@ import { _ems_ } from "../../Common/JavaScript/ems-ambient"; export function SystemJS_ScheduleTimer(shortestDueTimeMs: number): void { - if (_ems_.ABORT) { + if (_ems_.ABORT || _ems_.DOTNET.isAborting) { // runtime is shutting down return; } @@ -30,7 +30,7 @@ export function SystemJS_ScheduleTimer(shortestDueTimeMs: number): void { } export function SystemJS_ScheduleBackgroundJob(): void { - if (_ems_.ABORT) { + if (_ems_.ABORT || _ems_.DOTNET.isAborting) { // runtime is shutting down return; } @@ -56,7 +56,7 @@ export function SystemJS_ScheduleBackgroundJob(): void { } export function SystemJS_ScheduleFinalization(): void { - if (_ems_.ABORT) { + if (_ems_.ABORT || _ems_.DOTNET.isAborting) { // runtime is shutting down return; } diff --git a/src/native/libs/System.Native.Browser/utils/host.ts b/src/native/libs/System.Native.Browser/utils/host.ts index 2db4f6476176e0..ef76432e137d9a 100644 --- a/src/native/libs/System.Native.Browser/utils/host.ts +++ b/src/native/libs/System.Native.Browser/utils/host.ts @@ -14,7 +14,7 @@ export function getExitStatus(): new (exitCode: number) => any { } export function runBackgroundTimers(): void { - if (_ems_.ABORT) { + if (_ems_.ABORT || _ems_.DOTNET.isAborting) { // runtime is shutting down return; } @@ -32,6 +32,7 @@ export function runBackgroundTimers(): void { } export function abortBackgroundTimers(): void { + _ems_.DOTNET.isAborting = true; if (_ems_.DOTNET.lastScheduledTimerId) { globalThis.clearTimeout(_ems_.DOTNET.lastScheduledTimerId); _ems_.runtimeKeepalivePop(); @@ -53,6 +54,7 @@ export function abortPosix(exitCode: number, reason: any, nativeReady: boolean): try { _ems_.ABORT = true; _ems_.EXITSTATUS = exitCode; + _ems_.DOTNET.isAborting = true; if (exitCode === 0 && nativeReady) { _ems_._exit(0); return; From 226df16de707e8b6c22d4d2d1c7b6aa2885a15d1 Mon Sep 17 00:00:00 2001 From: Radek Doulik Date: Mon, 9 Feb 2026 16:29:44 +0100 Subject: [PATCH 051/123] Increase memory limit to allow tests with 2GB+ requirements --- src/coreclr/hosts/corerun/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/coreclr/hosts/corerun/CMakeLists.txt b/src/coreclr/hosts/corerun/CMakeLists.txt index 1ff47656b4765a..11f34130d8d73a 100644 --- a/src/coreclr/hosts/corerun/CMakeLists.txt +++ b/src/coreclr/hosts/corerun/CMakeLists.txt @@ -78,7 +78,7 @@ else() RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}") target_link_options(corerun PRIVATE -sINITIAL_MEMORY=134217728 - -sMAXIMUM_MEMORY=2147483648 + -sMAXIMUM_MEMORY=4294967296 -sALLOW_MEMORY_GROWTH=1 -sSTACK_SIZE=5MB -sMODULARIZE=1 From 4b844024718e367a4293dab878360e56fbb62a64 Mon Sep 17 00:00:00 2001 From: Radek Doulik Date: Tue, 10 Feb 2026 10:44:41 +0100 Subject: [PATCH 052/123] Feedback --- src/tests/JIT/CodeGenBringUpTests/LocallocLarge.cs | 2 +- .../baseservices/threading/coverage/OSThreadId/OSThreadId.cs | 2 +- src/tests/run.sh | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/tests/JIT/CodeGenBringUpTests/LocallocLarge.cs b/src/tests/JIT/CodeGenBringUpTests/LocallocLarge.cs index 7bb0296bef1d39..ae86c58b79e631 100644 --- a/src/tests/JIT/CodeGenBringUpTests/LocallocLarge.cs +++ b/src/tests/JIT/CodeGenBringUpTests/LocallocLarge.cs @@ -62,7 +62,7 @@ public static bool RunTest(int n) return ok; } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] public static int TestEntryPoint() { for (int j = 2; j < 1024 * 100; j += 331) diff --git a/src/tests/baseservices/threading/coverage/OSThreadId/OSThreadId.cs b/src/tests/baseservices/threading/coverage/OSThreadId/OSThreadId.cs index 96adc6762f081c..c4afabe4ff7e89 100644 --- a/src/tests/baseservices/threading/coverage/OSThreadId/OSThreadId.cs +++ b/src/tests/baseservices/threading/coverage/OSThreadId/OSThreadId.cs @@ -14,7 +14,7 @@ public sealed class OSThreadId private static ManualResetEvent s_resetEvent = new ManualResetEvent(false); private static ulong[] s_threadIds = new ulong[NumThreads]; - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] public static void TestEntryPoint() { // The property to be tested is internal. diff --git a/src/tests/run.sh b/src/tests/run.sh index e3929ce7478627..bc73fa689700dc 100755 --- a/src/tests/run.sh +++ b/src/tests/run.sh @@ -311,7 +311,7 @@ if [[ -n "$RunInterpreter" ]]; then runtestPyArguments+=("--interpreter") fi -if [[ -n "$RunWithNode" ]]; then +if [[ -n "$RunWithNodeJS" ]]; then echo "Running tests with NodeJS" runtestPyArguments+=("--node") fi From 8a8e234c3cb7b8310f71b87b204e3f323115420a Mon Sep 17 00:00:00 2001 From: Radek Doulik Date: Tue, 10 Feb 2026 11:34:04 +0100 Subject: [PATCH 053/123] Add active issues for EH throw in filter --- src/tests/JIT/Methodical/eh/basics/throwinfilter.il | 5 +++++ src/tests/JIT/Methodical/eh/basics/throwinfilter_d.ilproj | 1 + src/tests/JIT/Methodical/eh/basics/throwinfilter_r.ilproj | 1 + .../Regression/CLR-x86-JIT/V1-M12-Beta2/b68872/b68872.il | 7 +++++++ .../CLR-x86-JIT/V1-M12-Beta2/b68872/b68872.ilproj | 3 +++ .../JIT/Regression/JitBlue/GitHub_4044/GitHub_4044.cs | 1 + 6 files changed, 18 insertions(+) diff --git a/src/tests/JIT/Methodical/eh/basics/throwinfilter.il b/src/tests/JIT/Methodical/eh/basics/throwinfilter.il index 87f3f5403cfb2d..eef7659f9f308a 100644 --- a/src/tests/JIT/Methodical/eh/basics/throwinfilter.il +++ b/src/tests/JIT/Methodical/eh/basics/throwinfilter.il @@ -30,6 +30,11 @@ type([TestLibrary]TestLibrary.PlatformDetection) string[1] ('IsMonoInterpreter') } + .custom instance void [Microsoft.DotNet.XUnitExtensions]Xunit.ActiveIssueAttribute::.ctor(string, class [mscorlib]System.Type, string[]) = { + string('https://github.com/dotnet/runtime/issues/123793') + type([TestLibrary]TestLibrary.PlatformDetection) + string[1] ('IsBrowser') + } .entrypoint .maxstack 2 .locals init ( diff --git a/src/tests/JIT/Methodical/eh/basics/throwinfilter_d.ilproj b/src/tests/JIT/Methodical/eh/basics/throwinfilter_d.ilproj index df798474bd2d94..b71604c62c305b 100644 --- a/src/tests/JIT/Methodical/eh/basics/throwinfilter_d.ilproj +++ b/src/tests/JIT/Methodical/eh/basics/throwinfilter_d.ilproj @@ -10,5 +10,6 @@ + diff --git a/src/tests/JIT/Methodical/eh/basics/throwinfilter_r.ilproj b/src/tests/JIT/Methodical/eh/basics/throwinfilter_r.ilproj index 2f9a5e9e5fe5f9..48e69b65f55bf9 100644 --- a/src/tests/JIT/Methodical/eh/basics/throwinfilter_r.ilproj +++ b/src/tests/JIT/Methodical/eh/basics/throwinfilter_r.ilproj @@ -11,5 +11,6 @@ + diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b68872/b68872.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b68872/b68872.il index 4001ca9b95c70c..ec77bde7b8ddf8 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b68872/b68872.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b68872/b68872.il @@ -9,6 +9,8 @@ } .assembly 'b68872' { } .assembly extern xunit.core {} +.assembly extern TestLibrary { .ver 0:0:0:0 } +.assembly extern Microsoft.DotNet.XUnitExtensions { .publickeytoken = (31 BF 38 56 AD 36 4E 35 ) } .namespace JitTest { .class public auto ansi beforefieldinit Test @@ -20,6 +22,11 @@ .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [Microsoft.DotNet.XUnitExtensions]Xunit.ActiveIssueAttribute::.ctor(string, class [mscorlib]System.Type, string[]) = { + string('https://github.com/dotnet/runtime/issues/123793') + type([TestLibrary]TestLibrary.PlatformDetection) + string[1] ('IsBrowser') + } .entrypoint // Code size 120 (0x78) .maxstack 2 diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b68872/b68872.ilproj b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b68872/b68872.ilproj index 0d771280a81bb9..325cd6a2c33eb5 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b68872/b68872.ilproj +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b68872/b68872.ilproj @@ -6,4 +6,7 @@ + + + diff --git a/src/tests/JIT/Regression/JitBlue/GitHub_4044/GitHub_4044.cs b/src/tests/JIT/Regression/JitBlue/GitHub_4044/GitHub_4044.cs index 8802a7ce83628f..6b6ba6dad0355e 100644 --- a/src/tests/JIT/Regression/JitBlue/GitHub_4044/GitHub_4044.cs +++ b/src/tests/JIT/Regression/JitBlue/GitHub_4044/GitHub_4044.cs @@ -10,6 +10,7 @@ public class C { [Fact] [ActiveIssue("https://github.com/dotnet/runtime/issues/114908", typeof(PlatformDetection), nameof(PlatformDetection.IsAppleMobile))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/123793", typeof(PlatformDetection), nameof(PlatformDetection.IsWasm))] [SkipOnMono("needs triage")] public static int TestEntryPoint() { From 120d69d713d27e7288d93412cdb5a26f75c6e683 Mon Sep 17 00:00:00 2001 From: Radek Doulik Date: Tue, 10 Feb 2026 11:35:35 +0100 Subject: [PATCH 054/123] Rerun generator --- .../vm/wasm/callhelpers-interp-to-managed.cpp | 29 +++++++++++++++++++ .../coreclr/ManagedToNativeGenerator.cs | 1 + 2 files changed, 30 insertions(+) diff --git a/src/coreclr/vm/wasm/callhelpers-interp-to-managed.cpp b/src/coreclr/vm/wasm/callhelpers-interp-to-managed.cpp index 8b9b6df093348f..b422661445e880 100644 --- a/src/coreclr/vm/wasm/callhelpers-interp-to-managed.cpp +++ b/src/coreclr/vm/wasm/callhelpers-interp-to-managed.cpp @@ -355,6 +355,12 @@ namespace *((int32_t*)pRet) = (*fptr)(ARG_IND(0), ARG_I32(1), ARG_IND(2), ARG_IND(3)); } + static void CallFunc_IND_IND_RetI32(PCODE pcode, int8_t* pArgs, int8_t* pRet) + { + int32_t (*fptr)(int32_t, int32_t) = (int32_t (*)(int32_t, int32_t))pcode; + *((int32_t*)pRet) = (*fptr)(ARG_IND(0), ARG_IND(1)); + } + static void CallFunc_IND_IND_I32_RetI32(PCODE pcode, int8_t* pArgs, int8_t* pRet) { int32_t (*fptr)(int32_t, int32_t, int32_t) = (int32_t (*)(int32_t, int32_t, int32_t))pcode; @@ -461,6 +467,13 @@ namespace *((int32_t*)pRet) = (*fptr)(ARG_I32(0), ARG_I32(1), ARG_I32(2)); } + static void CallFunc_I32_IND_RetIND(PCODE pcode, int8_t* pArgs, int8_t* pRet) + { + int32_t (*fptr)(int32_t, int32_t) = (int32_t (*)(int32_t, int32_t))pcode; + PORTABILITY_ASSERT("Indirect struct return is not yet implemented."); + *((int32_t*)pRet) = (*fptr)(ARG_I32(0), ARG_IND(1)); + } + static void CallFunc_IND_RetIND(PCODE pcode, int8_t* pArgs, int8_t* pRet) { int32_t (*fptr)(int32_t) = (int32_t (*)(int32_t))pcode; @@ -572,6 +585,12 @@ namespace (*fptr)(ARG_I32(0), ARG_I32(1), ARG_I32(2), ARG_IND(3), ARG_IND(4), ARG_I32(5)); } + static void CallFunc_I32_I32_I64_RetVoid(PCODE pcode, int8_t* pArgs, int8_t* pRet) + { + void (*fptr)(int32_t, int32_t, int64_t) = (void (*)(int32_t, int32_t, int64_t))pcode; + (*fptr)(ARG_I32(0), ARG_I32(1), ARG_I64(2)); + } + static void CallFunc_I32_I32_IND_RetVoid(PCODE pcode, int8_t* pArgs, int8_t* pRet) { void (*fptr)(int32_t, int32_t, int32_t) = (void (*)(int32_t, int32_t, int32_t))pcode; @@ -590,6 +609,12 @@ namespace (*fptr)(ARG_I32(0), ARG_I32(1), ARG_IND(2), ARG_IND(3), ARG_I32(4), ARG_I32(5)); } + static void CallFunc_I32_I64_RetVoid(PCODE pcode, int8_t* pArgs, int8_t* pRet) + { + void (*fptr)(int32_t, int64_t) = (void (*)(int32_t, int64_t))pcode; + (*fptr)(ARG_I32(0), ARG_I64(1)); + } + static void CallFunc_I32_IND_RetVoid(PCODE pcode, int8_t* pArgs, int8_t* pRet) { void (*fptr)(int32_t, int32_t) = (void (*)(int32_t, int32_t))pcode; @@ -732,6 +757,7 @@ const StringToWasmSigThunk g_wasmThunks[] = { { "iniiiii", (void*)&CallFunc_IND_I32_I32_I32_I32_I32_RetI32 }, { "inini", (void*)&CallFunc_IND_I32_IND_I32_RetI32 }, { "ininn", (void*)&CallFunc_IND_I32_IND_IND_RetI32 }, + { "inn", (void*)&CallFunc_IND_IND_RetI32 }, { "inni", (void*)&CallFunc_IND_IND_I32_RetI32 }, { "innii", (void*)&CallFunc_IND_IND_I32_I32_RetI32 }, { "innin", (void*)&CallFunc_IND_IND_I32_IND_RetI32 }, @@ -749,6 +775,7 @@ const StringToWasmSigThunk g_wasmThunks[] = { { "ni", (void*)&CallFunc_I32_RetIND }, { "nii", (void*)&CallFunc_I32_I32_RetIND }, { "niii", (void*)&CallFunc_I32_I32_I32_RetIND }, + { "nin", (void*)&CallFunc_I32_IND_RetIND }, { "nn", (void*)&CallFunc_IND_RetIND }, { "nni", (void*)&CallFunc_IND_I32_RetIND }, { "nnn", (void*)&CallFunc_IND_IND_RetIND }, @@ -767,9 +794,11 @@ const StringToWasmSigThunk g_wasmThunks[] = { { "viiiiiii", (void*)&CallFunc_I32_I32_I32_I32_I32_I32_I32_RetVoid }, { "viiinn", (void*)&CallFunc_I32_I32_I32_IND_IND_RetVoid }, { "viiinni", (void*)&CallFunc_I32_I32_I32_IND_IND_I32_RetVoid }, + { "viil", (void*)&CallFunc_I32_I32_I64_RetVoid }, { "viin", (void*)&CallFunc_I32_I32_IND_RetVoid }, { "viinni", (void*)&CallFunc_I32_I32_IND_IND_I32_RetVoid }, { "viinnii", (void*)&CallFunc_I32_I32_IND_IND_I32_I32_RetVoid }, + { "vil", (void*)&CallFunc_I32_I64_RetVoid }, { "vin", (void*)&CallFunc_I32_IND_RetVoid }, { "vini", (void*)&CallFunc_I32_IND_I32_RetVoid }, { "vinni", (void*)&CallFunc_I32_IND_IND_I32_RetVoid }, diff --git a/src/tasks/WasmAppBuilder/coreclr/ManagedToNativeGenerator.cs b/src/tasks/WasmAppBuilder/coreclr/ManagedToNativeGenerator.cs index 286af434f5d804..2391bb121470f5 100644 --- a/src/tasks/WasmAppBuilder/coreclr/ManagedToNativeGenerator.cs +++ b/src/tasks/WasmAppBuilder/coreclr/ManagedToNativeGenerator.cs @@ -99,6 +99,7 @@ public override bool Execute() "ni", "nii", "niii", + "nin", "nn", "nni", "nnn", From ef6e666de802409f8e2d00c292f8c9db1265f0c4 Mon Sep 17 00:00:00 2001 From: Radek Doulik Date: Tue, 10 Feb 2026 14:15:05 +0100 Subject: [PATCH 055/123] Shorter run of SIMD on wasm --- src/tests/JIT/Methodical/eh/basics/throwinfilter.il | 2 +- src/tests/JIT/SIMD/Sums.cs | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/tests/JIT/Methodical/eh/basics/throwinfilter.il b/src/tests/JIT/Methodical/eh/basics/throwinfilter.il index eef7659f9f308a..a455c0f924cc54 100644 --- a/src/tests/JIT/Methodical/eh/basics/throwinfilter.il +++ b/src/tests/JIT/Methodical/eh/basics/throwinfilter.il @@ -33,7 +33,7 @@ .custom instance void [Microsoft.DotNet.XUnitExtensions]Xunit.ActiveIssueAttribute::.ctor(string, class [mscorlib]System.Type, string[]) = { string('https://github.com/dotnet/runtime/issues/123793') type([TestLibrary]TestLibrary.PlatformDetection) - string[1] ('IsBrowser') + string[1] ('IsWasm') } .entrypoint .maxstack 2 diff --git a/src/tests/JIT/SIMD/Sums.cs b/src/tests/JIT/SIMD/Sums.cs index 5039edaaa6ce83..38612d696dc3b0 100644 --- a/src/tests/JIT/SIMD/Sums.cs +++ b/src/tests/JIT/SIMD/Sums.cs @@ -45,7 +45,8 @@ public static void TestEntryPoint() System.Diagnostics.Stopwatch clock = new System.Diagnostics.Stopwatch(); clock.Start(); Random random = new Random(Seed); - int N = 10000; + // active issue [wasm] https://github.com/dotnet/runtime/issues/124218 + int N = TestLibrary.PlatformDetection.IsWasm ? 1000 : 10000; Point[] arr = new Point[N]; for (int i = 0; i < N; ++i) { From 8978c36f4d181d1c424b8e7684e8526b78351220 Mon Sep 17 00:00:00 2001 From: Radek Doulik Date: Tue, 10 Feb 2026 15:58:41 +0100 Subject: [PATCH 056/123] More active issues --- src/tests/JIT/Methodical/Boxing/morph/sin3double.il | 6 ++++++ src/tests/JIT/Methodical/Methodical_others.csproj | 1 + src/tests/JIT/Methodical/delegate/GSDelegate.cs | 2 ++ .../Methodical/flowgraph/bug619534/moduleHandleCache.cs | 2 ++ src/tests/JIT/Methodical/switch/switch6.il | 7 +++++++ .../Regression/CLR-x86-JIT/V1-M12-Beta2/b68872/b68872.il | 2 +- .../JIT/Regression/JitBlue/GitHub_19438/GitHub_19438.cs | 3 ++- .../Regression/JitBlue/Runtime_105619/Runtime_105619.cs | 1 + .../JIT/Regression/JitBlue/Runtime_70259/Runtime_70259.cs | 1 + .../JIT/Regression/JitBlue/Runtime_70259/Runtime_70259.il | 6 ++++++ .../JIT/Regression/JitBlue/Runtime_72265/Runtime_72265.cs | 1 + src/tests/JIT/SIMD/Sums.cs | 2 +- src/tests/JIT/opt/Regressions/Regression3_Regressions.cs | 1 + src/tests/Loader/classloader/Casting/Functionpointer.cs | 1 + 14 files changed, 33 insertions(+), 3 deletions(-) diff --git a/src/tests/JIT/Methodical/Boxing/morph/sin3double.il b/src/tests/JIT/Methodical/Boxing/morph/sin3double.il index dbe6d04d3707bd..aaf4fd9619f17f 100644 --- a/src/tests/JIT/Methodical/Boxing/morph/sin3double.il +++ b/src/tests/JIT/Methodical/Boxing/morph/sin3double.il @@ -14,6 +14,7 @@ } .assembly extern xunit.core {} .assembly extern Microsoft.DotNet.XUnitExtensions { .publickeytoken = (31 BF 38 56 AD 36 4E 35 ) } +.assembly extern TestLibrary { .ver 0:0:0:0 } .namespace Test_sin3double { .class private sequential ansi sealed beforefieldinit VV extends [mscorlib]System.ValueType @@ -203,6 +204,11 @@ 01 00 00 00 ) .custom instance void [Microsoft.DotNet.XUnitExtensions]Xunit.ActiveIssueAttribute::.ctor(string, valuetype [Microsoft.DotNet.XUnitExtensions]Xunit.TestRuntimes) = {string('https://github.com/dotnet/runtime/issues/34196') int32(2)} + .custom instance void [Microsoft.DotNet.XUnitExtensions]Xunit.ActiveIssueAttribute::.ctor(string, class [mscorlib]System.Type, string[]) = { + string('https://github.com/dotnet/runtime/issues/124222') + type([TestLibrary]TestLibrary.PlatformDetection) + string[1] ('IsWasm') + } .entrypoint .locals (int32 V_0, float64 V_1, diff --git a/src/tests/JIT/Methodical/Methodical_others.csproj b/src/tests/JIT/Methodical/Methodical_others.csproj index 2a72d82d07d8a6..656f2a7525413a 100644 --- a/src/tests/JIT/Methodical/Methodical_others.csproj +++ b/src/tests/JIT/Methodical/Methodical_others.csproj @@ -14,6 +14,7 @@ + diff --git a/src/tests/JIT/Methodical/delegate/GSDelegate.cs b/src/tests/JIT/Methodical/delegate/GSDelegate.cs index 00732f168691ae..be35d69e1e2863 100644 --- a/src/tests/JIT/Methodical/delegate/GSDelegate.cs +++ b/src/tests/JIT/Methodical/delegate/GSDelegate.cs @@ -3,6 +3,7 @@ using System; using System.Reflection; +using TestLibrary; using Xunit; public interface IGetContents { @@ -24,6 +25,7 @@ public partial class Program { public delegate (string, int, T) MyDelegate(IGetContents arg); [Fact] + [ActiveIssue("https://github.com/dotnet/runtime/issues/124221", typeof(PlatformDetection), nameof(PlatformDetection.IsWasm))] public static int TestEntryPoint() { int retVal = 100; diff --git a/src/tests/JIT/Methodical/flowgraph/bug619534/moduleHandleCache.cs b/src/tests/JIT/Methodical/flowgraph/bug619534/moduleHandleCache.cs index 207cc2b205c0e3..29ad67b52dc838 100644 --- a/src/tests/JIT/Methodical/flowgraph/bug619534/moduleHandleCache.cs +++ b/src/tests/JIT/Methodical/flowgraph/bug619534/moduleHandleCache.cs @@ -23,6 +23,7 @@ at Repro.Main() in c:\tests\Dev10\640711\app.cs:line 16 using System; using System.Runtime.CompilerServices; +using TestLibrary; using Xunit; namespace Test_moduleHandleCache_cs @@ -41,6 +42,7 @@ static void Caller(bool b) } [Fact] + [ActiveIssue("https://github.com/dotnet/runtime/issues/124222", typeof(PlatformDetection), nameof(PlatformDetection.IsWasm))] public static void TestEntryPoint() { try diff --git a/src/tests/JIT/Methodical/switch/switch6.il b/src/tests/JIT/Methodical/switch/switch6.il index 898b185fb4152b..89bfeed2aa1818 100644 --- a/src/tests/JIT/Methodical/switch/switch6.il +++ b/src/tests/JIT/Methodical/switch/switch6.il @@ -6,6 +6,8 @@ .assembly extern System.Runtime.Extensions { auto } .assembly extern legacy library mscorlib { auto } .assembly extern System.Console { auto } +.assembly extern Microsoft.DotNet.XUnitExtensions { .publickeytoken = (31 BF 38 56 AD 36 4E 35 ) } +.assembly extern TestLibrary { .ver 0:0:0:0 } .assembly 'switch6' { @@ -87,6 +89,11 @@ .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [Microsoft.DotNet.XUnitExtensions]Xunit.ActiveIssueAttribute::.ctor(string, class [mscorlib]System.Type, string[]) = { + string('https://github.com/dotnet/runtime/issues/124222') + type([TestLibrary]TestLibrary.PlatformDetection) + string[1] ('IsWasm') + } .entrypoint .maxstack 8 IL_0000: ldc.i4.1 diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b68872/b68872.il b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b68872/b68872.il index ec77bde7b8ddf8..a486f66befb259 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b68872/b68872.il +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M12-Beta2/b68872/b68872.il @@ -25,7 +25,7 @@ .custom instance void [Microsoft.DotNet.XUnitExtensions]Xunit.ActiveIssueAttribute::.ctor(string, class [mscorlib]System.Type, string[]) = { string('https://github.com/dotnet/runtime/issues/123793') type([TestLibrary]TestLibrary.PlatformDetection) - string[1] ('IsBrowser') + string[1] ('IsWasm') } .entrypoint // Code size 120 (0x78) diff --git a/src/tests/JIT/Regression/JitBlue/GitHub_19438/GitHub_19438.cs b/src/tests/JIT/Regression/JitBlue/GitHub_19438/GitHub_19438.cs index 5d292b4fcc37a9..34ce905d156c36 100644 --- a/src/tests/JIT/Regression/JitBlue/GitHub_19438/GitHub_19438.cs +++ b/src/tests/JIT/Regression/JitBlue/GitHub_19438/GitHub_19438.cs @@ -68,7 +68,8 @@ public override string ToString() public static void TestEntryPoint() { const int iterationCount = 10; - const int itemCount = 1000000; + // WASM-TODO: active issue https://github.com/dotnet/runtime/issues/124218 + int itemCount = TestLibrary.PlatformDetection.IsWasm ? 1000 : 1000000; long totalTaskTime = 0; diff --git a/src/tests/JIT/Regression/JitBlue/Runtime_105619/Runtime_105619.cs b/src/tests/JIT/Regression/JitBlue/Runtime_105619/Runtime_105619.cs index 8b1d2934503da3..bfda3d82f2c7e9 100644 --- a/src/tests/JIT/Regression/JitBlue/Runtime_105619/Runtime_105619.cs +++ b/src/tests/JIT/Regression/JitBlue/Runtime_105619/Runtime_105619.cs @@ -114,6 +114,7 @@ public class Program public static S2[] s_90; [Fact] + [ActiveIssue("https://github.com/dotnet/runtime/issues/124219", typeof(PlatformDetection), nameof(PlatformDetection.IsWasm))] public static void TestEntryPoint() { try diff --git a/src/tests/JIT/Regression/JitBlue/Runtime_70259/Runtime_70259.cs b/src/tests/JIT/Regression/JitBlue/Runtime_70259/Runtime_70259.cs index a3ad46606faf48..a1cb3d58f367da 100644 --- a/src/tests/JIT/Regression/JitBlue/Runtime_70259/Runtime_70259.cs +++ b/src/tests/JIT/Regression/JitBlue/Runtime_70259/Runtime_70259.cs @@ -11,6 +11,7 @@ class Runtime_70259 { + [ActiveIssue("https://github.com/dotnet/runtime/issues/124221", typeof(PlatformDetection), nameof(PlatformDetection.IsWasm))] private static int Main() { // This creates an open delegate that goes through shuffle thunk and diff --git a/src/tests/JIT/Regression/JitBlue/Runtime_70259/Runtime_70259.il b/src/tests/JIT/Regression/JitBlue/Runtime_70259/Runtime_70259.il index b188d31e3e5218..c6d5c09c3fa984 100644 --- a/src/tests/JIT/Regression/JitBlue/Runtime_70259/Runtime_70259.il +++ b/src/tests/JIT/Regression/JitBlue/Runtime_70259/Runtime_70259.il @@ -10,6 +10,7 @@ // Metadata version: v4.0.30319 .assembly extern System.Runtime { .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) } .assembly extern xunit.core {} +.assembly extern TestLibrary { .ver 0:0:0:0 } .assembly extern Microsoft.DotNet.XUnitExtensions { .publickeytoken = (31 BF 38 56 AD 36 4E 35 ) } .assembly Runtime_70259 { @@ -71,6 +72,11 @@ string('https://github.com/dotnet/runtime/issues/70279') int32(0x2) // Mono } + .custom instance void [Microsoft.DotNet.XUnitExtensions]Xunit.ActiveIssueAttribute::.ctor(string, class [mscorlib]System.Type, string[]) = { + string('https://github.com/dotnet/runtime/issues/124221') + type([TestLibrary]TestLibrary.PlatformDetection) + string[1] ('IsWasm') + } .entrypoint // Code size 31 (0x1f) .maxstack 8 diff --git a/src/tests/JIT/Regression/JitBlue/Runtime_72265/Runtime_72265.cs b/src/tests/JIT/Regression/JitBlue/Runtime_72265/Runtime_72265.cs index 4a739b8c317bf0..66ed79b6050d33 100644 --- a/src/tests/JIT/Regression/JitBlue/Runtime_72265/Runtime_72265.cs +++ b/src/tests/JIT/Regression/JitBlue/Runtime_72265/Runtime_72265.cs @@ -12,6 +12,7 @@ public unsafe class Runtime_72265 { [Fact] [SkipOnMono("https://github.com/dotnet/runtime/issues/72016")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/124219", typeof(PlatformDetection), nameof(PlatformDetection.IsWasm))] public static int TestEntryPoint() { var unmanaged = ((delegate* unmanaged)&GetStructUnmanaged)(); diff --git a/src/tests/JIT/SIMD/Sums.cs b/src/tests/JIT/SIMD/Sums.cs index 38612d696dc3b0..51625196864a4c 100644 --- a/src/tests/JIT/SIMD/Sums.cs +++ b/src/tests/JIT/SIMD/Sums.cs @@ -45,7 +45,7 @@ public static void TestEntryPoint() System.Diagnostics.Stopwatch clock = new System.Diagnostics.Stopwatch(); clock.Start(); Random random = new Random(Seed); - // active issue [wasm] https://github.com/dotnet/runtime/issues/124218 + // WASM-TODO: active issue https://github.com/dotnet/runtime/issues/124218 int N = TestLibrary.PlatformDetection.IsWasm ? 1000 : 10000; Point[] arr = new Point[N]; for (int i = 0; i < N; ++i) diff --git a/src/tests/JIT/opt/Regressions/Regression3_Regressions.cs b/src/tests/JIT/opt/Regressions/Regression3_Regressions.cs index 13aafde5364423..ac8ee0c9d8427b 100644 --- a/src/tests/JIT/opt/Regressions/Regression3_Regressions.cs +++ b/src/tests/JIT/opt/Regressions/Regression3_Regressions.cs @@ -25,6 +25,7 @@ public class Program public static S0[][] s_43 = new S0[][]{new S0[]{new S0()}}; [ActiveIssue("https://github.com/dotnet/runtimelab/issues/155: Assembly.LoadFrom", typeof(Utilities), nameof(Utilities.IsNativeAot))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/124219", typeof(PlatformDetection), nameof(PlatformDetection.IsWasm))] [Fact] public static void TestEntryPoint() { diff --git a/src/tests/Loader/classloader/Casting/Functionpointer.cs b/src/tests/Loader/classloader/Casting/Functionpointer.cs index 633388d11ed6ce..05affc2604e315 100644 --- a/src/tests/Loader/classloader/Casting/Functionpointer.cs +++ b/src/tests/Loader/classloader/Casting/Functionpointer.cs @@ -41,6 +41,7 @@ public static int Function2(int a) { public unsafe class Program { [ActiveIssue("needs triage", typeof(PlatformDetection), nameof(PlatformDetection.IsSimulator))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/124219", typeof(PlatformDetection), nameof(PlatformDetection.IsWasm))] [Fact] public static int TestEntryPoint() { From 6d9290488f168f92c09be1467532936d94667576 Mon Sep 17 00:00:00 2001 From: Radek Doulik Date: Tue, 10 Feb 2026 16:07:41 +0100 Subject: [PATCH 057/123] Add 2 missing signatures + regenerate --- .../vm/wasm/callhelpers-interp-to-managed.cpp | 14 +++ src/coreclr/vm/wasm/callhelpers-pinvoke.cpp | 4 +- src/coreclr/vm/wasm/callhelpers-reverse.cpp | 116 ++++++++++++++++-- .../coreclr/ManagedToNativeGenerator.cs | 2 + 4 files changed, 124 insertions(+), 12 deletions(-) diff --git a/src/coreclr/vm/wasm/callhelpers-interp-to-managed.cpp b/src/coreclr/vm/wasm/callhelpers-interp-to-managed.cpp index b422661445e880..11709a897c812a 100644 --- a/src/coreclr/vm/wasm/callhelpers-interp-to-managed.cpp +++ b/src/coreclr/vm/wasm/callhelpers-interp-to-managed.cpp @@ -385,6 +385,18 @@ namespace *((int64_t*)pRet) = (*fptr)(); } + static void CallFunc_F64_RetI64(PCODE pcode, int8_t* pArgs, int8_t* pRet) + { + int64_t (*fptr)(double) = (int64_t (*)(double))pcode; + *((int64_t*)pRet) = (*fptr)(ARG_F64(0)); + } + + static void CallFunc_F32_RetI64(PCODE pcode, int8_t* pArgs, int8_t* pRet) + { + int64_t (*fptr)(float) = (int64_t (*)(float))pcode; + *((int64_t*)pRet) = (*fptr)(ARG_F32(0)); + } + static void CallFunc_I32_RetI64(PCODE pcode, int8_t* pArgs, int8_t* pRet) { int64_t (*fptr)(int32_t) = (int64_t (*)(int32_t))pcode; @@ -762,6 +774,8 @@ const StringToWasmSigThunk g_wasmThunks[] = { { "innii", (void*)&CallFunc_IND_IND_I32_I32_RetI32 }, { "innin", (void*)&CallFunc_IND_IND_I32_IND_RetI32 }, { "l", (void*)&CallFunc_Void_RetI64 }, + { "ld", (void*)&CallFunc_F64_RetI64 }, + { "lf", (void*)&CallFunc_F32_RetI64 }, { "li", (void*)&CallFunc_I32_RetI64 }, { "lii", (void*)&CallFunc_I32_I32_RetI64 }, { "liiil", (void*)&CallFunc_I32_I32_I32_I64_RetI64 }, diff --git a/src/coreclr/vm/wasm/callhelpers-pinvoke.cpp b/src/coreclr/vm/wasm/callhelpers-pinvoke.cpp index 73e32aeefe51be..256c8a11e04843 100644 --- a/src/coreclr/vm/wasm/callhelpers-pinvoke.cpp +++ b/src/coreclr/vm/wasm/callhelpers-pinvoke.cpp @@ -72,7 +72,6 @@ extern "C" { int32_t SystemNative_ConvertErrorPalToPlatform (int32_t); int32_t SystemNative_ConvertErrorPlatformToPal (int32_t); int32_t SystemNative_CopyFile (void *, void *, int64_t); - void * SystemNative_Dup (void *); int32_t SystemNative_FAllocate (void *, int64_t, int64_t); int32_t SystemNative_FChMod (void *, int32_t); int32_t SystemNative_FChflags (void *, uint32_t); @@ -220,7 +219,6 @@ static const Entry s_libSystem_Native [] = { DllImportEntry(SystemNative_ConvertErrorPalToPlatform) // System.Console, System.IO.Compression.ZipFile, System.IO.MemoryMappedFiles, System.Net.Primitives, System.Private.CoreLib DllImportEntry(SystemNative_ConvertErrorPlatformToPal) // System.Console, System.IO.Compression.ZipFile, System.IO.MemoryMappedFiles, System.Net.Primitives, System.Private.CoreLib DllImportEntry(SystemNative_CopyFile) // System.Private.CoreLib - DllImportEntry(SystemNative_Dup) // System.Console DllImportEntry(SystemNative_FAllocate) // System.Private.CoreLib DllImportEntry(SystemNative_FChMod) // System.Private.CoreLib DllImportEntry(SystemNative_FChflags) // System.Private.CoreLib @@ -329,7 +327,7 @@ typedef struct PInvokeTable { static PInvokeTable s_PInvokeTables[] = { {"libSystem.Globalization.Native", s_libSystem_Globalization_Native, 33}, {"libSystem.IO.Compression.Native", s_libSystem_IO_Compression_Native, 8}, - {"libSystem.Native", s_libSystem_Native, 98}, + {"libSystem.Native", s_libSystem_Native, 97}, {"libSystem.Native.Browser", s_libSystem_Native_Browser, 1}, {"libSystem.Runtime.InteropServices.JavaScript.Native", s_libSystem_Runtime_InteropServices_JavaScript_Native, 6} }; diff --git a/src/coreclr/vm/wasm/callhelpers-reverse.cpp b/src/coreclr/vm/wasm/callhelpers-reverse.cpp index 36810aeda0c76d..67b9c25a257940 100644 --- a/src/coreclr/vm/wasm/callhelpers-reverse.cpp +++ b/src/coreclr/vm/wasm/callhelpers-reverse.cpp @@ -323,6 +323,58 @@ static int32_t Call_System_Private_CoreLib_System_Runtime_InteropServices_TypeMa return result; } +static MethodDesc* MD_System_Private_CoreLib_System_Runtime_Loader_AssemblyLoadContext_OnAssemblyLoad_I32_I32_RetVoid = nullptr; +static void Call_System_Private_CoreLib_System_Runtime_Loader_AssemblyLoadContext_OnAssemblyLoad_I32_I32_RetVoid(void * arg0, void * arg1) +{ + int64_t args[2] = { (int64_t)arg0, (int64_t)arg1 }; + + // Lazy lookup of MethodDesc for the function export scenario. + if (!MD_System_Private_CoreLib_System_Runtime_Loader_AssemblyLoadContext_OnAssemblyLoad_I32_I32_RetVoid) + { + LookupMethodByName("System.Runtime.Loader.AssemblyLoadContext, System.Private.CoreLib", "OnAssemblyLoad", &MD_System_Private_CoreLib_System_Runtime_Loader_AssemblyLoadContext_OnAssemblyLoad_I32_I32_RetVoid); + } + ExecuteInterpretedMethodFromUnmanaged(MD_System_Private_CoreLib_System_Runtime_Loader_AssemblyLoadContext_OnAssemblyLoad_I32_I32_RetVoid, (int8_t*)args, sizeof(args), nullptr, (PCODE)&Call_System_Private_CoreLib_System_Runtime_Loader_AssemblyLoadContext_OnAssemblyLoad_I32_I32_RetVoid); +} + +static MethodDesc* MD_System_Private_CoreLib_System_Runtime_Loader_AssemblyLoadContext_OnAssemblyResolve_I32_I32_I32_I32_RetVoid = nullptr; +static void Call_System_Private_CoreLib_System_Runtime_Loader_AssemblyLoadContext_OnAssemblyResolve_I32_I32_I32_I32_RetVoid(void * arg0, void * arg1, void * arg2, void * arg3) +{ + int64_t args[4] = { (int64_t)arg0, (int64_t)arg1, (int64_t)arg2, (int64_t)arg3 }; + + // Lazy lookup of MethodDesc for the function export scenario. + if (!MD_System_Private_CoreLib_System_Runtime_Loader_AssemblyLoadContext_OnAssemblyResolve_I32_I32_I32_I32_RetVoid) + { + LookupMethodByName("System.Runtime.Loader.AssemblyLoadContext, System.Private.CoreLib", "OnAssemblyResolve", &MD_System_Private_CoreLib_System_Runtime_Loader_AssemblyLoadContext_OnAssemblyResolve_I32_I32_I32_I32_RetVoid); + } + ExecuteInterpretedMethodFromUnmanaged(MD_System_Private_CoreLib_System_Runtime_Loader_AssemblyLoadContext_OnAssemblyResolve_I32_I32_I32_I32_RetVoid, (int8_t*)args, sizeof(args), nullptr, (PCODE)&Call_System_Private_CoreLib_System_Runtime_Loader_AssemblyLoadContext_OnAssemblyResolve_I32_I32_I32_I32_RetVoid); +} + +static MethodDesc* MD_System_Private_CoreLib_System_Runtime_Loader_AssemblyLoadContext_OnResourceResolve_I32_I32_I32_I32_RetVoid = nullptr; +static void Call_System_Private_CoreLib_System_Runtime_Loader_AssemblyLoadContext_OnResourceResolve_I32_I32_I32_I32_RetVoid(void * arg0, void * arg1, void * arg2, void * arg3) +{ + int64_t args[4] = { (int64_t)arg0, (int64_t)arg1, (int64_t)arg2, (int64_t)arg3 }; + + // Lazy lookup of MethodDesc for the function export scenario. + if (!MD_System_Private_CoreLib_System_Runtime_Loader_AssemblyLoadContext_OnResourceResolve_I32_I32_I32_I32_RetVoid) + { + LookupMethodByName("System.Runtime.Loader.AssemblyLoadContext, System.Private.CoreLib", "OnResourceResolve", &MD_System_Private_CoreLib_System_Runtime_Loader_AssemblyLoadContext_OnResourceResolve_I32_I32_I32_I32_RetVoid); + } + ExecuteInterpretedMethodFromUnmanaged(MD_System_Private_CoreLib_System_Runtime_Loader_AssemblyLoadContext_OnResourceResolve_I32_I32_I32_I32_RetVoid, (int8_t*)args, sizeof(args), nullptr, (PCODE)&Call_System_Private_CoreLib_System_Runtime_Loader_AssemblyLoadContext_OnResourceResolve_I32_I32_I32_I32_RetVoid); +} + +static MethodDesc* MD_System_Private_CoreLib_System_Runtime_Loader_AssemblyLoadContext_OnTypeResolve_I32_I32_I32_I32_RetVoid = nullptr; +static void Call_System_Private_CoreLib_System_Runtime_Loader_AssemblyLoadContext_OnTypeResolve_I32_I32_I32_I32_RetVoid(void * arg0, void * arg1, void * arg2, void * arg3) +{ + int64_t args[4] = { (int64_t)arg0, (int64_t)arg1, (int64_t)arg2, (int64_t)arg3 }; + + // Lazy lookup of MethodDesc for the function export scenario. + if (!MD_System_Private_CoreLib_System_Runtime_Loader_AssemblyLoadContext_OnTypeResolve_I32_I32_I32_I32_RetVoid) + { + LookupMethodByName("System.Runtime.Loader.AssemblyLoadContext, System.Private.CoreLib", "OnTypeResolve", &MD_System_Private_CoreLib_System_Runtime_Loader_AssemblyLoadContext_OnTypeResolve_I32_I32_I32_I32_RetVoid); + } + ExecuteInterpretedMethodFromUnmanaged(MD_System_Private_CoreLib_System_Runtime_Loader_AssemblyLoadContext_OnTypeResolve_I32_I32_I32_I32_RetVoid, (int8_t*)args, sizeof(args), nullptr, (PCODE)&Call_System_Private_CoreLib_System_Runtime_Loader_AssemblyLoadContext_OnTypeResolve_I32_I32_I32_I32_RetVoid); +} + static MethodDesc* MD_System_Private_CoreLib_Internal_Runtime_InteropServices_ComActivator_RegisterClassForTypeInternal_I32_RetI32 = nullptr; static int32_t Call_System_Private_CoreLib_Internal_Runtime_InteropServices_ComActivator_RegisterClassForTypeInternal_I32_RetI32(void * arg0) { @@ -357,6 +409,45 @@ extern "C" void SystemInteropJS_ReleaseJSOwnedObjectByGCHandle(void * arg0) Call_System_Runtime_InteropServices_JavaScript_System_Runtime_InteropServices_JavaScript_JavaScriptExports_ReleaseJSOwnedObjectByGCHandle_I32_RetVoid(arg0); } +static MethodDesc* MD_System_Private_CoreLib_System_Runtime_Loader_AssemblyLoadContext_Resolve_I32_I32_I32_I32_RetVoid = nullptr; +static void Call_System_Private_CoreLib_System_Runtime_Loader_AssemblyLoadContext_Resolve_I32_I32_I32_I32_RetVoid(void * arg0, void * arg1, void * arg2, void * arg3) +{ + int64_t args[4] = { (int64_t)arg0, (int64_t)arg1, (int64_t)arg2, (int64_t)arg3 }; + + // Lazy lookup of MethodDesc for the function export scenario. + if (!MD_System_Private_CoreLib_System_Runtime_Loader_AssemblyLoadContext_Resolve_I32_I32_I32_I32_RetVoid) + { + LookupMethodByName("System.Runtime.Loader.AssemblyLoadContext, System.Private.CoreLib", "Resolve", &MD_System_Private_CoreLib_System_Runtime_Loader_AssemblyLoadContext_Resolve_I32_I32_I32_I32_RetVoid); + } + ExecuteInterpretedMethodFromUnmanaged(MD_System_Private_CoreLib_System_Runtime_Loader_AssemblyLoadContext_Resolve_I32_I32_I32_I32_RetVoid, (int8_t*)args, sizeof(args), nullptr, (PCODE)&Call_System_Private_CoreLib_System_Runtime_Loader_AssemblyLoadContext_Resolve_I32_I32_I32_I32_RetVoid); +} + +static MethodDesc* MD_System_Private_CoreLib_System_Runtime_Loader_AssemblyLoadContext_ResolveSatelliteAssembly_I32_I32_I32_I32_RetVoid = nullptr; +static void Call_System_Private_CoreLib_System_Runtime_Loader_AssemblyLoadContext_ResolveSatelliteAssembly_I32_I32_I32_I32_RetVoid(void * arg0, void * arg1, void * arg2, void * arg3) +{ + int64_t args[4] = { (int64_t)arg0, (int64_t)arg1, (int64_t)arg2, (int64_t)arg3 }; + + // Lazy lookup of MethodDesc for the function export scenario. + if (!MD_System_Private_CoreLib_System_Runtime_Loader_AssemblyLoadContext_ResolveSatelliteAssembly_I32_I32_I32_I32_RetVoid) + { + LookupMethodByName("System.Runtime.Loader.AssemblyLoadContext, System.Private.CoreLib", "ResolveSatelliteAssembly", &MD_System_Private_CoreLib_System_Runtime_Loader_AssemblyLoadContext_ResolveSatelliteAssembly_I32_I32_I32_I32_RetVoid); + } + ExecuteInterpretedMethodFromUnmanaged(MD_System_Private_CoreLib_System_Runtime_Loader_AssemblyLoadContext_ResolveSatelliteAssembly_I32_I32_I32_I32_RetVoid, (int8_t*)args, sizeof(args), nullptr, (PCODE)&Call_System_Private_CoreLib_System_Runtime_Loader_AssemblyLoadContext_ResolveSatelliteAssembly_I32_I32_I32_I32_RetVoid); +} + +static MethodDesc* MD_System_Private_CoreLib_System_Runtime_Loader_AssemblyLoadContext_ResolveUsingEvent_I32_I32_I32_I32_RetVoid = nullptr; +static void Call_System_Private_CoreLib_System_Runtime_Loader_AssemblyLoadContext_ResolveUsingEvent_I32_I32_I32_I32_RetVoid(void * arg0, void * arg1, void * arg2, void * arg3) +{ + int64_t args[4] = { (int64_t)arg0, (int64_t)arg1, (int64_t)arg2, (int64_t)arg3 }; + + // Lazy lookup of MethodDesc for the function export scenario. + if (!MD_System_Private_CoreLib_System_Runtime_Loader_AssemblyLoadContext_ResolveUsingEvent_I32_I32_I32_I32_RetVoid) + { + LookupMethodByName("System.Runtime.Loader.AssemblyLoadContext, System.Private.CoreLib", "ResolveUsingEvent", &MD_System_Private_CoreLib_System_Runtime_Loader_AssemblyLoadContext_ResolveUsingEvent_I32_I32_I32_I32_RetVoid); + } + ExecuteInterpretedMethodFromUnmanaged(MD_System_Private_CoreLib_System_Runtime_Loader_AssemblyLoadContext_ResolveUsingEvent_I32_I32_I32_I32_RetVoid, (int8_t*)args, sizeof(args), nullptr, (PCODE)&Call_System_Private_CoreLib_System_Runtime_Loader_AssemblyLoadContext_ResolveUsingEvent_I32_I32_I32_I32_RetVoid); +} + static MethodDesc* MD_System_Private_CoreLib_System_AppContext_Setup_I32_I32_I32_I32_RetVoid = nullptr; static void Call_System_Private_CoreLib_System_AppContext_Setup_I32_I32_I32_I32_RetVoid(void * arg0, void * arg1, int32_t arg2, void * arg3) { @@ -416,19 +507,26 @@ extern const ReverseThunkMapEntry g_ReverseThunks[] = { 2644335570, 823296796, { &MD_System_Private_CoreLib_System_StubHelpers_MngdRefCustomMarshaler_ConvertContentsToManaged_I32_I32_I32_I32_RetVoid, (void*)&Call_System_Private_CoreLib_System_StubHelpers_MngdRefCustomMarshaler_ConvertContentsToManaged_I32_I32_I32_I32_RetVoid } } /* alternate key source: ConvertContentsToManaged#4:System.Private.CoreLib:System.StubHelpers:MngdRefCustomMarshaler */, { 2644335572, 3788988216, { &MD_System_Private_CoreLib_System_StubHelpers_MngdRefCustomMarshaler_ConvertContentsToNative_I32_I32_I32_I32_RetVoid, (void*)&Call_System_Private_CoreLib_System_StubHelpers_MngdRefCustomMarshaler_ConvertContentsToNative_I32_I32_I32_I32_RetVoid } } /* alternate key source: ConvertContentsToNative#4:System.Private.CoreLib:System.StubHelpers:MngdRefCustomMarshaler */, { 2644325231, 1196551088, { &MD_System_Private_CoreLib_System_Globalization_CalendarData_EnumCalendarInfoCallback_I32_I32_RetVoid, (void*)&Call_System_Private_CoreLib_System_Globalization_CalendarData_EnumCalendarInfoCallback_I32_I32_RetVoid } } /* alternate key source: EnumCalendarInfoCallback#2:System.Private.CoreLib:System.Globalization:CalendarData */, - { 2644360476, 2613312799, { &MD_System_Private_CoreLib_Internal_Runtime_InteropServices_ComActivator_GetClassFactoryForTypeInternal_I32_RetI32, (void*)&Call_System_Private_CoreLib_Internal_Runtime_InteropServices_ComActivator_GetClassFactoryForTypeInternal_I32_RetI32 } } /* alternate key source: GetClassFactoryForTypeInternal#1:System.Private.CoreLib:Internal.Runtime.InteropServices:ComActivator */, - { 2644360486, 993231473, { &MD_System_Private_CoreLib_Internal_Runtime_InteropServices_ComponentActivator_GetFunctionPointer_I32_I32_I32_I32_I32_I32_RetI32, (void*)&Call_System_Private_CoreLib_Internal_Runtime_InteropServices_ComponentActivator_GetFunctionPointer_I32_I32_I32_I32_I32_I32_RetI32 } } /* alternate key source: GetFunctionPointer#6:System.Private.CoreLib:Internal.Runtime.InteropServices:ComponentActivator */, + { 2644360699, 2613312799, { &MD_System_Private_CoreLib_Internal_Runtime_InteropServices_ComActivator_GetClassFactoryForTypeInternal_I32_RetI32, (void*)&Call_System_Private_CoreLib_Internal_Runtime_InteropServices_ComActivator_GetClassFactoryForTypeInternal_I32_RetI32 } } /* alternate key source: GetClassFactoryForTypeInternal#1:System.Private.CoreLib:Internal.Runtime.InteropServices:ComActivator */, + { 2644360453, 993231473, { &MD_System_Private_CoreLib_Internal_Runtime_InteropServices_ComponentActivator_GetFunctionPointer_I32_I32_I32_I32_I32_I32_RetI32, (void*)&Call_System_Private_CoreLib_Internal_Runtime_InteropServices_ComponentActivator_GetFunctionPointer_I32_I32_I32_I32_I32_I32_RetI32 } } /* alternate key source: GetFunctionPointer#6:System.Private.CoreLib:Internal.Runtime.InteropServices:ComponentActivator */, { 3685902048, 1081971317, { &MD_System_Runtime_InteropServices_JavaScript_System_Runtime_InteropServices_JavaScript_JavaScriptExports_GetManagedStackTrace_I32_RetVoid, (void*)&Call_System_Runtime_InteropServices_JavaScript_System_Runtime_InteropServices_JavaScript_JavaScriptExports_GetManagedStackTrace_I32_RetVoid } } /* alternate key source: GetManagedStackTrace#1:System.Runtime.InteropServices.JavaScript:System.Runtime.InteropServices.JavaScript:JavaScriptExports */, - { 2644360491, 3422156547, { &MD_System_Private_CoreLib_Internal_Runtime_InteropServices_ComponentActivator_LoadAssembly_I32_I32_I32_RetI32, (void*)&Call_System_Private_CoreLib_Internal_Runtime_InteropServices_ComponentActivator_LoadAssembly_I32_I32_I32_RetI32 } } /* alternate key source: LoadAssembly#3:System.Private.CoreLib:Internal.Runtime.InteropServices:ComponentActivator */, - { 2644360490, 542185314, { &MD_System_Private_CoreLib_Internal_Runtime_InteropServices_ComponentActivator_LoadAssemblyAndGetFunctionPointer_I32_I32_I32_I32_I32_I32_RetI32, (void*)&Call_System_Private_CoreLib_Internal_Runtime_InteropServices_ComponentActivator_LoadAssemblyAndGetFunctionPointer_I32_I32_I32_I32_I32_I32_RetI32 } } /* alternate key source: LoadAssemblyAndGetFunctionPointer#6:System.Private.CoreLib:Internal.Runtime.InteropServices:ComponentActivator */, - { 2644360489, 3765950975, { &MD_System_Private_CoreLib_Internal_Runtime_InteropServices_ComponentActivator_LoadAssemblyBytes_I32_I32_I32_I32_I32_I32_RetI32, (void*)&Call_System_Private_CoreLib_Internal_Runtime_InteropServices_ComponentActivator_LoadAssemblyBytes_I32_I32_I32_I32_I32_I32_RetI32 } } /* alternate key source: LoadAssemblyBytes#6:System.Private.CoreLib:Internal.Runtime.InteropServices:ComponentActivator */, - { 2644339070, 343912841, { &MD_System_Private_CoreLib_System_Runtime_InteropServices_TypeMapLazyDictionary_NewExternalTypeEntry_I32_I32_RetI32, (void*)&Call_System_Private_CoreLib_System_Runtime_InteropServices_TypeMapLazyDictionary_NewExternalTypeEntry_I32_I32_RetI32 } } /* alternate key source: NewExternalTypeEntry#2:System.Private.CoreLib:System.Runtime.InteropServices:TypeMapLazyDictionary */, - { 2644339071, 3327247096, { &MD_System_Private_CoreLib_System_Runtime_InteropServices_TypeMapLazyDictionary_NewProxyTypeEntry_I32_I32_RetI32, (void*)&Call_System_Private_CoreLib_System_Runtime_InteropServices_TypeMapLazyDictionary_NewProxyTypeEntry_I32_I32_RetI32 } } /* alternate key source: NewProxyTypeEntry#2:System.Private.CoreLib:System.Runtime.InteropServices:TypeMapLazyDictionary */, - { 2644360477, 4239234100, { &MD_System_Private_CoreLib_Internal_Runtime_InteropServices_ComActivator_RegisterClassForTypeInternal_I32_RetI32, (void*)&Call_System_Private_CoreLib_Internal_Runtime_InteropServices_ComActivator_RegisterClassForTypeInternal_I32_RetI32 } } /* alternate key source: RegisterClassForTypeInternal#1:System.Private.CoreLib:Internal.Runtime.InteropServices:ComActivator */, + { 2644360454, 3422156547, { &MD_System_Private_CoreLib_Internal_Runtime_InteropServices_ComponentActivator_LoadAssembly_I32_I32_I32_RetI32, (void*)&Call_System_Private_CoreLib_Internal_Runtime_InteropServices_ComponentActivator_LoadAssembly_I32_I32_I32_RetI32 } } /* alternate key source: LoadAssembly#3:System.Private.CoreLib:Internal.Runtime.InteropServices:ComponentActivator */, + { 2644360457, 542185314, { &MD_System_Private_CoreLib_Internal_Runtime_InteropServices_ComponentActivator_LoadAssemblyAndGetFunctionPointer_I32_I32_I32_I32_I32_I32_RetI32, (void*)&Call_System_Private_CoreLib_Internal_Runtime_InteropServices_ComponentActivator_LoadAssemblyAndGetFunctionPointer_I32_I32_I32_I32_I32_I32_RetI32 } } /* alternate key source: LoadAssemblyAndGetFunctionPointer#6:System.Private.CoreLib:Internal.Runtime.InteropServices:ComponentActivator */, + { 2644360452, 3765950975, { &MD_System_Private_CoreLib_Internal_Runtime_InteropServices_ComponentActivator_LoadAssemblyBytes_I32_I32_I32_I32_I32_I32_RetI32, (void*)&Call_System_Private_CoreLib_Internal_Runtime_InteropServices_ComponentActivator_LoadAssemblyBytes_I32_I32_I32_I32_I32_I32_RetI32 } } /* alternate key source: LoadAssemblyBytes#6:System.Private.CoreLib:Internal.Runtime.InteropServices:ComponentActivator */, + { 2644339039, 343912841, { &MD_System_Private_CoreLib_System_Runtime_InteropServices_TypeMapLazyDictionary_NewExternalTypeEntry_I32_I32_RetI32, (void*)&Call_System_Private_CoreLib_System_Runtime_InteropServices_TypeMapLazyDictionary_NewExternalTypeEntry_I32_I32_RetI32 } } /* alternate key source: NewExternalTypeEntry#2:System.Private.CoreLib:System.Runtime.InteropServices:TypeMapLazyDictionary */, + { 2644339036, 3327247096, { &MD_System_Private_CoreLib_System_Runtime_InteropServices_TypeMapLazyDictionary_NewProxyTypeEntry_I32_I32_RetI32, (void*)&Call_System_Private_CoreLib_System_Runtime_InteropServices_TypeMapLazyDictionary_NewProxyTypeEntry_I32_I32_RetI32 } } /* alternate key source: NewProxyTypeEntry#2:System.Private.CoreLib:System.Runtime.InteropServices:TypeMapLazyDictionary */, + { 2644340165, 3837429452, { &MD_System_Private_CoreLib_System_Runtime_Loader_AssemblyLoadContext_OnAssemblyLoad_I32_I32_RetVoid, (void*)&Call_System_Private_CoreLib_System_Runtime_Loader_AssemblyLoadContext_OnAssemblyLoad_I32_I32_RetVoid } } /* alternate key source: OnAssemblyLoad#2:System.Private.CoreLib:System.Runtime.Loader:AssemblyLoadContext */, + { 2644340160, 1632250712, { &MD_System_Private_CoreLib_System_Runtime_Loader_AssemblyLoadContext_OnAssemblyResolve_I32_I32_I32_I32_RetVoid, (void*)&Call_System_Private_CoreLib_System_Runtime_Loader_AssemblyLoadContext_OnAssemblyResolve_I32_I32_I32_I32_RetVoid } } /* alternate key source: OnAssemblyResolve#4:System.Private.CoreLib:System.Runtime.Loader:AssemblyLoadContext */, + { 2644340163, 2158495436, { &MD_System_Private_CoreLib_System_Runtime_Loader_AssemblyLoadContext_OnResourceResolve_I32_I32_I32_I32_RetVoid, (void*)&Call_System_Private_CoreLib_System_Runtime_Loader_AssemblyLoadContext_OnResourceResolve_I32_I32_I32_I32_RetVoid } } /* alternate key source: OnResourceResolve#4:System.Private.CoreLib:System.Runtime.Loader:AssemblyLoadContext */, + { 2644340162, 3572430398, { &MD_System_Private_CoreLib_System_Runtime_Loader_AssemblyLoadContext_OnTypeResolve_I32_I32_I32_I32_RetVoid, (void*)&Call_System_Private_CoreLib_System_Runtime_Loader_AssemblyLoadContext_OnTypeResolve_I32_I32_I32_I32_RetVoid } } /* alternate key source: OnTypeResolve#4:System.Private.CoreLib:System.Runtime.Loader:AssemblyLoadContext */, + { 2644360696, 4239234100, { &MD_System_Private_CoreLib_Internal_Runtime_InteropServices_ComActivator_RegisterClassForTypeInternal_I32_RetI32, (void*)&Call_System_Private_CoreLib_Internal_Runtime_InteropServices_ComActivator_RegisterClassForTypeInternal_I32_RetI32 } } /* alternate key source: RegisterClassForTypeInternal#1:System.Private.CoreLib:Internal.Runtime.InteropServices:ComActivator */, { 3685901981, 1403522766, { &MD_System_Runtime_InteropServices_JavaScript_System_Runtime_InteropServices_JavaScript_JavaScriptExports_ReleaseJSOwnedObjectByGCHandle_I32_RetVoid, (void*)&Call_System_Runtime_InteropServices_JavaScript_System_Runtime_InteropServices_JavaScript_JavaScriptExports_ReleaseJSOwnedObjectByGCHandle_I32_RetVoid } } /* alternate key source: ReleaseJSOwnedObjectByGCHandle#1:System.Runtime.InteropServices.JavaScript:System.Runtime.InteropServices.JavaScript:JavaScriptExports */, + { 2644340161, 225437511, { &MD_System_Private_CoreLib_System_Runtime_Loader_AssemblyLoadContext_Resolve_I32_I32_I32_I32_RetVoid, (void*)&Call_System_Private_CoreLib_System_Runtime_Loader_AssemblyLoadContext_Resolve_I32_I32_I32_I32_RetVoid } } /* alternate key source: Resolve#4:System.Private.CoreLib:System.Runtime.Loader:AssemblyLoadContext */, + { 2644340158, 260403842, { &MD_System_Private_CoreLib_System_Runtime_Loader_AssemblyLoadContext_ResolveSatelliteAssembly_I32_I32_I32_I32_RetVoid, (void*)&Call_System_Private_CoreLib_System_Runtime_Loader_AssemblyLoadContext_ResolveSatelliteAssembly_I32_I32_I32_I32_RetVoid } } /* alternate key source: ResolveSatelliteAssembly#4:System.Private.CoreLib:System.Runtime.Loader:AssemblyLoadContext */, + { 2644340159, 2533042349, { &MD_System_Private_CoreLib_System_Runtime_Loader_AssemblyLoadContext_ResolveUsingEvent_I32_I32_I32_I32_RetVoid, (void*)&Call_System_Private_CoreLib_System_Runtime_Loader_AssemblyLoadContext_ResolveUsingEvent_I32_I32_I32_I32_RetVoid } } /* alternate key source: ResolveUsingEvent#4:System.Private.CoreLib:System.Runtime.Loader:AssemblyLoadContext */, { 2644317640, 1963568864, { &MD_System_Private_CoreLib_System_AppContext_Setup_I32_I32_I32_I32_RetVoid, (void*)&Call_System_Private_CoreLib_System_AppContext_Setup_I32_I32_I32_I32_RetVoid } } /* alternate key source: Setup#4:System.Private.CoreLib:System:AppContext */, { 2644321677, 167179540, { &MD_System_Private_CoreLib_System_Threading_TimerQueue_TimerHandler_Void_RetVoid, (void*)&Call_System_Private_CoreLib_System_Threading_TimerQueue_TimerHandler_Void_RetVoid } } /* alternate key source: TimerHandler#0:System.Private.CoreLib:System.Threading:TimerQueue */, - { 2644360474, 2150642223, { &MD_System_Private_CoreLib_Internal_Runtime_InteropServices_ComActivator_UnregisterClassForTypeInternal_I32_RetI32, (void*)&Call_System_Private_CoreLib_Internal_Runtime_InteropServices_ComActivator_UnregisterClassForTypeInternal_I32_RetI32 } } /* alternate key source: UnregisterClassForTypeInternal#1:System.Private.CoreLib:Internal.Runtime.InteropServices:ComActivator */ + { 2644360697, 2150642223, { &MD_System_Private_CoreLib_Internal_Runtime_InteropServices_ComActivator_UnregisterClassForTypeInternal_I32_RetI32, (void*)&Call_System_Private_CoreLib_Internal_Runtime_InteropServices_ComActivator_UnregisterClassForTypeInternal_I32_RetI32 } } /* alternate key source: UnregisterClassForTypeInternal#1:System.Private.CoreLib:Internal.Runtime.InteropServices:ComActivator */ }; const size_t g_ReverseThunksCount = sizeof(g_ReverseThunks) / sizeof(g_ReverseThunks[0]); diff --git a/src/tasks/WasmAppBuilder/coreclr/ManagedToNativeGenerator.cs b/src/tasks/WasmAppBuilder/coreclr/ManagedToNativeGenerator.cs index 2391bb121470f5..88bddf47f040c6 100644 --- a/src/tasks/WasmAppBuilder/coreclr/ManagedToNativeGenerator.cs +++ b/src/tasks/WasmAppBuilder/coreclr/ManagedToNativeGenerator.cs @@ -93,6 +93,8 @@ public override bool Execute() "il", "inn", "lii", + "ld", + "lf", "ll", "lli", "n", From d0816e4396ab200aa3246d5f05c53bccbf8085a4 Mon Sep 17 00:00:00 2001 From: Radek Doulik Date: Tue, 10 Feb 2026 16:14:04 +0100 Subject: [PATCH 058/123] Feedback --- eng/pipelines/common/templates/runtimes/run-test-job.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/eng/pipelines/common/templates/runtimes/run-test-job.yml b/eng/pipelines/common/templates/runtimes/run-test-job.yml index fa52d8e2eedb49..3efa4a5944f7ae 100644 --- a/eng/pipelines/common/templates/runtimes/run-test-job.yml +++ b/eng/pipelines/common/templates/runtimes/run-test-job.yml @@ -42,6 +42,7 @@ jobs: archType: ${{ parameters.archType }} osGroup: ${{ parameters.osGroup }} osSubgroup: ${{ parameters.osSubgroup }} + hostedOs: ${{ parameters.hostedOs }} extraBuildArgs: ${{ parameters.extraBuildArgs }} container: ${{ parameters.container }} testGroup: ${{ parameters.testGroup }} From 6ad4c79675c14aafd345ecb7644720e4583350d0 Mon Sep 17 00:00:00 2001 From: Radek Doulik Date: Tue, 10 Feb 2026 17:39:35 +0100 Subject: [PATCH 059/123] Fix build --- .../JIT/Regression/JitBlue/Runtime_105619/Runtime_105619.cs | 1 + src/tests/JIT/Regression/JitBlue/Runtime_72265/Runtime_72265.cs | 1 + 2 files changed, 2 insertions(+) diff --git a/src/tests/JIT/Regression/JitBlue/Runtime_105619/Runtime_105619.cs b/src/tests/JIT/Regression/JitBlue/Runtime_105619/Runtime_105619.cs index bfda3d82f2c7e9..732db9f22bcfd8 100644 --- a/src/tests/JIT/Regression/JitBlue/Runtime_105619/Runtime_105619.cs +++ b/src/tests/JIT/Regression/JitBlue/Runtime_105619/Runtime_105619.cs @@ -15,6 +15,7 @@ namespace Runtime_105619; using System; using System.Runtime.CompilerServices; +using TestLibrary; using Xunit; public interface I1 diff --git a/src/tests/JIT/Regression/JitBlue/Runtime_72265/Runtime_72265.cs b/src/tests/JIT/Regression/JitBlue/Runtime_72265/Runtime_72265.cs index 66ed79b6050d33..06075a060b921e 100644 --- a/src/tests/JIT/Regression/JitBlue/Runtime_72265/Runtime_72265.cs +++ b/src/tests/JIT/Regression/JitBlue/Runtime_72265/Runtime_72265.cs @@ -6,6 +6,7 @@ namespace Runtime_72265; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; +using TestLibrary; using Xunit; public unsafe class Runtime_72265 From 2057781bb1ca45185f22bbf99901a9ecdcee8b72 Mon Sep 17 00:00:00 2001 From: Radek Doulik Date: Tue, 10 Feb 2026 20:22:21 +0100 Subject: [PATCH 060/123] Add active issue to one more test --- src/tests/JIT/Regression/JitBlue/Runtime_79354/Runtime_79354.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/tests/JIT/Regression/JitBlue/Runtime_79354/Runtime_79354.cs b/src/tests/JIT/Regression/JitBlue/Runtime_79354/Runtime_79354.cs index 0bccc7d5857b07..aeaba1bc3df623 100644 --- a/src/tests/JIT/Regression/JitBlue/Runtime_79354/Runtime_79354.cs +++ b/src/tests/JIT/Regression/JitBlue/Runtime_79354/Runtime_79354.cs @@ -6,6 +6,7 @@ namespace Runtime_79354; using System; using System.Reflection; +using TestLibrary; using Xunit; public interface IGetContents { @@ -28,6 +29,7 @@ public class Program { public delegate (string, int, string) MyDelegate(IGetContents arg); [Fact] + [ActiveIssue("https://github.com/dotnet/runtime/issues/124221", typeof(PlatformDetection), nameof(PlatformDetection.IsWasm))] public static int TestEntryPoint() { MyStruct str = new MyStruct(); From bbd2a3bdc9a83e27e73467ad44528d69b90ccf9e Mon Sep 17 00:00:00 2001 From: Radek Doulik Date: Wed, 11 Feb 2026 10:50:54 +0100 Subject: [PATCH 061/123] Add active issues to Loader tests --- .../DiamondShape/svm_diamondshape.il | 11 ++++++++++- .../AmbiguousImplementationException.il | 11 ++++++++++- .../Reabstraction/Reabstraction.il | 5 +++++ 3 files changed, 25 insertions(+), 2 deletions(-) diff --git a/src/tests/Loader/classloader/StaticVirtualMethods/DiamondShape/svm_diamondshape.il b/src/tests/Loader/classloader/StaticVirtualMethods/DiamondShape/svm_diamondshape.il index 8ccecbed64c663..42323a8f79bb6b 100644 --- a/src/tests/Loader/classloader/StaticVirtualMethods/DiamondShape/svm_diamondshape.il +++ b/src/tests/Loader/classloader/StaticVirtualMethods/DiamondShape/svm_diamondshape.il @@ -1528,7 +1528,16 @@ .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [Microsoft.DotNet.XUnitExtensions]Xunit.ActiveIssueAttribute::.ctor(string, class [mscorlib]System.Type, string[]) = {string('https://github.com/dotnet/runtime/issues/72589') type([TestLibrary]TestLibrary.Utilities) string[1] ('IsNativeAot') } + .custom instance void [Microsoft.DotNet.XUnitExtensions]Xunit.ActiveIssueAttribute::.ctor(string, class [mscorlib]System.Type, string[]) = { + string('https://github.com/dotnet/runtime/issues/72589') + type([TestLibrary]TestLibrary.Utilities) + string[1] ('IsNativeAot') + } + .custom instance void [Microsoft.DotNet.XUnitExtensions]Xunit.ActiveIssueAttribute::.ctor(string, class [mscorlib]System.Type, string[]) = { + string('https://github.com/dotnet/runtime/issues/124259') + type([TestLibrary]TestLibrary.PlatformDetection) + string[1] ('IsWasm') + } .entrypoint // Code size 23 (0x17) .maxstack 1 diff --git a/src/tests/Loader/classloader/StaticVirtualMethods/NegativeTestCases/AmbiguousImplementationException.il b/src/tests/Loader/classloader/StaticVirtualMethods/NegativeTestCases/AmbiguousImplementationException.il index 1479e47bde1918..bd29f054e4f881 100644 --- a/src/tests/Loader/classloader/StaticVirtualMethods/NegativeTestCases/AmbiguousImplementationException.il +++ b/src/tests/Loader/classloader/StaticVirtualMethods/NegativeTestCases/AmbiguousImplementationException.il @@ -350,7 +350,16 @@ .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [Microsoft.DotNet.XUnitExtensions]Xunit.ActiveIssueAttribute::.ctor(string, class [System.Runtime]System.Type, string[]) = {string('https://github.com/dotnet/runtimelab/issues/155: Compatible TypeLoadException for invalid inputs') type([TestLibrary]TestLibrary.Utilities) string[1] ('IsNativeAot') } + .custom instance void [Microsoft.DotNet.XUnitExtensions]Xunit.ActiveIssueAttribute::.ctor(string, class [System.Runtime]System.Type, string[]) = { + string('https://github.com/dotnet/runtimelab/issues/155: Compatible TypeLoadException for invalid inputs') + type([TestLibrary]TestLibrary.Utilities) + string[1] ('IsNativeAot') + } + .custom instance void [Microsoft.DotNet.XUnitExtensions]Xunit.ActiveIssueAttribute::.ctor(string, class [mscorlib]System.Type, string[]) = { + string('https://github.com/dotnet/runtime/issues/124260') + type([TestLibrary]TestLibrary.PlatformDetection) + string[1] ('IsWasm') + } .entrypoint // Code size 452 (0x1c4) .maxstack 2 diff --git a/src/tests/Loader/classloader/StaticVirtualMethods/Reabstraction/Reabstraction.il b/src/tests/Loader/classloader/StaticVirtualMethods/Reabstraction/Reabstraction.il index e985fd23ccb020..4f4dc0770ed376 100644 --- a/src/tests/Loader/classloader/StaticVirtualMethods/Reabstraction/Reabstraction.il +++ b/src/tests/Loader/classloader/StaticVirtualMethods/Reabstraction/Reabstraction.il @@ -346,6 +346,11 @@ type([TestLibrary]TestLibrary.Utilities) string[1] ('IsNativeAot') } + .custom instance void [Microsoft.DotNet.XUnitExtensions]Xunit.ActiveIssueAttribute::.ctor(string, class [mscorlib]System.Type, string[]) = { + string('https://github.com/dotnet/runtime/issues/124260') + type([TestLibrary]TestLibrary.PlatformDetection) + string[1] ('IsWasm') + } .entrypoint // Code size 452 (0x1c4) .maxstack 2 From 399258906feff1c7ff37a545d69b5d037cc6a2b6 Mon Sep 17 00:00:00 2001 From: Radek Doulik Date: Wed, 11 Feb 2026 14:14:49 +0100 Subject: [PATCH 062/123] Update src/tests/Common/CLRTest.Execute.Bash.targets Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- src/tests/Common/CLRTest.Execute.Bash.targets | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/tests/Common/CLRTest.Execute.Bash.targets b/src/tests/Common/CLRTest.Execute.Bash.targets index 3c7129c52fe2a2..2aa09fa3c15b2a 100644 --- a/src/tests/Common/CLRTest.Execute.Bash.targets +++ b/src/tests/Common/CLRTest.Execute.Bash.targets @@ -376,9 +376,9 @@ else # Disable minidump generation for browser tests # active issue https://github.com/dotnet/runtime/issues/124088 export DOTNET_DbgEnableMiniDump=0 - cmd="node ${CORE_ROOT}/corerun.js -c ${CORE_ROOT} ${PWD}/${ExePath} ${CLRTestExecutionArguments[@]}" - echo Running: $cmd - run_with_timeout 300 $cmd + cmd=( node "${CORE_ROOT}/corerun.js" -c "${CORE_ROOT}" "${PWD}/${ExePath}" "${CLRTestExecutionArguments[@]}" ) + echo Running: "${cmd[@]}" + run_with_timeout 300 "${cmd[@]}" fi CLRTestExitCode=$? ]]> From 6098ce3e81e6330fd6f60b62ad907fce286a8a20 Mon Sep 17 00:00:00 2001 From: Radek Doulik Date: Wed, 11 Feb 2026 14:12:23 +0100 Subject: [PATCH 063/123] Put the condition back --- src/tests/Directory.Build.targets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tests/Directory.Build.targets b/src/tests/Directory.Build.targets index 7b2b21be3eac0b..4908a1c2198e87 100644 --- a/src/tests/Directory.Build.targets +++ b/src/tests/Directory.Build.targets @@ -74,7 +74,7 @@ - + - + sos https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/flat2/dotnet-sos/$(DotnetSosVersion)/dotnet-sos.$(DotnetSosVersion).nupkg From e93d08979341f4d81f8da78e4fadd3fb55fba7a5 Mon Sep 17 00:00:00 2001 From: Radek Doulik Date: Wed, 11 Feb 2026 17:17:57 +0100 Subject: [PATCH 068/123] Restore the matrix --- eng/pipelines/common/platform-matrix.yml | 899 ++++++++++++++++++++++- 1 file changed, 891 insertions(+), 8 deletions(-) diff --git a/eng/pipelines/common/platform-matrix.yml b/eng/pipelines/common/platform-matrix.yml index 122039cbd08dc2..36440a2d74f489 100644 --- a/eng/pipelines/common/platform-matrix.yml +++ b/eng/pipelines/common/platform-matrix.yml @@ -24,6 +24,190 @@ parameters: jobs: +# Linux arm + +- ${{ if or(containsValue(parameters.platforms, 'linux_arm'), in(parameters.platformGroup, 'all', 'gcstress')) }}: + - template: xplat-setup.yml + parameters: + jobTemplate: ${{ parameters.jobTemplate }} + helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }} + variables: ${{ parameters.variables }} + osGroup: linux + archType: arm + targetRid: linux-arm + platform: linux_arm + shouldContinueOnError: ${{ parameters.shouldContinueOnError }} + container: linux_arm + jobParameters: + runtimeFlavor: ${{ parameters.runtimeFlavor }} + buildConfig: ${{ parameters.buildConfig }} + helixQueueGroup: ${{ parameters.helixQueueGroup }} + crossBuild: true + ${{ insert }}: ${{ parameters.jobParameters }} + +# Linux arm64 + +- ${{ if or(containsValue(parameters.platforms, 'linux_arm64'), in(parameters.platformGroup, 'all', 'gcstress')) }}: + - template: xplat-setup.yml + parameters: + jobTemplate: ${{ parameters.jobTemplate }} + helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }} + variables: ${{ parameters.variables }} + osGroup: linux + archType: arm64 + targetRid: linux-arm64 + platform: linux_arm64 + shouldContinueOnError: ${{ parameters.shouldContinueOnError }} + ${{ if eq(parameters.container, '') }}: + container: linux_arm64 + ${{ if ne(parameters.container, '') }}: + container: + image: ${{ parameters.container }} + registry: mcr + jobParameters: + runtimeFlavor: ${{ parameters.runtimeFlavor }} + buildConfig: ${{ parameters.buildConfig }} + helixQueueGroup: ${{ parameters.helixQueueGroup }} + crossBuild: true + ${{ insert }}: ${{ parameters.jobParameters }} + +# Linux musl x64 + +- ${{ if or(containsValue(parameters.platforms, 'linux_musl_x64'), eq(parameters.platformGroup, 'all')) }}: + - template: xplat-setup.yml + parameters: + jobTemplate: ${{ parameters.jobTemplate }} + helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }} + variables: ${{ parameters.variables }} + osGroup: linux + osSubgroup: _musl + archType: x64 + targetRid: linux-musl-x64 + platform: linux_musl_x64 + shouldContinueOnError: ${{ parameters.shouldContinueOnError }} + container: linux_musl_x64 + jobParameters: + runtimeFlavor: ${{ parameters.runtimeFlavor }} + buildConfig: ${{ parameters.buildConfig }} + helixQueueGroup: ${{ parameters.helixQueueGroup }} + crossBuild: true + ${{ insert }}: ${{ parameters.jobParameters }} + +# Linux musl arm + +- ${{ if or(containsValue(parameters.platforms, 'linux_musl_arm'), eq(parameters.platformGroup, 'all')) }}: + - template: xplat-setup.yml + parameters: + jobTemplate: ${{ parameters.jobTemplate }} + helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }} + variables: ${{ parameters.variables }} + osGroup: linux + osSubgroup: _musl + archType: arm + targetRid: linux-musl-arm + platform: linux_musl_arm + shouldContinueOnError: ${{ parameters.shouldContinueOnError }} + container: linux_musl_arm + jobParameters: + runtimeFlavor: ${{ parameters.runtimeFlavor }} + buildConfig: ${{ parameters.buildConfig }} + helixQueueGroup: ${{ parameters.helixQueueGroup }} + crossBuild: true + ${{ insert }}: ${{ parameters.jobParameters }} + +# Linux musl arm64 + +- ${{ if or(containsValue(parameters.platforms, 'linux_musl_arm64'), eq(parameters.platformGroup, 'all')) }}: + - template: xplat-setup.yml + parameters: + jobTemplate: ${{ parameters.jobTemplate }} + helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }} + variables: ${{ parameters.variables }} + osGroup: linux + osSubgroup: _musl + archType: arm64 + targetRid: linux-musl-arm64 + platform: linux_musl_arm64 + shouldContinueOnError: ${{ parameters.shouldContinueOnError }} + container: linux_musl_arm64 + jobParameters: + runtimeFlavor: ${{ parameters.runtimeFlavor }} + buildConfig: ${{ parameters.buildConfig }} + helixQueueGroup: ${{ parameters.helixQueueGroup }} + crossBuild: true + ${{ insert }}: ${{ parameters.jobParameters }} + +# Linux Bionic arm + +- ${{ if containsValue(parameters.platforms, 'linux_bionic_arm') }}: + - template: xplat-setup.yml + parameters: + jobTemplate: ${{ parameters.jobTemplate }} + helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }} + variables: ${{ parameters.variables }} + osGroup: linux + osSubgroup: _bionic + archType: arm + targetRid: linux-bionic-arm + platform: linux_bionic_arm + shouldContinueOnError: ${{ parameters.shouldContinueOnError }} + container: linux_bionic + jobParameters: + runtimeFlavor: mono + # We build on Linux, but the test queue runs Windows, so + # we need to override the test script generation + runScriptWindowsCmd: true + buildConfig: ${{ parameters.buildConfig }} + helixQueueGroup: ${{ parameters.helixQueueGroup }} + ${{ insert }}: ${{ parameters.jobParameters }} + +# Linux Bionic arm64 + +- ${{ if containsValue(parameters.platforms, 'linux_bionic_arm64') }}: + - template: xplat-setup.yml + parameters: + jobTemplate: ${{ parameters.jobTemplate }} + helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }} + variables: ${{ parameters.variables }} + osGroup: linux + osSubgroup: _bionic + archType: arm64 + targetRid: linux-bionic-arm64 + platform: linux_bionic_arm64 + shouldContinueOnError: ${{ parameters.shouldContinueOnError }} + container: linux_bionic + jobParameters: + runtimeFlavor: mono + # We build on Linux, but the test queue runs Windows, so + # we need to override the test script generation + runScriptWindowsCmd: true + buildConfig: ${{ parameters.buildConfig }} + helixQueueGroup: ${{ parameters.helixQueueGroup }} + ${{ insert }}: ${{ parameters.jobParameters }} + +# Linux Bionic x64 + +- ${{ if containsValue(parameters.platforms, 'linux_bionic_x64') }}: + - template: xplat-setup.yml + parameters: + jobTemplate: ${{ parameters.jobTemplate }} + helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }} + variables: ${{ parameters.variables }} + osGroup: linux + osSubgroup: _bionic + archType: x64 + targetRid: linux-bionic-x64 + platform: linux_bionic_x64 + shouldContinueOnError: ${{ parameters.shouldContinueOnError }} + container: linux_bionic + jobParameters: + runtimeFlavor: mono + buildConfig: ${{ parameters.buildConfig }} + helixQueueGroup: ${{ parameters.helixQueueGroup }} + ${{ insert }}: ${{ parameters.jobParameters }} + +# Linux x64 + - ${{ if or(containsValue(parameters.platforms, 'linux_x64'), containsValue(parameters.platforms, 'CoreClrTestBuildHost'), in(parameters.platformGroup, 'all', 'gcstress')) }}: - template: xplat-setup.yml parameters: @@ -48,22 +232,721 @@ jobs: crossBuild: true ${{ insert }}: ${{ parameters.jobParameters }} -# Browser WebAssembly +- ${{ if containsValue(parameters.platforms, 'linux_x64_sanitizer') }}: + - template: xplat-setup.yml + parameters: + jobTemplate: ${{ parameters.jobTemplate }} + helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }} + variables: ${{ parameters.variables }} + osGroup: linux + archType: x64 + targetRid: linux-x64 + platform: linux_x64 + shouldContinueOnError: ${{ parameters.shouldContinueOnError }} + container: linux_x64_sanitizer + jobParameters: + runtimeFlavor: ${{ parameters.runtimeFlavor }} + buildConfig: ${{ parameters.buildConfig }} + helixQueueGroup: ${{ parameters.helixQueueGroup }} + crossBuild: true + cxxStandardLibrary: libc++ + cxxStandardLibraryStatic: true + cxxAbiLibrary: libstdc++ + ${{ insert }}: ${{ parameters.jobParameters }} -- ${{ if containsValue(parameters.platforms, 'browser_wasm') }}: +# Linux x86 + +- ${{ if containsValue(parameters.platforms, 'linux_x86') }}: - template: xplat-setup.yml parameters: jobTemplate: ${{ parameters.jobTemplate }} helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }} variables: ${{ parameters.variables }} - osGroup: browser - archType: wasm - targetRid: browser-wasm - platform: browser_wasm + osGroup: linux + archType: x86 + targetRid: linux-x86 + platform: linux_x86 shouldContinueOnError: ${{ parameters.shouldContinueOnError }} - container: browser_wasm + container: linux_x86 + jobParameters: + runtimeFlavor: ${{ parameters.runtimeFlavor }} + buildConfig: ${{ parameters.buildConfig }} + helixQueueGroup: ${{ parameters.helixQueueGroup }} + crossBuild: true + ${{ insert }}: ${{ parameters.jobParameters }} + +# Runtime-dev-innerloop build + +- ${{ if containsValue(parameters.platforms, 'linux_x64_dev_innerloop') }}: + - template: xplat-setup.yml + parameters: + jobTemplate: ${{ parameters.jobTemplate }} + helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }} + variables: ${{ parameters.variables }} + osGroup: linux + archType: x64 + targetRid: linux-x64 + platform: linux_x64 + shouldContinueOnError: ${{ parameters.shouldContinueOnError }} + container: linux_x64_dev_innerloop + jobParameters: + runtimeFlavor: ${{ parameters.runtimeFlavor }} + buildConfig: ${{ parameters.buildConfig }} + helixQueueGroup: ${{ parameters.helixQueueGroup }} + ${{ insert }}: ${{ parameters.jobParameters }} + +- ${{ if containsValue(parameters.platforms, 'linux_musl_x64_dev_innerloop') }}: + - template: xplat-setup.yml + parameters: + jobTemplate: ${{ parameters.jobTemplate }} + helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }} + variables: ${{ parameters.variables }} + osGroup: linux + osSubgroup: _musl + archType: x64 + targetRid: linux-musl-x64 + platform: linux_musl_x64 + shouldContinueOnError: ${{ parameters.shouldContinueOnError }} + container: linux_musl_x64_dev_innerloop + jobParameters: + runtimeFlavor: ${{ parameters.runtimeFlavor }} + buildConfig: ${{ parameters.buildConfig }} + helixQueueGroup: ${{ parameters.helixQueueGroup }} + ${{ insert }}: ${{ parameters.jobParameters }} + +# GCC Linux x64 Build + +- ${{ if containsValue(parameters.platforms, 'gcc_linux_x64') }}: + - template: xplat-setup.yml + parameters: + jobTemplate: ${{ parameters.jobTemplate }} + helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }} + variables: ${{ parameters.variables }} + osGroup: linux + archType: x64 + targetRid: linux-x64 + platform: linux_x64 + shouldContinueOnError: ${{ parameters.shouldContinueOnError }} + container: debian-13-gcc15-amd64 + jobParameters: + runtimeFlavor: ${{ parameters.runtimeFlavor }} + buildConfig: ${{ parameters.buildConfig }} + helixQueueGroup: ${{ parameters.helixQueueGroup }} + ${{ insert }}: ${{ parameters.jobParameters }} + +# Mono LLVMAot test build + +- ${{ if containsValue(parameters.platforms, 'linux_x64_llvmaot') }}: + - template: xplat-setup.yml + parameters: + jobTemplate: ${{ parameters.jobTemplate }} + helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }} + variables: ${{ parameters.variables }} + osGroup: linux + archType: x64 + targetRid: linux-x64 + platform: linux_x64 + shouldContinueOnError: ${{ parameters.shouldContinueOnError }} + container: linux_x64_llvmaot + jobParameters: + runtimeFlavor: ${{ parameters.runtimeFlavor }} + buildConfig: ${{ parameters.buildConfig }} + helixQueueGroup: ${{ parameters.helixQueueGroup }} + ${{ insert }}: ${{ parameters.jobParameters }} + +# Linux s390x + +- ${{ if containsValue(parameters.platforms, 'linux_s390x') }}: + - template: xplat-setup.yml + parameters: + jobTemplate: ${{ parameters.jobTemplate }} + helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }} + variables: ${{ parameters.variables }} + osGroup: linux + archType: s390x + targetRid: linux-s390x + platform: linux_s390x + shouldContinueOnError: ${{ parameters.shouldContinueOnError }} + container: linux_s390x + jobParameters: + runtimeFlavor: ${{ parameters.runtimeFlavor }} + buildConfig: ${{ parameters.buildConfig }} + helixQueueGroup: ${{ parameters.helixQueueGroup }} + crossBuild: true + ${{ insert }}: ${{ parameters.jobParameters }} + +# Linux PPC64le + +- ${{ if containsValue(parameters.platforms, 'linux_ppc64le') }}: + - template: xplat-setup.yml + parameters: + jobTemplate: ${{ parameters.jobTemplate }} + helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }} + variables: ${{ parameters.variables }} + osGroup: linux + archType: ppc64le + targetRid: linux-ppc64le + platform: linux_ppc64le + shouldContinueOnError: ${{ parameters.shouldContinueOnError }} + container: linux_ppc64le jobParameters: - hostedOs: linux runtimeFlavor: ${{ parameters.runtimeFlavor }} buildConfig: ${{ parameters.buildConfig }} + helixQueueGroup: ${{ parameters.helixQueueGroup }} + crossBuild: true + ${{ insert }}: ${{ parameters.jobParameters }} + +# Linux RISCV64 + +- ${{ if containsValue(parameters.platforms, 'linux_riscv64') }}: + - template: xplat-setup.yml + parameters: + jobTemplate: ${{ parameters.jobTemplate }} + helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }} + variables: ${{ parameters.variables }} + osGroup: linux + archType: riscv64 + targetRid: linux-riscv64 + platform: linux_riscv64 + shouldContinueOnError: ${{ parameters.shouldContinueOnError }} + container: linux_riscv64 + jobParameters: + runtimeFlavor: ${{ parameters.runtimeFlavor }} + buildConfig: ${{ parameters.buildConfig }} + helixQueueGroup: ${{ parameters.helixQueueGroup }} + crossBuild: true + ${{ insert }}: ${{ parameters.jobParameters }} + +# Linux LoongArch64 + +- ${{ if containsValue(parameters.platforms, 'linux_loongarch64') }}: + - template: xplat-setup.yml + parameters: + jobTemplate: ${{ parameters.jobTemplate }} + helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }} + variables: ${{ parameters.variables }} + osGroup: linux + archType: loongarch64 + targetRid: linux-loongarch64 + platform: linux_loongarch64 + shouldContinueOnError: ${{ parameters.shouldContinueOnError }} + container: linux_loongarch64 + jobParameters: + runtimeFlavor: ${{ parameters.runtimeFlavor }} + buildConfig: ${{ parameters.buildConfig }} + helixQueueGroup: ${{ parameters.helixQueueGroup }} + crossBuild: true + ${{ insert }}: ${{ parameters.jobParameters }} + +# WASI WebAssembly + +- ${{ if containsValue(parameters.platforms, 'wasi_wasm') }}: + - template: xplat-setup.yml + parameters: + jobTemplate: ${{ parameters.jobTemplate }} + helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }} + variables: ${{ parameters.variables }} + osGroup: wasi + archType: wasm + targetRid: wasi-wasm + platform: wasi_wasm + shouldContinueOnError: ${{ parameters.shouldContinueOnError }} + container: wasi_wasm + jobParameters: + hostedOs: linux + runtimeFlavor: ${{ parameters.runtimeFlavor }} + stagedBuild: ${{ parameters.stagedBuild }} + buildConfig: ${{ parameters.buildConfig }} + ${{ insert }}: ${{ parameters.jobParameters }} + +# WASI WebAssembly windows + +- ${{ if containsValue(parameters.platforms, 'wasi_wasm_win') }}: + - template: xplat-setup.yml + parameters: + jobTemplate: ${{ parameters.jobTemplate }} + helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }} + variables: ${{ parameters.variables }} + osGroup: wasi + archType: wasm + targetRid: wasi-wasm + platform: wasi_wasm_win + shouldContinueOnError: ${{ parameters.shouldContinueOnError }} + jobParameters: + hostedOs: windows + runtimeFlavor: ${{ parameters.runtimeFlavor }} + stagedBuild: ${{ parameters.stagedBuild }} + buildConfig: ${{ parameters.buildConfig }} + ${{ insert }}: ${{ parameters.jobParameters }} + +# Browser WebAssembly + +- ${{ if containsValue(parameters.platforms, 'browser_wasm') }}: + - template: xplat-setup.yml + parameters: + jobTemplate: ${{ parameters.jobTemplate }} + helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }} + variables: ${{ parameters.variables }} + osGroup: browser + archType: wasm + targetRid: browser-wasm + platform: browser_wasm + shouldContinueOnError: ${{ parameters.shouldContinueOnError }} + container: browser_wasm + jobParameters: + hostedOs: linux + runtimeFlavor: ${{ parameters.runtimeFlavor }} + buildConfig: ${{ parameters.buildConfig }} + ${{ insert }}: ${{ parameters.jobParameters }} + +# Browser WebAssembly Linux Firefox + +- ${{ if containsValue(parameters.platforms, 'browser_wasm_firefox') }}: + - template: xplat-setup.yml + parameters: + jobTemplate: ${{ parameters.jobTemplate }} + helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }} + variables: ${{ parameters.variables }} + osGroup: browser + archType: wasm + targetRid: browser-wasm + platform: browser_wasm_firefox + shouldContinueOnError: ${{ parameters.shouldContinueOnError }} + container: browser_wasm + jobParameters: + hostedOs: linux + runtimeFlavor: ${{ parameters.runtimeFlavor }} + buildConfig: ${{ parameters.buildConfig }} + ${{ insert }}: ${{ parameters.jobParameters }} + +# Browser WebAssembly on Windows + +- ${{ if containsValue(parameters.platforms, 'browser_wasm_win') }}: + - template: xplat-setup.yml + parameters: + jobTemplate: ${{ parameters.jobTemplate }} + helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }} + variables: ${{ parameters.variables }} + osGroup: browser + archType: wasm + targetRid: browser-wasm + platform: browser_wasm_win + shouldContinueOnError: ${{ parameters.shouldContinueOnError }} + jobParameters: + hostedOs: windows + runtimeFlavor: ${{ parameters.runtimeFlavor }} + buildConfig: ${{ parameters.buildConfig }} + ${{ insert }}: ${{ parameters.jobParameters }} + +# FreeBSD +- ${{ if containsValue(parameters.platforms, 'freebsd_x64') }}: + - template: xplat-setup.yml + parameters: + jobTemplate: ${{ parameters.jobTemplate }} + helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }} + variables: ${{ parameters.variables }} + osGroup: freebsd + archType: x64 + targetRid: freebsd-x64 + platform: freebsd_x64 + shouldContinueOnError: ${{ parameters.shouldContinueOnError }} + container: freebsd_x64 + jobParameters: + runtimeFlavor: ${{ parameters.runtimeFlavor }} + buildConfig: ${{ parameters.buildConfig }} + helixQueueGroup: ${{ parameters.helixQueueGroup }} + crossBuild: true + ${{ insert }}: ${{ parameters.jobParameters }} + +# Android x64 + +- ${{ if containsValue(parameters.platforms, 'android_x64') }}: + - template: xplat-setup.yml + parameters: + jobTemplate: ${{ parameters.jobTemplate }} + helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }} + variables: ${{ parameters.variables }} + osGroup: android + archType: x64 + targetRid: android-x64 + platform: android_x64 + shouldContinueOnError: ${{ parameters.shouldContinueOnError }} + container: android + jobParameters: + runtimeFlavor: ${{ parameters.runtimeFlavor }} + buildConfig: ${{ parameters.buildConfig }} + helixQueueGroup: ${{ parameters.helixQueueGroup }} + ${{ insert }}: ${{ parameters.jobParameters }} + +# Android x64 with Docker-in-Docker + +- ${{ if containsValue(parameters.platforms, 'android_x64_docker') }}: + - template: xplat-setup.yml + parameters: + jobTemplate: ${{ parameters.jobTemplate }} + helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }} + variables: ${{ parameters.variables }} + osGroup: android + archType: x64 + targetRid: android-x64 + platform: android_x64 + shouldContinueOnError: ${{ parameters.shouldContinueOnError }} + container: android_docker + jobParameters: + runtimeFlavor: ${{ parameters.runtimeFlavor }} + buildConfig: ${{ parameters.buildConfig }} + helixQueueGroup: ${{ parameters.helixQueueGroup }} + ${{ insert }}: ${{ parameters.jobParameters }} + +# Android x86 + +- ${{ if containsValue(parameters.platforms, 'android_x86') }}: + - template: xplat-setup.yml + parameters: + jobTemplate: ${{ parameters.jobTemplate }} + helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }} + variables: ${{ parameters.variables }} + osGroup: android + archType: x86 + targetRid: android-x86 + platform: android_x86 + shouldContinueOnError: ${{ parameters.shouldContinueOnError }} + container: android + jobParameters: + runtimeFlavor: ${{ parameters.runtimeFlavor }} + buildConfig: ${{ parameters.buildConfig }} + helixQueueGroup: ${{ parameters.helixQueueGroup }} + ${{ insert }}: ${{ parameters.jobParameters }} + +# Android arm + +- ${{ if containsValue(parameters.platforms, 'android_arm') }}: + - template: xplat-setup.yml + parameters: + jobTemplate: ${{ parameters.jobTemplate }} + helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }} + variables: ${{ parameters.variables }} + osGroup: android + archType: arm + targetRid: android-arm + platform: android_arm + shouldContinueOnError: ${{ parameters.shouldContinueOnError }} + container: android + jobParameters: + runtimeFlavor: ${{ parameters.runtimeFlavor }} + buildConfig: ${{ parameters.buildConfig }} + helixQueueGroup: ${{ parameters.helixQueueGroup }} + ${{ insert }}: ${{ parameters.jobParameters }} + +# Android arm64 + +- ${{ if containsValue(parameters.platforms, 'android_arm64') }}: + - template: xplat-setup.yml + parameters: + jobTemplate: ${{ parameters.jobTemplate }} + helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }} + variables: ${{ parameters.variables }} + osGroup: android + archType: arm64 + targetRid: android-arm64 + platform: android_arm64 + shouldContinueOnError: ${{ parameters.shouldContinueOnError }} + container: android + jobParameters: + runtimeFlavor: ${{ parameters.runtimeFlavor }} + buildConfig: ${{ parameters.buildConfig }} + helixQueueGroup: ${{ parameters.helixQueueGroup }} + ${{ insert }}: ${{ parameters.jobParameters }} + +# Mac Catalyst x64 + +- ${{ if containsValue(parameters.platforms, 'maccatalyst_x64') }}: + - template: xplat-setup.yml + parameters: + jobTemplate: ${{ parameters.jobTemplate }} + helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }} + variables: ${{ parameters.variables }} + osGroup: maccatalyst + archType: x64 + targetRid: maccatalyst-x64 + platform: maccatalyst_x64 + shouldContinueOnError: ${{ parameters.shouldContinueOnError }} + jobParameters: + ${{ if eq(parameters.runtimeFlavor, '') }}: + runtimeFlavor: mono + ${{ else }}: + runtimeFlavor: ${{ parameters.runtimeFlavor }} + buildConfig: ${{ parameters.buildConfig }} + helixQueueGroup: ${{ parameters.helixQueueGroup }} + ${{ insert }}: ${{ parameters.jobParameters }} + +# Mac Catalyst arm64 + +- ${{ if containsValue(parameters.platforms, 'maccatalyst_arm64') }}: + - template: xplat-setup.yml + parameters: + jobTemplate: ${{ parameters.jobTemplate }} + helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }} + variables: ${{ parameters.variables }} + osGroup: maccatalyst + archType: arm64 + targetRid: maccatalyst-arm64 + platform: maccatalyst_arm64 + shouldContinueOnError: ${{ parameters.shouldContinueOnError }} + jobParameters: + ${{ if eq(parameters.runtimeFlavor, '') }}: + runtimeFlavor: mono + ${{ else }}: + runtimeFlavor: ${{ parameters.runtimeFlavor }} + buildConfig: ${{ parameters.buildConfig }} + helixQueueGroup: ${{ parameters.helixQueueGroup }} + ${{ insert }}: ${{ parameters.jobParameters }} + +# tvOS arm64 + +- ${{ if containsValue(parameters.platforms, 'tvos_arm64') }}: + - template: xplat-setup.yml + parameters: + jobTemplate: ${{ parameters.jobTemplate }} + helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }} + variables: ${{ parameters.variables }} + osGroup: tvos + archType: arm64 + targetRid: tvos-arm64 + platform: tvos_arm64 + shouldContinueOnError: ${{ parameters.shouldContinueOnError }} + jobParameters: + ${{ if eq(parameters.runtimeFlavor, '') }}: + runtimeFlavor: mono + ${{ else }}: + runtimeFlavor: ${{ parameters.runtimeFlavor }} + buildConfig: ${{ parameters.buildConfig }} + helixQueueGroup: ${{ parameters.helixQueueGroup }} + ${{ insert }}: ${{ parameters.jobParameters }} + +# tvOS Simulator x64 + +- ${{ if containsValue(parameters.platforms, 'tvossimulator_x64') }}: + - template: xplat-setup.yml + parameters: + jobTemplate: ${{ parameters.jobTemplate }} + helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }} + variables: ${{ parameters.variables }} + osGroup: tvossimulator + archType: x64 + targetRid: tvossimulator-x64 + platform: tvossimulator_x64 + shouldContinueOnError: ${{ parameters.shouldContinueOnError }} + jobParameters: + ${{ if eq(parameters.runtimeFlavor, '') }}: + runtimeFlavor: mono + ${{ else }}: + runtimeFlavor: ${{ parameters.runtimeFlavor }} + buildConfig: ${{ parameters.buildConfig }} + helixQueueGroup: ${{ parameters.helixQueueGroup }} + ${{ insert }}: ${{ parameters.jobParameters }} + +# tvOS Simulator arm64 + +- ${{ if containsValue(parameters.platforms, 'tvossimulator_arm64') }}: + - template: xplat-setup.yml + parameters: + jobTemplate: ${{ parameters.jobTemplate }} + helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }} + variables: ${{ parameters.variables }} + osGroup: tvossimulator + archType: arm64 + targetRid: tvossimulator-arm64 + platform: tvossimulator_arm64 + shouldContinueOnError: ${{ parameters.shouldContinueOnError }} + jobParameters: + ${{ if eq(parameters.runtimeFlavor, '') }}: + runtimeFlavor: mono + ${{ else }}: + runtimeFlavor: ${{ parameters.runtimeFlavor }} + buildConfig: ${{ parameters.buildConfig }} + helixQueueGroup: ${{ parameters.helixQueueGroup }} + ${{ insert }}: ${{ parameters.jobParameters }} + +# iOS arm64 + +- ${{ if containsValue(parameters.platforms, 'ios_arm64') }}: + - template: xplat-setup.yml + parameters: + jobTemplate: ${{ parameters.jobTemplate }} + helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }} + variables: ${{ parameters.variables }} + osGroup: ios + archType: arm64 + targetRid: ios-arm64 + platform: ios_arm64 + shouldContinueOnError: ${{ parameters.shouldContinueOnError }} + jobParameters: + ${{ if eq(parameters.runtimeFlavor, '') }}: + runtimeFlavor: mono + ${{ else }}: + runtimeFlavor: ${{ parameters.runtimeFlavor }} + buildConfig: ${{ parameters.buildConfig }} + helixQueueGroup: ${{ parameters.helixQueueGroup }} + ${{ insert }}: ${{ parameters.jobParameters }} + +# iOS Simulator x64 + +- ${{ if containsValue(parameters.platforms, 'iossimulator_x64') }}: + - template: xplat-setup.yml + parameters: + jobTemplate: ${{ parameters.jobTemplate }} + helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }} + variables: ${{ parameters.variables }} + osGroup: iossimulator + archType: x64 + targetRid: iossimulator-x64 + platform: iossimulator_x64 + shouldContinueOnError: ${{ parameters.shouldContinueOnError }} + jobParameters: + ${{ if eq(parameters.runtimeFlavor, '') }}: + runtimeFlavor: mono + ${{ else }}: + runtimeFlavor: ${{ parameters.runtimeFlavor }} + buildConfig: ${{ parameters.buildConfig }} + helixQueueGroup: ${{ parameters.helixQueueGroup }} + ${{ insert }}: ${{ parameters.jobParameters }} + +# iOS Simulator arm64 + +- ${{ if containsValue(parameters.platforms, 'iossimulator_arm64') }}: + - template: xplat-setup.yml + parameters: + jobTemplate: ${{ parameters.jobTemplate }} + helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }} + variables: ${{ parameters.variables }} + osGroup: iossimulator + archType: arm64 + targetRid: iossimulator-arm64 + platform: iossimulator_arm64 + shouldContinueOnError: ${{ parameters.shouldContinueOnError }} + jobParameters: + ${{ if eq(parameters.runtimeFlavor, '') }}: + runtimeFlavor: mono + ${{ else }}: + runtimeFlavor: ${{ parameters.runtimeFlavor }} + buildConfig: ${{ parameters.buildConfig }} + helixQueueGroup: ${{ parameters.helixQueueGroup }} + ${{ insert }}: ${{ parameters.jobParameters }} + +# macOS arm64 + +- ${{ if containsValue(parameters.platforms, 'osx_arm64') }}: + - template: xplat-setup.yml + parameters: + jobTemplate: ${{ parameters.jobTemplate }} + helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }} + variables: ${{ parameters.variables }} + osGroup: osx + archType: arm64 + targetRid: osx-arm64 + platform: osx_arm64 + shouldContinueOnError: ${{ parameters.shouldContinueOnError }} + jobParameters: + runtimeFlavor: ${{ parameters.runtimeFlavor }} + buildConfig: ${{ parameters.buildConfig }} + helixQueueGroup: ${{ parameters.helixQueueGroup }} + crossBuild: true + ${{ insert }}: ${{ parameters.jobParameters }} + +# macOS x64 + +- ${{ if or(containsValue(parameters.platforms, 'osx_x64'), eq(parameters.platformGroup, 'all')) }}: + - template: xplat-setup.yml + parameters: + jobTemplate: ${{ parameters.jobTemplate }} + helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }} + variables: ${{ parameters.variables }} + osGroup: osx + archType: x64 + targetRid: osx-x64 + platform: osx_x64 + shouldContinueOnError: ${{ parameters.shouldContinueOnError }} + jobParameters: + runtimeFlavor: ${{ parameters.runtimeFlavor }} + buildConfig: ${{ parameters.buildConfig }} + helixQueueGroup: ${{ parameters.helixQueueGroup }} + ${{ insert }}: ${{ parameters.jobParameters }} + +# Tizen armel + +- ${{ if containsValue(parameters.platforms, 'tizen_armel') }}: + - template: xplat-setup.yml + parameters: + jobTemplate: ${{ parameters.jobTemplate }} + helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }} + variables: ${{ parameters.variables }} + osGroup: linux # Our build scripts don't support Tizen and have always used Linux as the OS parameter. + archType: armel + targetRid: tizen-armel + platform: tizen_armel + shouldContinueOnError: ${{ parameters.shouldContinueOnError }} + container: tizen_armel + jobParameters: + runtimeFlavor: ${{ parameters.runtimeFlavor }} + buildConfig: ${{ parameters.buildConfig }} + helixQueueGroup: ${{ parameters.helixQueueGroup }} + crossBuild: true + ${{ insert }}: ${{ parameters.jobParameters }} + +# Windows x64 + +- ${{ if or(containsValue(parameters.platforms, 'windows_x64'), in(parameters.platformGroup, 'all', 'gcstress')) }}: + - template: xplat-setup.yml + parameters: + jobTemplate: ${{ parameters.jobTemplate }} + helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }} + variables: ${{ parameters.variables }} + osGroup: windows + archType: x64 + targetRid: win-x64 + platform: windows_x64 + shouldContinueOnError: ${{ parameters.shouldContinueOnError }} + jobParameters: + runtimeFlavor: ${{ parameters.runtimeFlavor }} + buildConfig: ${{ parameters.buildConfig }} + helixQueueGroup: ${{ parameters.helixQueueGroup }} + ${{ insert }}: ${{ parameters.jobParameters }} + +# Windows x86 + +- ${{ if or(containsValue(parameters.platforms, 'windows_x86'), in(parameters.platformGroup, 'all', 'gcstress')) }}: + - template: xplat-setup.yml + parameters: + jobTemplate: ${{ parameters.jobTemplate }} + helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }} + variables: ${{ parameters.variables }} + osGroup: windows + archType: x86 + targetRid: win-x86 + platform: windows_x86 + shouldContinueOnError: ${{ parameters.shouldContinueOnError }} + jobParameters: + runtimeFlavor: ${{ parameters.runtimeFlavor }} + buildConfig: ${{ parameters.buildConfig }} + helixQueueGroup: ${{ parameters.helixQueueGroup }} + ${{ insert }}: ${{ parameters.jobParameters }} + +# Windows arm64 + +- ${{ if or(containsValue(parameters.platforms, 'windows_arm64'), in(parameters.platformGroup, 'all', 'gcstress')) }}: + - template: xplat-setup.yml + parameters: + jobTemplate: ${{ parameters.jobTemplate }} + helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }} + variables: ${{ parameters.variables }} + osGroup: windows + archType: arm64 + targetRid: win-arm64 + platform: windows_arm64 + shouldContinueOnError: ${{ parameters.shouldContinueOnError }} + jobParameters: + runtimeFlavor: ${{ parameters.runtimeFlavor }} + buildConfig: ${{ parameters.buildConfig }} + helixQueueGroup: ${{ parameters.helixQueueGroup }} ${{ insert }}: ${{ parameters.jobParameters }} From 79dc45781854200e7477dfbd905117eadb7d564c Mon Sep 17 00:00:00 2001 From: Radek Doulik Date: Wed, 11 Feb 2026 17:23:23 +0100 Subject: [PATCH 069/123] Add comment --- .../Common/CoreCLRTestLibrary/CoreClrConfigurationDetection.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/tests/Common/CoreCLRTestLibrary/CoreClrConfigurationDetection.cs b/src/tests/Common/CoreCLRTestLibrary/CoreClrConfigurationDetection.cs index f2fc98b9618db1..e49c9d4dc758ca 100644 --- a/src/tests/Common/CoreCLRTestLibrary/CoreClrConfigurationDetection.cs +++ b/src/tests/Common/CoreCLRTestLibrary/CoreClrConfigurationDetection.cs @@ -27,6 +27,7 @@ public static bool IsCoreClrInterpreter { get { + // WASM-TODO: update when codegen is in place if (PlatformDetection.IsWasm) return true; if (!string.IsNullOrWhiteSpace(GetEnvironmentVariableValue("Interpreter", ""))) From ba01e7a9a823591460502cabb2f4ea1555baafb3 Mon Sep 17 00:00:00 2001 From: Radek Doulik Date: Wed, 11 Feb 2026 17:26:05 +0100 Subject: [PATCH 070/123] Explicit parentheses --- src/tests/Common/XUnitWrapperGenerator/XUnitWrapperGenerator.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tests/Common/XUnitWrapperGenerator/XUnitWrapperGenerator.cs b/src/tests/Common/XUnitWrapperGenerator/XUnitWrapperGenerator.cs index 414dc039c19f31..cb285d86e8433e 100644 --- a/src/tests/Common/XUnitWrapperGenerator/XUnitWrapperGenerator.cs +++ b/src/tests/Common/XUnitWrapperGenerator/XUnitWrapperGenerator.cs @@ -259,7 +259,7 @@ private static void AddRunnerSource(SourceProductionContext context, ImmutableAr if (buildAsMergedRunner) { if ((targetOSLower is "ios" or "iossimulator" or "tvos" or "tvossimulator" or "maccatalyst" or "android") - || targetOSLower is "browser" && configOptions.GlobalOptions.RuntimeFlavor().ToLowerInvariant() == "mono") + || ((targetOSLower is "browser") && configOptions.GlobalOptions.RuntimeFlavor().ToLowerInvariant() == "mono")) { context.AddSource("XHarnessRunner.g.cs", GenerateXHarnessTestRunner(methods, aliasMap, assemblyName, targetOS)); } From 28887a15354fa539d107da21681db7cfe9454c4c Mon Sep 17 00:00:00 2001 From: Radek Doulik Date: Wed, 11 Feb 2026 17:28:41 +0100 Subject: [PATCH 071/123] Feedback --- src/tests/Common/CLRTest.Execute.Bash.targets | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/tests/Common/CLRTest.Execute.Bash.targets b/src/tests/Common/CLRTest.Execute.Bash.targets index 2aa09fa3c15b2a..8fb34a9f8e3dda 100644 --- a/src/tests/Common/CLRTest.Execute.Bash.targets +++ b/src/tests/Common/CLRTest.Execute.Bash.targets @@ -272,7 +272,7 @@ fi Date: Wed, 11 Feb 2026 17:32:33 +0100 Subject: [PATCH 072/123] Copilot's implementation of running with node in CLRTest.Execute.Batch.targets --- .../Common/CLRTest.Execute.Batch.targets | 70 ++++++++++++++++++- 1 file changed, 69 insertions(+), 1 deletion(-) diff --git a/src/tests/Common/CLRTest.Execute.Batch.targets b/src/tests/Common/CLRTest.Execute.Batch.targets index 67a96674afd3e1..7d6db3582d3dce 100644 --- a/src/tests/Common/CLRTest.Execute.Batch.targets +++ b/src/tests/Common/CLRTest.Execute.Batch.targets @@ -191,6 +191,34 @@ Exit /b 2 :ReleaseLock if exist %lockFolder% rd /s /q %lockFolder% Exit /b 0 + +:RunWithTimeout +REM Usage: call :RunWithTimeout +set __Timeout=%1 +shift +set __RunCmd= +:BuildRunCmd +if "%1"=="" goto :RunCmd +set __RunCmd=%__RunCmd% %1 +shift +goto :BuildRunCmd +:RunCmd +start "" /B cmd /c "%__RunCmd% & call echo %%^^ERRORLEVEL%% > __exitcode.tmp" +set /A __elapsed=0 +:WaitLoop +if exist __exitcode.tmp goto :DoneWaiting +timeout /t 1 /nobreak >NUL +set /A __elapsed+=1 +if %__elapsed% GEQ %__Timeout% ( + REM Timeout exceeded, map to exit code 99 + del /q __exitcode.tmp 2>NUL + Exit /b 99 +) +goto :WaitLoop +:DoneWaiting +set /p __ExitCode=<__exitcode.tmp +del /q __exitcode.tmp 2>NUL +Exit /b %__ExitCode% ]]> @@ -253,7 +281,28 @@ REM Local CoreShim requested - see MSBuild property 'CLRTestScriptLocalCoreShim' ECHO Copying '%CORE_ROOT%\CoreShim.dll'... COPY /y %CORE_ROOT%\CoreShim.dll . ]]> - + + + + + + Date: Wed, 11 Feb 2026 18:09:07 +0100 Subject: [PATCH 073/123] Use the timeout value --- src/tests/Common/CLRTest.Execute.Bash.targets | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/tests/Common/CLRTest.Execute.Bash.targets b/src/tests/Common/CLRTest.Execute.Bash.targets index 8fb34a9f8e3dda..e729eb519c8781 100644 --- a/src/tests/Common/CLRTest.Execute.Bash.targets +++ b/src/tests/Common/CLRTest.Execute.Bash.targets @@ -342,7 +342,7 @@ run_with_timeout() { # Start a watchdog that will kill the process if it exceeds timeout ( - sleep "$timeout" + sleep "$%28echo "scale=3; $timeout / 1000" | bc%29" if kill -0 "$pid" 2>/dev/null; then kill -9 "$pid" 2>/dev/null fi @@ -364,21 +364,23 @@ run_with_timeout() { fi } -if [ -z "${RunWithNodeJS:-}" ] ; then +if [ -z ${RunWithNodeJS+x} ] ; then cd WasmApp ./run-v8.sh else + if [ -z ${__TestTimeout+x} ]; then + __TestTimeout=300000 + fi + echo Running with node echo CORE_ROOT: ${CORE_ROOT} echo ExePath: ${PWD}/${ExePath} echo CLRTestExecutionArguments: ${CLRTestExecutionArguments[@]} echo node version: `node -v` - # Disable minidump generation for browser tests - # active issue https://github.com/dotnet/runtime/issues/124088 - export DOTNET_DbgEnableMiniDump=0 + echo Timeout in ms: $__TestTimeout cmd=( node "${CORE_ROOT}/corerun.js" -c "${CORE_ROOT}" "${PWD}/${ExePath}" "${CLRTestExecutionArguments[@]}" ) echo Running: "${cmd[@]}" - run_with_timeout 300 "${cmd[@]}" + run_with_timeout $__TestTimeout $cmd fi CLRTestExitCode=$? ]]> From be1425c949d1b79aec38077950b0c469cc873a61 Mon Sep 17 00:00:00 2001 From: Radek Doulik Date: Wed, 11 Feb 2026 18:15:07 +0100 Subject: [PATCH 074/123] Update win version --- .../Common/CLRTest.Execute.Batch.targets | 54 +++++++------------ 1 file changed, 19 insertions(+), 35 deletions(-) diff --git a/src/tests/Common/CLRTest.Execute.Batch.targets b/src/tests/Common/CLRTest.Execute.Batch.targets index 7d6db3582d3dce..b4bbdbc1ca262d 100644 --- a/src/tests/Common/CLRTest.Execute.Batch.targets +++ b/src/tests/Common/CLRTest.Execute.Batch.targets @@ -193,32 +193,12 @@ if exist %lockFolder% rd /s /q %lockFolder% Exit /b 0 :RunWithTimeout -REM Usage: call :RunWithTimeout -set __Timeout=%1 -shift -set __RunCmd= -:BuildRunCmd -if "%1"=="" goto :RunCmd -set __RunCmd=%__RunCmd% %1 -shift -goto :BuildRunCmd -:RunCmd -start "" /B cmd /c "%__RunCmd% & call echo %%^^ERRORLEVEL%% > __exitcode.tmp" -set /A __elapsed=0 -:WaitLoop -if exist __exitcode.tmp goto :DoneWaiting -timeout /t 1 /nobreak >NUL -set /A __elapsed+=1 -if %__elapsed% GEQ %__Timeout% ( - REM Timeout exceeded, map to exit code 99 - del /q __exitcode.tmp 2>NUL - Exit /b 99 -) -goto :WaitLoop -:DoneWaiting -set /p __ExitCode=<__exitcode.tmp -del /q __exitcode.tmp 2>NUL -Exit /b %__ExitCode% +REM Usage: set "__RunCmd=" then call :RunWithTimeout +REM Runs __RunCmd with a timeout, kills the process on timeout, +REM and returns exit code 99 on timeout. +REM Use PowerShell for reliable process management and timeout +powershell -NoProfile -Command "& { $p = Start-Process -FilePath 'cmd.exe' -ArgumentList '/c !__RunCmd!' -NoNewWindow -PassThru; if (-not $p.WaitForExit(%~1)) { try { $p.Kill() } catch {} ; exit 99 } else { exit $p.ExitCode } }" +Exit /b !ERRORLEVEL! ]]> @@ -302,7 +282,7 @@ IF NOT DEFINED RunWithNodeJS ( ) ]]> - + - + Date: Wed, 11 Feb 2026 18:20:27 +0100 Subject: [PATCH 075/123] Apply suggestion from @Copilot Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- src/tests/run.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tests/run.sh b/src/tests/run.sh index bc73fa689700dc..78f2af6feffab6 100755 --- a/src/tests/run.sh +++ b/src/tests/run.sh @@ -42,7 +42,7 @@ function print_usage { echo ' --tieringtest : Run each test to encourage tier1 rejitting' echo ' --runnativeaottests : Run NativeAOT compiled tests' echo ' --interpreter : Runs the tests with the interpreter enabled' - echo ' --node. : Runs the tests with the NodeJS (wasm only)' + echo ' --node : Runs the tests with the NodeJS (wasm only)' echo ' --limitedDumpGeneration : ' } From 545f09d0d77eb768dcccb27bf9fd6c6900c9a7a9 Mon Sep 17 00:00:00 2001 From: Radek Doulik Date: Wed, 11 Feb 2026 19:21:28 +0100 Subject: [PATCH 076/123] Fix run --- src/tests/Common/CLRTest.Execute.Bash.targets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tests/Common/CLRTest.Execute.Bash.targets b/src/tests/Common/CLRTest.Execute.Bash.targets index e729eb519c8781..ff343fbc3ab214 100644 --- a/src/tests/Common/CLRTest.Execute.Bash.targets +++ b/src/tests/Common/CLRTest.Execute.Bash.targets @@ -380,7 +380,7 @@ else echo Timeout in ms: $__TestTimeout cmd=( node "${CORE_ROOT}/corerun.js" -c "${CORE_ROOT}" "${PWD}/${ExePath}" "${CLRTestExecutionArguments[@]}" ) echo Running: "${cmd[@]}" - run_with_timeout $__TestTimeout $cmd + run_with_timeout $__TestTimeout "${cmd[@]}" fi CLRTestExitCode=$? ]]> From ae6a379d9da1758cbbb05558d9aed6acf692a96f Mon Sep 17 00:00:00 2001 From: Radek Doulik Date: Thu, 12 Feb 2026 09:28:32 +0100 Subject: [PATCH 077/123] Fix artifacts suffix --- .../common/templates/browser-wasm-coreclr-build-tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/eng/pipelines/common/templates/browser-wasm-coreclr-build-tests.yml b/eng/pipelines/common/templates/browser-wasm-coreclr-build-tests.yml index bfddd32296ae8a..28526ca3c4a057 100644 --- a/eng/pipelines/common/templates/browser-wasm-coreclr-build-tests.yml +++ b/eng/pipelines/common/templates/browser-wasm-coreclr-build-tests.yml @@ -55,14 +55,14 @@ jobs: displayName: Download built nugets for singlethreaded runtime inputs: buildType: current - artifactName: 'BuildArtifacts_browser_wasm_$(_hostedOs)_checked_AllSubsets_CoreCLR_ReleaseLibraries' + artifactName: 'BuildArtifacts_browser_wasm_$(_hostedOs)_checked_CoreCLR_ReleaseLibraries' downloadType: single downloadPath: '$(Build.SourcesDirectory)/artifacts' - task: CopyFiles@2 displayName: Copy single threaded assets inputs: - SourceFolder: '$(Build.SourcesDirectory)/artifacts/BuildArtifacts_browser_wasm_$(_hostedOs)_checked_AllSubsets_CoreCLR_ReleaseLibraries' + SourceFolder: '$(Build.SourcesDirectory)/artifacts/BuildArtifacts_browser_wasm_$(_hostedOs)_checked_CoreCLR_ReleaseLibraries' TargetFolder: '$(Build.SourcesDirectory)/artifacts' CleanTargetFolder: false From ef7bfe7f461e65f81b4085bc0e2de3a4de7ea9f1 Mon Sep 17 00:00:00 2001 From: Radek Doulik Date: Thu, 12 Feb 2026 09:34:10 +0100 Subject: [PATCH 078/123] Do not use bc --- src/tests/Common/CLRTest.Execute.Bash.targets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tests/Common/CLRTest.Execute.Bash.targets b/src/tests/Common/CLRTest.Execute.Bash.targets index ff343fbc3ab214..8ef17a10bf36b3 100644 --- a/src/tests/Common/CLRTest.Execute.Bash.targets +++ b/src/tests/Common/CLRTest.Execute.Bash.targets @@ -342,7 +342,7 @@ run_with_timeout() { # Start a watchdog that will kill the process if it exceeds timeout ( - sleep "$%28echo "scale=3; $timeout / 1000" | bc%29" + sleep "$(( timeout / 1000 ))" if kill -0 "$pid" 2>/dev/null; then kill -9 "$pid" 2>/dev/null fi From af6321dafe3d2aa36caaea0325e6a02f1755f99a Mon Sep 17 00:00:00 2001 From: Radek Doulik Date: Thu, 12 Feb 2026 09:45:36 +0100 Subject: [PATCH 079/123] Skip native part of the test build on windows --- src/tests/build.cmd | 1 + 1 file changed, 1 insertion(+) diff --git a/src/tests/build.cmd b/src/tests/build.cmd index 5176b8ab9e3708..28b3a4da506fae 100644 --- a/src/tests/build.cmd +++ b/src/tests/build.cmd @@ -256,6 +256,7 @@ REM ============================================================================ if "%__SkipNative%" == "1" goto skipnative if "%__GenerateLayoutOnly%" == "1" goto skipnative if "%__CopyNativeTestBinaries%" == "1" goto skipnative +if "%__BuildArch%" == "wasm" goto skipnative echo %__MsgPrefix%Commencing build of native test components for %__BuildArch%/%__BuildType% From ebc56f3533d94d6b4c2c35c7e70eb49517527440 Mon Sep 17 00:00:00 2001 From: Radek Doulik Date: Thu, 12 Feb 2026 10:47:08 +0100 Subject: [PATCH 080/123] Revert "Skip native part of the test build on windows" This reverts commit af6321dafe3d2aa36caaea0325e6a02f1755f99a. --- src/tests/build.cmd | 1 - 1 file changed, 1 deletion(-) diff --git a/src/tests/build.cmd b/src/tests/build.cmd index 28b3a4da506fae..5176b8ab9e3708 100644 --- a/src/tests/build.cmd +++ b/src/tests/build.cmd @@ -256,7 +256,6 @@ REM ============================================================================ if "%__SkipNative%" == "1" goto skipnative if "%__GenerateLayoutOnly%" == "1" goto skipnative if "%__CopyNativeTestBinaries%" == "1" goto skipnative -if "%__BuildArch%" == "wasm" goto skipnative echo %__MsgPrefix%Commencing build of native test components for %__BuildArch%/%__BuildType% From 821446d7c143e28b75a8ffd9365ea8bf08219659 Mon Sep 17 00:00:00 2001 From: Radek Doulik Date: Thu, 12 Feb 2026 10:50:17 +0100 Subject: [PATCH 081/123] Do not build native test assets on windows --- eng/pipelines/runtime.yml | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/eng/pipelines/runtime.yml b/eng/pipelines/runtime.yml index 94f849b2b98df3..f9b26c25a7c297 100644 --- a/eng/pipelines/runtime.yml +++ b/eng/pipelines/runtime.yml @@ -115,9 +115,10 @@ extends: buildArgs: -s clr+libs+libs.tests+packs -c Release -rc $(_BuildConfig) /p:TestAssemblies=false /p:TestWasmBuildTests=true /p:ArchiveTests=true /p:InstallWorkloadForTesting=false timeoutInMinutes: 120 postBuildSteps: - - template: /eng/pipelines/coreclr/templates/build-native-test-assets-step.yml - parameters: - extraBuildArgs: -os browser + - ${{ if eq(platform, 'browser_wasm') }}: + - template: /eng/pipelines/coreclr/templates/build-native-test-assets-step.yml + parameters: + extraBuildArgs: -os browser - template: /eng/pipelines/common/upload-artifact-step.yml parameters: rootFolder: $(Build.SourcesDirectory)/artifacts/bin @@ -144,9 +145,10 @@ extends: parameters: testGroup: innerloop liveLibrariesBuildConfig: Release - - template: /eng/pipelines/common/templates/runtimes/native-test-assets-variables.yml - parameters: - testGroup: innerloop + - ${{ if eq(platform, 'browser_wasm') }}: + - template: /eng/pipelines/common/templates/runtimes/native-test-assets-variables.yml + parameters: + testGroup: innerloop condition: >- or( eq(variables['wasmDarcDependenciesChanged'], true), From 612a341194dd1941ad90fca40a76cd0644fccbdf Mon Sep 17 00:00:00 2001 From: Radek Doulik Date: Thu, 12 Feb 2026 10:52:00 +0100 Subject: [PATCH 082/123] Update src/tests/Common/CLRTest.Execute.Batch.targets Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- src/tests/Common/CLRTest.Execute.Batch.targets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tests/Common/CLRTest.Execute.Batch.targets b/src/tests/Common/CLRTest.Execute.Batch.targets index b4bbdbc1ca262d..853d94daee5df7 100644 --- a/src/tests/Common/CLRTest.Execute.Batch.targets +++ b/src/tests/Common/CLRTest.Execute.Batch.targets @@ -197,7 +197,7 @@ REM Usage: set "__RunCmd=" then call :RunWithTimeout REM Runs __RunCmd with a timeout, kills the process on timeout, REM and returns exit code 99 on timeout. REM Use PowerShell for reliable process management and timeout -powershell -NoProfile -Command "& { $p = Start-Process -FilePath 'cmd.exe' -ArgumentList '/c !__RunCmd!' -NoNewWindow -PassThru; if (-not $p.WaitForExit(%~1)) { try { $p.Kill() } catch {} ; exit 99 } else { exit $p.ExitCode } }" +powershell -NoProfile -Command "& { $p = Start-Process -FilePath 'cmd.exe' -ArgumentList '/c !__RunCmd!' -NoNewWindow -PassThru; if (-not $p.WaitForExit(%~1)) { try { $p.Kill() } catch {} ; try { taskkill /T /F /PID $p.Id 2>$null } catch {} ; exit 99 } else { exit $p.ExitCode } }" Exit /b !ERRORLEVEL! ]]> From 2553b9933754b4bb05ed86606332e1daf670469a Mon Sep 17 00:00:00 2001 From: Radek Doulik Date: Thu, 12 Feb 2026 11:02:16 +0100 Subject: [PATCH 083/123] Split browser_wasm and browser_wasm_win to skip native assets build on windows --- eng/pipelines/runtime.yml | 57 +++++++++++++++++++++++++++++++++------ 1 file changed, 49 insertions(+), 8 deletions(-) diff --git a/eng/pipelines/runtime.yml b/eng/pipelines/runtime.yml index f9b26c25a7c297..dde8957316e868 100644 --- a/eng/pipelines/runtime.yml +++ b/eng/pipelines/runtime.yml @@ -109,16 +109,61 @@ extends: buildConfig: checked platforms: - browser_wasm + jobParameters: + nameSuffix: CoreCLR_ReleaseLibraries + buildArgs: -s clr+libs+libs.tests+packs -c Release -rc $(_BuildConfig) /p:TestAssemblies=false /p:TestWasmBuildTests=true /p:ArchiveTests=true /p:InstallWorkloadForTesting=false + timeoutInMinutes: 120 + postBuildSteps: + - template: /eng/pipelines/coreclr/templates/build-native-test-assets-step.yml + parameters: + extraBuildArgs: -os browser + - template: /eng/pipelines/common/upload-artifact-step.yml + parameters: + rootFolder: $(Build.SourcesDirectory)/artifacts/bin + includeRootFolder: false + archiveType: $(archiveType) + archiveExtension: $(archiveExtension) + tarCompression: $(tarCompression) + artifactName: CoreCLR_ReleaseLibraries_BuildArtifacts_$(osGroup)$(osSubgroup)_$(archType)_$(_BuildConfig) + displayName: Build Assets + - template: /eng/pipelines/common/upload-artifact-step.yml + parameters: + rootFolder: $(Build.SourcesDirectory)/artifacts/helix + includeRootFolder: false + archiveType: $(archiveType) + archiveExtension: $(archiveExtension) + tarCompression: $(tarCompression) + artifactName: CoreCLR_ReleaseLibraries_TestArtifacts_$(osGroup)$(osSubgroup)_$(archType)_$(_BuildConfig) + - template: /eng/pipelines/common/wasm-post-build-steps.yml + parameters: + publishArtifactsForWorkload: true + publishWBT: true + extraVariablesTemplates: + - template: /eng/pipelines/common/templates/runtimes/test-variables.yml + parameters: + testGroup: innerloop + liveLibrariesBuildConfig: Release + - template: /eng/pipelines/common/templates/runtimes/native-test-assets-variables.yml + parameters: + testGroup: innerloop + condition: >- + or( + eq(variables['wasmDarcDependenciesChanged'], true), + eq(stageDependencies.EvaluatePaths.evaluate_paths.outputs['SetPathVars_tools_illink.containsChange'], true), + eq(stageDependencies.EvaluatePaths.evaluate_paths.outputs['SetPathVars_wasm_coreclr_runtimetests.containsChange'], true), + eq(variables['isRollingBuild'], true)) + + - template: /eng/pipelines/common/platform-matrix.yml + parameters: + jobTemplate: /eng/pipelines/common/global-build-job.yml + buildConfig: checked + platforms: - browser_wasm_win jobParameters: nameSuffix: CoreCLR_ReleaseLibraries buildArgs: -s clr+libs+libs.tests+packs -c Release -rc $(_BuildConfig) /p:TestAssemblies=false /p:TestWasmBuildTests=true /p:ArchiveTests=true /p:InstallWorkloadForTesting=false timeoutInMinutes: 120 postBuildSteps: - - ${{ if eq(platform, 'browser_wasm') }}: - - template: /eng/pipelines/coreclr/templates/build-native-test-assets-step.yml - parameters: - extraBuildArgs: -os browser - template: /eng/pipelines/common/upload-artifact-step.yml parameters: rootFolder: $(Build.SourcesDirectory)/artifacts/bin @@ -145,10 +190,6 @@ extends: parameters: testGroup: innerloop liveLibrariesBuildConfig: Release - - ${{ if eq(platform, 'browser_wasm') }}: - - template: /eng/pipelines/common/templates/runtimes/native-test-assets-variables.yml - parameters: - testGroup: innerloop condition: >- or( eq(variables['wasmDarcDependenciesChanged'], true), From 5a6da688a17fdccb6d0658e8f3b7dcb5b839c8b8 Mon Sep 17 00:00:00 2001 From: Radek Doulik Date: Thu, 12 Feb 2026 11:57:05 +0100 Subject: [PATCH 084/123] Fix WBT artifacts name --- .../common/templates/browser-wasm-coreclr-build-tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/eng/pipelines/common/templates/browser-wasm-coreclr-build-tests.yml b/eng/pipelines/common/templates/browser-wasm-coreclr-build-tests.yml index 28526ca3c4a057..2b6934c62adda0 100644 --- a/eng/pipelines/common/templates/browser-wasm-coreclr-build-tests.yml +++ b/eng/pipelines/common/templates/browser-wasm-coreclr-build-tests.yml @@ -88,14 +88,14 @@ jobs: displayName: Download Wasm.Build.Tests inputs: buildType: current - artifactName: WasmBuildTests_$(_hostedOs)_AllSubsets_CoreCLR + artifactName: WasmBuildTests_$(_hostedOs)_CoreCLR_ReleaseLibraries downloadType: single downloadPath: '$(Build.SourcesDirectory)/artifacts' - task: CopyFiles@2 displayName: Copy Wasm.Build.Tests archive inputs: - SourceFolder: '$(Build.SourcesDirectory)/artifacts/WasmBuildTests_$(_hostedOs)_AllSubsets_CoreCLR' + SourceFolder: '$(Build.SourcesDirectory)/artifacts/WasmBuildTests_$(_hostedOs)_CoreCLR_ReleaseLibraries' Contents: helix/** TargetFolder: '$(Build.SourcesDirectory)/artifacts' CleanTargetFolder: false From 7c19f87d35649f3e7ae0dd53bd860ad3d0012e14 Mon Sep 17 00:00:00 2001 From: Radek Doulik Date: Thu, 12 Feb 2026 13:58:25 +0100 Subject: [PATCH 085/123] Fix build config for WBT --- .../common/templates/browser-wasm-coreclr-build-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eng/pipelines/common/templates/browser-wasm-coreclr-build-tests.yml b/eng/pipelines/common/templates/browser-wasm-coreclr-build-tests.yml index 2b6934c62adda0..297ef5dd7f2c42 100644 --- a/eng/pipelines/common/templates/browser-wasm-coreclr-build-tests.yml +++ b/eng/pipelines/common/templates/browser-wasm-coreclr-build-tests.yml @@ -15,7 +15,7 @@ jobs: parameters: jobTemplate: /eng/pipelines/common/global-build-job.yml helixQueuesTemplate: /eng/pipelines/libraries/helix-queues-setup.yml - buildConfig: Release + buildConfig: checked runtimeFlavor: CoreCLR platforms: - ${{ platform }} From 97eb510dad68a736f83b09afa567f4afd1295844 Mon Sep 17 00:00:00 2001 From: Radek Doulik Date: Thu, 12 Feb 2026 14:05:28 +0100 Subject: [PATCH 086/123] Fix timeout calc --- src/tests/Common/CLRTest.Execute.Bash.targets | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/tests/Common/CLRTest.Execute.Bash.targets b/src/tests/Common/CLRTest.Execute.Bash.targets index 8ef17a10bf36b3..7f9b8dcda70ec8 100644 --- a/src/tests/Common/CLRTest.Execute.Bash.targets +++ b/src/tests/Common/CLRTest.Execute.Bash.targets @@ -332,7 +332,7 @@ fi /dev/null; then kill -9 "$pid" 2>/dev/null fi From afbdbc38b00d5bc0ce66c6d748db2fde8c49b90b Mon Sep 17 00:00:00 2001 From: Radek Doulik Date: Thu, 12 Feb 2026 14:20:44 +0100 Subject: [PATCH 087/123] Escape $( for msbuild to not interpret it --- src/tests/Common/CLRTest.Execute.Bash.targets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tests/Common/CLRTest.Execute.Bash.targets b/src/tests/Common/CLRTest.Execute.Bash.targets index 7f9b8dcda70ec8..7fb69cba2ac61a 100644 --- a/src/tests/Common/CLRTest.Execute.Bash.targets +++ b/src/tests/Common/CLRTest.Execute.Bash.targets @@ -332,7 +332,7 @@ fi Date: Thu, 12 Feb 2026 15:42:09 +0100 Subject: [PATCH 088/123] Capitalize build config, Helix SDK seems case sensitive --- .../common/templates/browser-wasm-coreclr-build-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eng/pipelines/common/templates/browser-wasm-coreclr-build-tests.yml b/eng/pipelines/common/templates/browser-wasm-coreclr-build-tests.yml index 297ef5dd7f2c42..f5ac9c27c9af84 100644 --- a/eng/pipelines/common/templates/browser-wasm-coreclr-build-tests.yml +++ b/eng/pipelines/common/templates/browser-wasm-coreclr-build-tests.yml @@ -15,7 +15,7 @@ jobs: parameters: jobTemplate: /eng/pipelines/common/global-build-job.yml helixQueuesTemplate: /eng/pipelines/libraries/helix-queues-setup.yml - buildConfig: checked + buildConfig: Checked runtimeFlavor: CoreCLR platforms: - ${{ platform }} From 0535af70b88234fa01ed7696c83c12e632893c9f Mon Sep 17 00:00:00 2001 From: Radek Doulik Date: Thu, 12 Feb 2026 23:00:05 +0100 Subject: [PATCH 089/123] Add Release build for WBT --- .../browser-wasm-coreclr-build-tests.yml | 14 ++++----- eng/pipelines/runtime.yml | 29 +++++++++++++++++++ 2 files changed, 36 insertions(+), 7 deletions(-) diff --git a/eng/pipelines/common/templates/browser-wasm-coreclr-build-tests.yml b/eng/pipelines/common/templates/browser-wasm-coreclr-build-tests.yml index f5ac9c27c9af84..cdb9b26ba1dd69 100644 --- a/eng/pipelines/common/templates/browser-wasm-coreclr-build-tests.yml +++ b/eng/pipelines/common/templates/browser-wasm-coreclr-build-tests.yml @@ -15,7 +15,7 @@ jobs: parameters: jobTemplate: /eng/pipelines/common/global-build-job.yml helixQueuesTemplate: /eng/pipelines/libraries/helix-queues-setup.yml - buildConfig: Checked + buildConfig: Release runtimeFlavor: CoreCLR platforms: - ${{ platform }} @@ -42,9 +42,9 @@ jobs: jobParameters: dependsOn: - ${{ if eq(platform, 'browser_wasm') }}: - - build_browser_wasm_linux_checked_CoreCLR_ReleaseLibraries + - build_browser_wasm_linux_Release_CoreCLR - ${{ if eq(platform, 'browser_wasm_win') }}: - - build_browser_wasm_windows_checked_CoreCLR_ReleaseLibraries + - build_browser_wasm_windows_Release_CoreCLR isExtraPlatforms: ${{ parameters.isExtraPlatformsBuild }} testGroup: innerloop nameSuffix: CoreCLR_WasmBuildTests @@ -55,14 +55,14 @@ jobs: displayName: Download built nugets for singlethreaded runtime inputs: buildType: current - artifactName: 'BuildArtifacts_browser_wasm_$(_hostedOs)_checked_CoreCLR_ReleaseLibraries' + artifactName: 'BuildArtifacts_browser_wasm_$(_hostedOs)_Release_CoreCLR' downloadType: single downloadPath: '$(Build.SourcesDirectory)/artifacts' - task: CopyFiles@2 displayName: Copy single threaded assets inputs: - SourceFolder: '$(Build.SourcesDirectory)/artifacts/BuildArtifacts_browser_wasm_$(_hostedOs)_checked_CoreCLR_ReleaseLibraries' + SourceFolder: '$(Build.SourcesDirectory)/artifacts/BuildArtifacts_browser_wasm_$(_hostedOs)_Release_CoreCLR' TargetFolder: '$(Build.SourcesDirectory)/artifacts' CleanTargetFolder: false @@ -88,14 +88,14 @@ jobs: displayName: Download Wasm.Build.Tests inputs: buildType: current - artifactName: WasmBuildTests_$(_hostedOs)_CoreCLR_ReleaseLibraries + artifactName: WasmBuildTests_$(_hostedOs)_CoreCLR downloadType: single downloadPath: '$(Build.SourcesDirectory)/artifacts' - task: CopyFiles@2 displayName: Copy Wasm.Build.Tests archive inputs: - SourceFolder: '$(Build.SourcesDirectory)/artifacts/WasmBuildTests_$(_hostedOs)_CoreCLR_ReleaseLibraries' + SourceFolder: '$(Build.SourcesDirectory)/artifacts/WasmBuildTests_$(_hostedOs)_CoreCLR' Contents: helix/** TargetFolder: '$(Build.SourcesDirectory)/artifacts' CleanTargetFolder: false diff --git a/eng/pipelines/runtime.yml b/eng/pipelines/runtime.yml index dde8957316e868..c28f62cf9d44b9 100644 --- a/eng/pipelines/runtime.yml +++ b/eng/pipelines/runtime.yml @@ -103,6 +103,35 @@ extends: eq(stageDependencies.EvaluatePaths.evaluate_paths.outputs['SetPathVars_non_mono_and_wasm.containsChange'], true), eq(variables['isRollingBuild'], true)) + # Release build of browser wasm for WBT + - template: /eng/pipelines/common/platform-matrix.yml + parameters: + jobTemplate: /eng/pipelines/common/global-build-job.yml + buildConfig: Release + platforms: + - browser_wasm + - browser_wasm_win + jobParameters: + nameSuffix: CoreCLR + buildArgs: -s clr+libs+packs -c Release -rc $(_BuildConfig) /p:TestAssemblies=false /p:TestWasmBuildTests=true /p:ArchiveTests=true /p:InstallWorkloadForTesting=false + timeoutInMinutes: 120 + postBuildSteps: + - template: /eng/pipelines/common/wasm-post-build-steps.yml + parameters: + publishArtifactsForWorkload: true + publishWBT: true + extraVariablesTemplates: + - template: /eng/pipelines/common/templates/runtimes/test-variables.yml + parameters: + testGroup: innerloop + liveLibrariesBuildConfig: Release + condition: >- + or( + eq(variables['wasmDarcDependenciesChanged'], true), + eq(stageDependencies.EvaluatePaths.evaluate_paths.outputs['SetPathVars_tools_illink.containsChange'], true), + eq(stageDependencies.EvaluatePaths.evaluate_paths.outputs['SetPathVars_wasm_coreclr_runtimetests.containsChange'], true), + eq(variables['isRollingBuild'], true)) + - template: /eng/pipelines/common/platform-matrix.yml parameters: jobTemplate: /eng/pipelines/common/global-build-job.yml From 232bf3df9bbb99b897044d722a6bcfbc59c30c76 Mon Sep 17 00:00:00 2001 From: Radek Doulik Date: Fri, 13 Feb 2026 10:19:00 +0100 Subject: [PATCH 090/123] Fix missing artifact for WBT --- eng/pipelines/runtime.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/eng/pipelines/runtime.yml b/eng/pipelines/runtime.yml index c28f62cf9d44b9..c9074fbabadc52 100644 --- a/eng/pipelines/runtime.yml +++ b/eng/pipelines/runtime.yml @@ -113,7 +113,7 @@ extends: - browser_wasm_win jobParameters: nameSuffix: CoreCLR - buildArgs: -s clr+libs+packs -c Release -rc $(_BuildConfig) /p:TestAssemblies=false /p:TestWasmBuildTests=true /p:ArchiveTests=true /p:InstallWorkloadForTesting=false + buildArgs: -s clr+libs+libs.tests+packs -c Release -rc $(_BuildConfig) /p:TestAssemblies=false /p:TestWasmBuildTests=true /p:ArchiveTests=true /p:InstallWorkloadForTesting=false timeoutInMinutes: 120 postBuildSteps: - template: /eng/pipelines/common/wasm-post-build-steps.yml @@ -140,7 +140,7 @@ extends: - browser_wasm jobParameters: nameSuffix: CoreCLR_ReleaseLibraries - buildArgs: -s clr+libs+libs.tests+packs -c Release -rc $(_BuildConfig) /p:TestAssemblies=false /p:TestWasmBuildTests=true /p:ArchiveTests=true /p:InstallWorkloadForTesting=false + buildArgs: -s clr+libs+libs.tests+packs -c Release -rc $(_BuildConfig) /p:TestAssemblies=false /p:ArchiveTests=true /p:InstallWorkloadForTesting=false timeoutInMinutes: 120 postBuildSteps: - template: /eng/pipelines/coreclr/templates/build-native-test-assets-step.yml @@ -190,7 +190,7 @@ extends: - browser_wasm_win jobParameters: nameSuffix: CoreCLR_ReleaseLibraries - buildArgs: -s clr+libs+libs.tests+packs -c Release -rc $(_BuildConfig) /p:TestAssemblies=false /p:TestWasmBuildTests=true /p:ArchiveTests=true /p:InstallWorkloadForTesting=false + buildArgs: -s clr+libs+libs.tests+packs -c Release -rc $(_BuildConfig) /p:TestAssemblies=false /p:ArchiveTests=true /p:InstallWorkloadForTesting=false timeoutInMinutes: 120 postBuildSteps: - template: /eng/pipelines/common/upload-artifact-step.yml From 12c216fe64bed7aa30890cc0547d1f1efb2cafa4 Mon Sep 17 00:00:00 2001 From: Radek Doulik Date: Mon, 16 Feb 2026 13:48:27 +0100 Subject: [PATCH 091/123] Fix the batch script for the tests --- src/tests/Common/CLRTest.Execute.Batch.targets | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/tests/Common/CLRTest.Execute.Batch.targets b/src/tests/Common/CLRTest.Execute.Batch.targets index 853d94daee5df7..c9522213d79f25 100644 --- a/src/tests/Common/CLRTest.Execute.Batch.targets +++ b/src/tests/Common/CLRTest.Execute.Batch.targets @@ -197,7 +197,8 @@ REM Usage: set "__RunCmd=" then call :RunWithTimeout REM Runs __RunCmd with a timeout, kills the process on timeout, REM and returns exit code 99 on timeout. REM Use PowerShell for reliable process management and timeout -powershell -NoProfile -Command "& { $p = Start-Process -FilePath 'cmd.exe' -ArgumentList '/c !__RunCmd!' -NoNewWindow -PassThru; if (-not $p.WaitForExit(%~1)) { try { $p.Kill() } catch {} ; try { taskkill /T /F /PID $p.Id 2>$null } catch {} ; exit 99 } else { exit $p.ExitCode } }" +set __Timeout=%~1 +powershell -NoProfile -Command "& { $p = Start-Process -FilePath 'cmd.exe' -ArgumentList '/c !__RunCmd!' -NoNewWindow -PassThru%3B if (-not $p.WaitForExit(!__Timeout!)) { try { $p.Kill() } catch {} %3B try { taskkill /T /F /PID $p.Id 2>$null } catch {} %3B exit 99 } else { exit $p.ExitCode } }" Exit /b !ERRORLEVEL! ]]> @@ -274,7 +275,7 @@ IF NOT DEFINED RunWithNodeJS ( REM workaround msbuild issue - https://github.com/dotnet/runtime/issues/74328 set DOTNET_CLI_DO_NOT_USE_MSBUILD_SERVER=1 - !__Command! msbuild %CORE_ROOT%\wasm-test-runner\WasmTestRunner.proj /p:NetCoreAppCurrent=$(NetCoreAppCurrent) /p:TestAssemblyFileName=$(MsBuildProjectName).dll /p:TestBinDir=%CD% $(CLRTestMSBuildArgs) + !__Command! msbuild %CORE_ROOT%\wasm-test-runner\WasmTestRunner.proj /p:NetCoreAppCurrent=$(NetCoreAppCurrent) /p:TestAssemblyFileName=$(MsBuildProjectName).dll /p:TestBinDir=%%CD%% $(CLRTestMSBuildArgs) IF NOT "!ERRORLEVEL!"=="0" ( popd Exit /b !ERRORLEVEL! @@ -323,12 +324,12 @@ IF NOT DEFINED RunWithNodeJS ( ECHO Running with node ECHO CORE_ROOT: %CORE_ROOT% - ECHO ExePath: %CD%\%ExePath% + ECHO ExePath: %%CD%%\%ExePath% ECHO CLRTestExecutionArguments: %CLRTestExecutionArguments% REM Disable minidump generation for browser tests REM active issue https://github.com/dotnet/runtime/issues/124088 ECHO Timeout in ms: !__TestTimeout! - set "__RunCmd=node "%CORE_ROOT%\corerun.js" -c "%CORE_ROOT%" "%CD%\%ExePath%" %CLRTestExecutionArguments%" + set "__RunCmd=node "%CORE_ROOT%\corerun.js" -c "%CORE_ROOT%" "%%CD%%\%ExePath%" %CLRTestExecutionArguments%" ECHO Running: !__RunCmd! call :RunWithTimeout !__TestTimeout! set CLRTestExitCode=!ERRORLEVEL! From f8f8ba9798a15621ed3641bae3de49ba1a2f5f9c Mon Sep 17 00:00:00 2001 From: pavelsavara Date: Mon, 16 Feb 2026 17:12:50 +0100 Subject: [PATCH 092/123] wip --- src/mono/sample/wasm/Directory.Build.targets | 6 ++++++ src/native/corehost/browserhost/CMakeLists.txt | 8 +++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/mono/sample/wasm/Directory.Build.targets b/src/mono/sample/wasm/Directory.Build.targets index f0772311623403..23d87d9b063669 100644 --- a/src/mono/sample/wasm/Directory.Build.targets +++ b/src/mono/sample/wasm/Directory.Build.targets @@ -54,6 +54,12 @@ + + + + + + Date: Mon, 16 Feb 2026 20:01:53 +0100 Subject: [PATCH 093/123] Fix paths and exit code for the runner with timeout --- .../Common/CLRTest.Execute.Batch.targets | 22 +++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/src/tests/Common/CLRTest.Execute.Batch.targets b/src/tests/Common/CLRTest.Execute.Batch.targets index c9522213d79f25..baf66ce678b164 100644 --- a/src/tests/Common/CLRTest.Execute.Batch.targets +++ b/src/tests/Common/CLRTest.Execute.Batch.targets @@ -198,7 +198,7 @@ REM Runs __RunCmd with a timeout, kills the process on timeout, REM and returns exit code 99 on timeout. REM Use PowerShell for reliable process management and timeout set __Timeout=%~1 -powershell -NoProfile -Command "& { $p = Start-Process -FilePath 'cmd.exe' -ArgumentList '/c !__RunCmd!' -NoNewWindow -PassThru%3B if (-not $p.WaitForExit(!__Timeout!)) { try { $p.Kill() } catch {} %3B try { taskkill /T /F /PID $p.Id 2>$null } catch {} %3B exit 99 } else { exit $p.ExitCode } }" +powershell -NoProfile -Command "& { $psi = New-Object System.Diagnostics.ProcessStartInfo 'cmd.exe','/c !__RunCmd!'%3B $psi.UseShellExecute = $false%3B $p = [System.Diagnostics.Process]::Start($psi)%3B if (-not $p.WaitForExit(!__Timeout!)) { try { $p.Kill() } catch {} %3B try { taskkill /T /F /PID $p.Id 2>$null } catch {} %3B exit 99 } else { exit $p.ExitCode } }" Exit /b !ERRORLEVEL! ]]> @@ -322,14 +322,28 @@ IF NOT DEFINED RunWithNodeJS ( set __TestTimeout=300000 ) + REM Convert Windows paths to Unix-style paths for Node.js + set "__CoreRootWin=%CORE_ROOT%" + set "__CoreRootUnix=%CORE_ROOT%" + set "__CoreRootUnix=!__CoreRootUnix:\=/!" + if "!__CoreRootUnix:~1,1!"==":" set "__CoreRootUnix=/!__CoreRootUnix:~3!" + + set "__ExePathUnix=!CD!\%ExePath%" + set "__ExePathUnix=!__ExePathUnix:\=/!" + if "!__ExePathUnix:~1,1!"==":" set "__ExePathUnix=/!__ExePathUnix:~3!" + + set "CORE_ROOT=!__CoreRootUnix!" + set "TestExclusionListPath=!__CoreRootUnix!/TestExclusionList.txt" + ECHO Running with node - ECHO CORE_ROOT: %CORE_ROOT% - ECHO ExePath: %%CD%%\%ExePath% + ECHO CORE_ROOT: !CORE_ROOT! + ECHO ExePath: !__ExePathUnix! ECHO CLRTestExecutionArguments: %CLRTestExecutionArguments% REM Disable minidump generation for browser tests REM active issue https://github.com/dotnet/runtime/issues/124088 ECHO Timeout in ms: !__TestTimeout! - set "__RunCmd=node "%CORE_ROOT%\corerun.js" -c "%CORE_ROOT%" "%%CD%%\%ExePath%" %CLRTestExecutionArguments%" + + set "__RunCmd=node "!__CoreRootWin!\corerun.js" -c "!__CoreRootUnix!" "!__ExePathUnix!" %CLRTestExecutionArguments%" ECHO Running: !__RunCmd! call :RunWithTimeout !__TestTimeout! set CLRTestExitCode=!ERRORLEVEL! From 837ea8b06ad99651ac0046a4a52b7fb737b26ccd Mon Sep 17 00:00:00 2001 From: pavelsavara Date: Mon, 16 Feb 2026 22:09:49 +0100 Subject: [PATCH 094/123] wip --- .../corehost/browserhost/CMakeLists.txt | 10 +-- .../corehost/browserhost/loader/assets.ts | 36 ++++++++- .../corehost/browserhost/loader/exit.ts | 2 +- .../corehost/browserhost/loader/index.ts | 4 +- .../corehost/browserhost/loader/logging.ts | 56 ++++++++++--- .../corehost/browserhost/loader/polyfills.ts | 4 + src/native/corehost/browserhost/loader/run.ts | 5 +- src/native/corehost/corehost.proj | 2 +- .../Common/JavaScript/cross-module/index.ts | 2 + .../libs/Common/JavaScript/types/exchange.ts | 8 +- .../System.Native.Browser/diagnostics/exit.ts | 25 ++---- .../diagnostics/index.ts | 4 +- .../diagnostics/symbolicate.ts | 81 ++++++++++++++++++- .../interop/invoke-js.ts | 6 +- .../interop/utils.ts | 20 ----- 15 files changed, 196 insertions(+), 69 deletions(-) diff --git a/src/native/corehost/browserhost/CMakeLists.txt b/src/native/corehost/browserhost/CMakeLists.txt index 5ed979ccc04fdd..acf9a486f0375b 100644 --- a/src/native/corehost/browserhost/CMakeLists.txt +++ b/src/native/corehost/browserhost/CMakeLists.txt @@ -99,18 +99,13 @@ set_target_properties(browserhost PROPERTIES if (UPPERCASE_CMAKE_BUILD_TYPE STREQUAL DEBUG) target_link_options(browserhost PRIVATE -# -sVERBOSE -# -sASSERTIONS=1 - --emit-symbol-map +# add -sVERBOSE=1 to debug linking issues + -sASSERTIONS=1 -sLLD_REPORT_UNDEFINED -sERROR_ON_UNDEFINED_SYMBOLS=1 ) endif () -# add -sVERBOSE=1 to debug linking issues -# WASM-TODO -emit-llvm -# WASM-TODO --source-map-base http://microsoft.com -# WASM-TODO -sSEPARATE_DWARF=1, -gseparate-dwarf target_link_options(browserhost PRIVATE -sINITIAL_MEMORY=134217728 -sMAXIMUM_MEMORY=2147483648 @@ -125,6 +120,7 @@ target_link_options(browserhost PRIVATE -sEXPORTED_FUNCTIONS=${CMAKE_EMCC_EXPORTED_FUNCTIONS} -sEXPORT_NAME=createDotnetRuntime -sENVIRONMENT=web,webview,worker,node,shell + --emit-symbol-map -Wl,-error-limit=0) target_link_libraries(browserhost PRIVATE diff --git a/src/native/corehost/browserhost/loader/assets.ts b/src/native/corehost/browserhost/loader/assets.ts index 90352ff8a9cf5a..8f519b5b762c14 100644 --- a/src/native/corehost/browserhost/loader/assets.ts +++ b/src/native/corehost/browserhost/loader/assets.ts @@ -1,9 +1,9 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -import type { JsModuleExports, JsAsset, AssemblyAsset, WasmAsset, IcuAsset, EmscriptenModuleInternal, WebAssemblyBootResourceType, AssetEntryInternal, PromiseCompletionSource, LoadBootResourceCallback, InstantiateWasmSuccessCallback } from "./types"; +import type { JsModuleExports, JsAsset, AssemblyAsset, WasmAsset, IcuAsset, EmscriptenModuleInternal, WebAssemblyBootResourceType, AssetEntryInternal, PromiseCompletionSource, LoadBootResourceCallback, InstantiateWasmSuccessCallback, SymbolsAsset } from "./types"; -import { dotnetAssert, dotnetLogger, dotnetInternals, dotnetBrowserHostExports, dotnetUpdateInternals, Module } from "./cross-module"; +import { dotnetAssert, dotnetLogger, dotnetInternals, dotnetBrowserHostExports, dotnetUpdateInternals, Module, dotnetDiagnosticsExports } from "./cross-module"; import { ENVIRONMENT_IS_SHELL, ENVIRONMENT_IS_NODE, browserVirtualAppBase } from "./per-module"; import { createPromiseCompletionSource, delay } from "./promise-completion-source"; import { locateFile, makeURLAbsoluteWithApplicationBase } from "./bootstrap"; @@ -144,6 +144,17 @@ export async function fetchVfs(asset: AssemblyAsset): Promise { } } +export async function fetchNativeSymbols(asset: SymbolsAsset): Promise { + totalAssetsToDownload++; + const assetInternal = asset as AssetEntryInternal; + if (assetInternal.name && !asset.resolvedUrl) { + asset.resolvedUrl = locateFile(assetInternal.name); + } + assetInternal.behavior = "symbols"; + const table = await fetchText(assetInternal); + dotnetDiagnosticsExports.installNativeSymbols(table || ""); +} + async function fetchBytes(asset: AssetEntryInternal): Promise { dotnetAssert.check(asset && asset.resolvedUrl, "Bad asset.resolvedUrl"); const response = await loadResource(asset); @@ -158,8 +169,21 @@ async function fetchBytes(asset: AssetEntryInternal): Promise return new Uint8Array(buffer); } +async function fetchText(asset: AssetEntryInternal): Promise { + dotnetAssert.check(asset && asset.resolvedUrl, "Bad asset.resolvedUrl"); + const response = await loadResource(asset); + if (!response.ok) { + if (asset.isOptional) { + dotnetLogger.warn(`Optional resource '${asset.name}' failed to load from '${asset.resolvedUrl}'. HTTP status: ${response.status} ${response.statusText}`); + return null; + } + throw new Error(`Failed to load resource '${asset.name}' from '${asset.resolvedUrl}'. HTTP status: ${response.status} ${response.statusText}`); + } + return response.text(); +} + function loadResource(asset: AssetEntryInternal): Promise { - if ("dotnetwasm" === asset.behavior) { + if (noThrotttleNoRetry[asset.behavior]) { // `response.arrayBuffer()` can't be called twice. return loadResourceFetch(asset); } @@ -330,5 +354,11 @@ const behaviorToContentTypeMap: { [key: string]: string | undefined } = { "icu": "application/octet-stream", "vfs": "application/octet-stream", "manifest": "application/json", + "symbols": "application/text", "dotnetwasm": "application/wasm", }; + +const noThrotttleNoRetry: { [key: string]: number | undefined } = { + "dotnetwasm": 1, + "symbols": 1, +}; diff --git a/src/native/corehost/browserhost/loader/exit.ts b/src/native/corehost/browserhost/loader/exit.ts index 7f400e338d3fb1..6e89fb2941e1ff 100644 --- a/src/native/corehost/browserhost/loader/exit.ts +++ b/src/native/corehost/browserhost/loader/exit.ts @@ -117,7 +117,7 @@ export function exit(exitCode: number, reason: any): void { unregisterExit(); if (!alreadySilent) { if (runtimeState.onExitListeners.length === 0 && !runtimeState.dotnetReady) { - dotnetLogger.error(`Exiting during runtime startup: ${message}`); + dotnetLogger.error(`Exiting during runtime startup`, message); dotnetLogger.debug(() => stack); } for (const listener of runtimeState.onExitListeners) { diff --git a/src/native/corehost/browserhost/loader/index.ts b/src/native/corehost/browserhost/loader/index.ts index 6d0479fac95b62..457f1a1c8825c9 100644 --- a/src/native/corehost/browserhost/loader/index.ts +++ b/src/native/corehost/browserhost/loader/index.ts @@ -16,7 +16,7 @@ import GitHash from "consts:gitHash"; import { loaderConfig, getLoaderConfig } from "./config"; import { exit, isExited, isRuntimeRunning, addOnExitListener, registerExit, quitNow } from "./exit"; import { invokeLibraryInitializers } from "./lib-initializers"; -import { check, error, info, warn, debug, fastCheck } from "./logging"; +import { check, error, info, warn, debug, fastCheck, normalizeException } from "./logging"; import { dotnetAssert, dotnetLoaderExports, dotnetLogger, dotnetUpdateInternals, dotnetUpdateInternalsSubscriber } from "./cross-module"; import { rejectRunMainPromise, resolveRunMainPromise, getRunMainPromise, abortStartup } from "./run"; @@ -66,6 +66,7 @@ export function dotnetInitializeModule(): RuntimeAPI { addOnExitListener, abortStartup, quitNow, + normalizeException, }; Object.assign(dotnetLoaderExports, loaderFunctions); const logger: LoggerType = { @@ -112,6 +113,7 @@ export function dotnetInitializeModule(): RuntimeAPI { dotnetLoaderExports.addOnExitListener, dotnetLoaderExports.abortStartup, dotnetLoaderExports.quitNow, + dotnetLoaderExports.normalizeException, ]; } diff --git a/src/native/corehost/browserhost/loader/logging.ts b/src/native/corehost/browserhost/loader/logging.ts index 65ee07bc4ea8de..28a1eff25e4927 100644 --- a/src/native/corehost/browserhost/loader/logging.ts +++ b/src/native/corehost/browserhost/loader/logging.ts @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. import { loaderConfig } from "./config"; +import { dotnetBrowserUtilsExports, dotnetDiagnosticsExports } from "./cross-module"; export function check(condition: unknown, message: string): asserts condition { if (!condition) { @@ -41,16 +42,53 @@ export function warn(msg: string, ...data: any) { console.warn(prefix + msg, ...data); } -export function error(msg: string, ...data: any) { - if (data && data.length > 0 && data[0] && typeof data[0] === "object") { - // don't log silent errors - if (data[0].silent) { - return; +export function error(msg: string, reason: any) { + console.error(prefix + msg, reason); +} + +export function normalizeException(reason: any) { + let res = "unknown exception"; + if (reason) { + const exitStatus = isExitStatus(reason); + if (typeof reason === "object") { + if (reason.stack === undefined && !exitStatus) { + reason.stack = new Error().stack + ""; + } + } + if (reason.message) { + res = reason.message; + } else if (typeof reason.toString === "function") { + res = reason.toString(); + } else { + res = reason + ""; } - if (data[0].toString) { - console.error(prefix + msg, data[0].toString()); - return; + const stack = reason.stack; + if (stack) { + // Some JS runtimes insert the error message at the top of the stack, some don't, + // so normalize it by using the stack as the result if it already contains the error + if (stack.startsWith(res)) + res = symbolicateStackTrace(stack); + else + res += "\n" + symbolicateStackTrace(stack); + } else { + res = symbolicateStackTrace(res); } } - console.error(prefix + msg, ...data); + return res; +} + +function symbolicateStackTrace(message: string): string { + if (dotnetDiagnosticsExports.symbolicateStackTrace) { + return dotnetDiagnosticsExports.symbolicateStackTrace(message); + } + return message; } + +function isExitStatus(reason: any): boolean { + if (!dotnetBrowserUtilsExports.getExitStatus) { + return false; + } + const ExitStatus = dotnetBrowserUtilsExports.getExitStatus(); + return ExitStatus && reason instanceof ExitStatus; +} + diff --git a/src/native/corehost/browserhost/loader/polyfills.ts b/src/native/corehost/browserhost/loader/polyfills.ts index bae7aed2320ba7..f313cc06ffa4d5 100644 --- a/src/native/corehost/browserhost/loader/polyfills.ts +++ b/src/native/corehost/browserhost/loader/polyfills.ts @@ -153,6 +153,10 @@ export function responseLike(url: string, body: ArrayBuffer | string | null, opt return Promise.resolve(JSON.parse(body)); }, text: () => { + if (typeof body !== "string" && typeof globalThis.TextDecoder !== "undefined") { + const decoder = new globalThis.TextDecoder("utf-8"); + return Promise.resolve(body).then(buffer => decoder.decode(buffer || new Uint8Array())); + } dotnetAssert.check(body !== null && typeof body === "string", "Response body is not a string."); return Promise.resolve(body); } diff --git a/src/native/corehost/browserhost/loader/run.ts b/src/native/corehost/browserhost/loader/run.ts index 5d6838b5ef7969..9b3eb0b8a986e6 100644 --- a/src/native/corehost/browserhost/loader/run.ts +++ b/src/native/corehost/browserhost/loader/run.ts @@ -8,7 +8,7 @@ import { exit, runtimeState } from "./exit"; import { createPromiseCompletionSource } from "./promise-completion-source"; import { getIcuResourceName } from "./icu"; import { loaderConfig, validateLoaderConfig } from "./config"; -import { fetchDll, fetchIcu, fetchPdb, fetchVfs, fetchWasm, loadDotnetModule, loadJSModule, nativeModulePromiseController, verifyAllAssetsDownloaded } from "./assets"; +import { fetchDll, fetchIcu, fetchNativeSymbols, fetchPdb, fetchVfs, fetchWasm, loadDotnetModule, loadJSModule, nativeModulePromiseController, verifyAllAssetsDownloaded } from "./assets"; import { initPolyfills } from "./polyfills"; import { validateWasmFeatures } from "./bootstrap"; @@ -45,6 +45,9 @@ export async function createRuntime(downloadOnly: boolean): Promise { if (loaderConfig.resources.jsModuleDiagnostics && loaderConfig.resources.jsModuleDiagnostics.length > 0) { const diagnosticsModule = await loadDotnetModule(loaderConfig.resources.jsModuleDiagnostics[0]); diagnosticsModule.dotnetInitializeModule(dotnetInternals); + if (loaderConfig.resources.wasmSymbols && loaderConfig.resources.wasmSymbols.length > 0) { + await fetchNativeSymbols(loaderConfig.resources.wasmSymbols[0]); + } } const nativeModulePromise: Promise = loadDotnetModule(loaderConfig.resources.jsModuleNative[0]); const runtimeModulePromise: Promise = loadDotnetModule(loaderConfig.resources.jsModuleRuntime[0]); diff --git a/src/native/corehost/corehost.proj b/src/native/corehost/corehost.proj index d91a4a5414573e..8ac8407f544579 100644 --- a/src/native/corehost/corehost.proj +++ b/src/native/corehost/corehost.proj @@ -181,7 +181,7 @@ <_MicrosoftNetCoreAppRuntimePackNativeDirFiles Include="$(LibrariesSharedFrameworkDir)*.dat" /> <_MicrosoftNetCoreAppRuntimePackNativeDirFiles Include="$(HostSharedFrameworkDir)libBrowserHost.a" /> <_MicrosoftNetCoreAppRuntimePackNativeDirFiles Include="$(HostSharedFrameworkDir)dotnet.native.js" /> - + <_MicrosoftNetCoreAppRuntimePackNativeDirFiles Include="$(HostSharedFrameworkDir)dotnet.native.js.symbols" /> <_MicrosoftNetCoreAppRuntimePackNativeDirFiles Include="$(HostSharedFrameworkDir)dotnet.native.wasm" /> diff --git a/src/native/libs/Common/JavaScript/cross-module/index.ts b/src/native/libs/Common/JavaScript/cross-module/index.ts index e2a5f86213910f..5ebcece430ac25 100644 --- a/src/native/libs/Common/JavaScript/cross-module/index.ts +++ b/src/native/libs/Common/JavaScript/cross-module/index.ts @@ -136,6 +136,7 @@ export function dotnetUpdateInternalsSubscriber() { addOnExitListener: table[14], abortStartup: table[15], quitNow: table[16], + normalizeException: table[17], }; Object.assign(dotnetLoaderExports, loaderExportsLocal); Object.assign(logger, loggerLocal); @@ -179,6 +180,7 @@ export function dotnetUpdateInternalsSubscriber() { function diagnosticsExportsFromTable(table: DiagnosticsExportsTable, interop: DiagnosticsExports): void { const interopLocal: DiagnosticsExports = { symbolicateStackTrace: table[0], + installNativeSymbols: table[1], }; Object.assign(interop, interopLocal); } diff --git a/src/native/libs/Common/JavaScript/types/exchange.ts b/src/native/libs/Common/JavaScript/types/exchange.ts index fe634c54feff20..b228f7e2e06f34 100644 --- a/src/native/libs/Common/JavaScript/types/exchange.ts +++ b/src/native/libs/Common/JavaScript/types/exchange.ts @@ -1,7 +1,7 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -import type { check, error, info, warn, debug, fastCheck } from "../../../../corehost/browserhost/loader/logging"; +import type { check, error, info, warn, debug, fastCheck, normalizeException } from "../../../../corehost/browserhost/loader/logging"; import type { resolveRunMainPromise, rejectRunMainPromise, getRunMainPromise, abortStartup } from "../../../../corehost/browserhost/loader/run"; import type { addOnExitListener, isExited, isRuntimeRunning, quitNow } from "../../../../corehost/browserhost/loader/exit"; @@ -18,7 +18,7 @@ import type { resolveOrRejectPromise } from "../../../System.Runtime.InteropServ import type { cancelPromise } from "../../../System.Runtime.InteropServices.JavaScript.Native/interop/cancelable-promise"; import type { abortInteropTimers } from "../../../System.Runtime.InteropServices.JavaScript.Native/interop/scheduling"; -import type { symbolicateStackTrace } from "../../../System.Native.Browser/diagnostics/symbolicate"; +import type { installNativeSymbols, symbolicateStackTrace } from "../../../System.Native.Browser/diagnostics/symbolicate"; import type { EmsAmbientSymbolsType } from "../types"; export type RuntimeExports = { @@ -67,6 +67,7 @@ export type LoaderExports = { addOnExitListener: typeof addOnExitListener, abortStartup: typeof abortStartup, quitNow: typeof quitNow, + normalizeException: typeof normalizeException } export type LoaderExportsTable = [ @@ -87,6 +88,7 @@ export type LoaderExportsTable = [ typeof addOnExitListener, typeof abortStartup, typeof quitNow, + typeof normalizeException, ] export type BrowserHostExports = { @@ -161,8 +163,10 @@ export type BrowserUtilsExportsTable = [ export type DiagnosticsExportsTable = [ typeof symbolicateStackTrace, + typeof installNativeSymbols, ] export type DiagnosticsExports = { symbolicateStackTrace: typeof symbolicateStackTrace, + installNativeSymbols: typeof installNativeSymbols, } diff --git a/src/native/libs/System.Native.Browser/diagnostics/exit.ts b/src/native/libs/System.Native.Browser/diagnostics/exit.ts index fb210820f91ac7..f18a6a652c14fd 100644 --- a/src/native/libs/System.Native.Browser/diagnostics/exit.ts +++ b/src/native/libs/System.Native.Browser/diagnostics/exit.ts @@ -53,24 +53,15 @@ function onExit(exitCode: number, reason: any, silent: boolean): boolean { return true; } -function logExitReason(exit_code: number, reason: any) { - if (exit_code !== 0 && reason) { +function logExitReason(exitCode: number, reason: any) { + if (exitCode !== 0 && reason) { const exitStatus = isExitStatus(reason); - if (typeof reason === "string") { - dotnetLogger.error(reason); + reason = dotnetLoaderExports.normalizeException(reason); + const msg = "dotnet exited with " + exitCode; + if (exitStatus) { + dotnetLogger.debug(msg, reason); } else { - if (reason.stack === undefined && !exitStatus) { - reason.stack = new Error().stack + ""; - } - const message = reason.message - ? symbolicateStackTrace(reason.message + "\n" + reason.stack) - : reason.toString(); - - if (exitStatus) { - dotnetLogger.debug(message); - } else { - dotnetLogger.error(message); - } + dotnetLogger.error(msg, reason); } } } @@ -164,6 +155,6 @@ async function flushNodeStreams() { await Promise.race([Promise.all([stdoutFlushed, stderrFlushed]), timeout]); clearTimeout(timeoutId); } catch (err) { - dotnetLogger.error(`flushing std* streams failed: ${err}`); + dotnetLogger.error(`flushing std* streams failed`, err); } } diff --git a/src/native/libs/System.Native.Browser/diagnostics/index.ts b/src/native/libs/System.Native.Browser/diagnostics/index.ts index 8550abfb275891..c011132f3df71a 100644 --- a/src/native/libs/System.Native.Browser/diagnostics/index.ts +++ b/src/native/libs/System.Native.Browser/diagnostics/index.ts @@ -8,7 +8,7 @@ import GitHash from "consts:gitHash"; import { dotnetUpdateInternals, dotnetUpdateInternalsSubscriber } from "./cross-module"; import { registerExit } from "./exit"; -import { symbolicateStackTrace } from "./symbolicate"; +import { installNativeSymbols, symbolicateStackTrace } from "./symbolicate"; import { installLoggingProxy } from "./console-proxy"; export function dotnetInitializeModule(internals: InternalExchange): void { @@ -23,6 +23,7 @@ export function dotnetInitializeModule(internals: InternalExchange): void { internals[InternalExchangeIndex.DiagnosticsExportsTable] = diagnosticsExportsToTable({ symbolicateStackTrace, + installNativeSymbols, }); dotnetUpdateInternals(internals, dotnetUpdateInternalsSubscriber); @@ -34,6 +35,7 @@ export function dotnetInitializeModule(internals: InternalExchange): void { // keep in sync with diagnosticsExportsFromTable() return [ map.symbolicateStackTrace, + map.installNativeSymbols, ]; } } diff --git a/src/native/libs/System.Native.Browser/diagnostics/symbolicate.ts b/src/native/libs/System.Native.Browser/diagnostics/symbolicate.ts index d7a76cbbd38b66..d941b4c1a85c86 100644 --- a/src/native/libs/System.Native.Browser/diagnostics/symbolicate.ts +++ b/src/native/libs/System.Native.Browser/diagnostics/symbolicate.ts @@ -1,8 +1,83 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -export function symbolicateStackTrace(stack: string): string { - // WASM-TODO: implement symbolication https://github.com/dotnet/runtime/issues/122647 - return stack; +const symbol_map = new Map(); +let symbolTable: string | undefined; +const regexes: any[] = []; + +export function installNativeSymbols(table: string) { + symbolTable = table; +} + +export function symbolicateStackTrace(message: string): string { + const origMessage = message; + initSymbolMap(); + + if (symbol_map.size == 0) + return message; + + try { + + for (let i = 0; i < regexes.length; i++) { + const newRaw = message.replace(new RegExp(regexes[i], "g"), (substring, ...args) => { + const groups = args.find(arg => { + return typeof (arg) == "object" && arg.replaceSection !== undefined; + }); + + if (groups === undefined) + return substring; + + const funcNum = groups.funcNum; + const replaceSection = groups.replaceSection; + const name = symbol_map.get(Number(funcNum)); + + if (name === undefined) + return substring; + + return substring.replace(replaceSection, `${name} (${replaceSection})`); + }); + + if (newRaw !== origMessage) + return newRaw; + } + + return origMessage; + } catch (error) { + console.debug(`failed to symbolicate: ${error}`); + return message; + } } +function initSymbolMap() { + if (!symbolTable) + return; + + // V8 + // at :wasm-function[1900]:0x83f63 + // at dlfree (:wasm-function[18739]:0x2328ef) + regexes.push(/at (?[^:()]+:wasm-function\[(?\d+)\]:0x[a-fA-F\d]+)((?![^)a-fA-F\d])|$)/); + + //# 5: WASM [009712b2], function #111 (''), pc=0x7c16595c973 (+0x53), pos=38740 (+11) + regexes.push(/(?:WASM \[[\da-zA-Z]+\], (?function #(?[\d]+) \(''\)))/); + + //# chrome + //# at http://127.0.0.1:63817/dotnet.wasm:wasm-function[8963]:0x1e23f4 + regexes.push(/(?[a-z]+:\/\/[^ )]*:wasm-function\[(?\d+)\]:0x[a-fA-F\d]+)/); + + //# .wasm-function[8962] + regexes.push(/(?<[^ >]+>[.:]wasm-function\[(?[0-9]+)\])/); + + const text = symbolTable; + symbolTable = undefined; + try { + text.split(/[\r\n]/).forEach((line: string) => { + const parts: string[] = line.split(/:/); + if (parts.length < 2) + return; + + parts[1] = parts.splice(1).join(":"); + symbol_map.set(Number(parts[0]), parts[1]); + }); + } catch (exc) { + } +} \ No newline at end of file diff --git a/src/native/libs/System.Runtime.InteropServices.JavaScript.Native/interop/invoke-js.ts b/src/native/libs/System.Runtime.InteropServices.JavaScript.Native/interop/invoke-js.ts index db9cc557fa16b0..e355d9e3e44157 100644 --- a/src/native/libs/System.Runtime.InteropServices.JavaScript.Native/interop/invoke-js.ts +++ b/src/native/libs/System.Runtime.InteropServices.JavaScript.Native/interop/invoke-js.ts @@ -3,13 +3,13 @@ import BuildConfiguration from "consts:configuration"; -import { dotnetBrowserUtilsExports, dotnetApi, dotnetAssert, dotnetLogger, VoidPtrNull, Module } from "./cross-module"; +import { dotnetBrowserUtilsExports, dotnetApi, dotnetAssert, dotnetLogger, VoidPtrNull, Module, dotnetLoaderExports } from "./cross-module"; import type { BindingClosureJS, BoundMarshalerToJs, JSFnHandle, JSFunctionSignature, JSHandle, JSMarshalerArguments, VoidPtr, WrappedJSFunction } from "./types"; import { MarshalerType, MeasuredBlock } from "./types"; import { getSig, getSignatureArgumentCount, getSignatureFunctionName, getSignatureHandle, getSignatureModuleName, getSignatureType, getSignatureVersion, isReceiverShouldFree, jsInteropState } from "./marshal"; -import { assertJsInterop, assertRuntimeRunning, endMeasure, fixupPointer, normalizeException, startMeasure } from "./utils"; +import { assertJsInterop, assertRuntimeRunning, endMeasure, fixupPointer, startMeasure } from "./utils"; import { bindArgMarshalToJs } from "./marshal-to-js"; import { boundJsFunctionSymbol, getJSObjectFromJSHandle, importedJsFunctionSymbol, jsImportWrapperByFnHandle } from "./gc-handles"; import { bindArgMarshalToCs, marshalExceptionToCs } from "./marshal-to-cs"; @@ -29,7 +29,7 @@ export function bindJSImportST(signature: JSFunctionSignature): VoidPtr { bindJsImport(signature); return VoidPtrNull; } catch (ex: any) { - return dotnetBrowserUtilsExports.stringToUTF16Ptr(normalizeException(ex)); + return dotnetBrowserUtilsExports.stringToUTF16Ptr(dotnetLoaderExports.normalizeException(ex)); } } diff --git a/src/native/libs/System.Runtime.InteropServices.JavaScript.Native/interop/utils.ts b/src/native/libs/System.Runtime.InteropServices.JavaScript.Native/interop/utils.ts index 425c7267825bdd..64f1d5f1b649b3 100644 --- a/src/native/libs/System.Runtime.InteropServices.JavaScript.Native/interop/utils.ts +++ b/src/native/libs/System.Runtime.InteropServices.JavaScript.Native/interop/utils.ts @@ -11,26 +11,6 @@ export function fixupPointer(signature: any, shiftAmount: number): any { return ((signature as any) >>> shiftAmount) as any; } -export function normalizeException(ex: any) { - let res = "unknown exception"; - if (ex) { - res = ex.toString(); - const stack = ex.stack; - if (stack) { - // Some JS runtimes insert the error message at the top of the stack, some don't, - // so normalize it by using the stack as the result if it already contains the error - if (stack.startsWith(res)) - res = stack; - else - res += "\n" + stack; - } - if (dotnetDiagnosticsExports.symbolicateStackTrace) { - res = dotnetDiagnosticsExports.symbolicateStackTrace(res); - } - } - return res; -} - export function isRuntimeRunning(): boolean { return dotnetLoaderExports.isRuntimeRunning(); } From 9f4535d6fe4931e3032567a473bf1b1c0596292c Mon Sep 17 00:00:00 2001 From: pavelsavara Date: Mon, 16 Feb 2026 22:39:30 +0100 Subject: [PATCH 095/123] more --- src/native/corehost/browserhost/loader/assets.ts | 1 + .../libs/System.Native.Browser/diagnostics/symbolicate.ts | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/native/corehost/browserhost/loader/assets.ts b/src/native/corehost/browserhost/loader/assets.ts index 8f519b5b762c14..836ad90e99859e 100644 --- a/src/native/corehost/browserhost/loader/assets.ts +++ b/src/native/corehost/browserhost/loader/assets.ts @@ -152,6 +152,7 @@ export async function fetchNativeSymbols(asset: SymbolsAsset): Promise { } assetInternal.behavior = "symbols"; const table = await fetchText(assetInternal); + onDownloadedAsset(); dotnetDiagnosticsExports.installNativeSymbols(table || ""); } diff --git a/src/native/libs/System.Native.Browser/diagnostics/symbolicate.ts b/src/native/libs/System.Native.Browser/diagnostics/symbolicate.ts index d941b4c1a85c86..3003880a1c6faa 100644 --- a/src/native/libs/System.Native.Browser/diagnostics/symbolicate.ts +++ b/src/native/libs/System.Native.Browser/diagnostics/symbolicate.ts @@ -75,7 +75,7 @@ function initSymbolMap() { if (parts.length < 2) return; - parts[1] = parts.splice(1).join(":"); + parts[1] = parts.splice(1).join(":").replace(/\\([0-9a-fA-F]{2})/g, (_, hex) => String.fromCharCode(parseInt(hex, 16))); symbol_map.set(Number(parts[0]), parts[1]); }); } catch (exc) { From 3c7226703de232f4df3e982e0536384718348caf Mon Sep 17 00:00:00 2001 From: pavelsavara Date: Mon, 16 Feb 2026 23:04:04 +0100 Subject: [PATCH 096/123] fix --- src/mono/browser/runtime/logging.ts | 2 +- .../System.Native.Browser/diagnostics/symbolicate.ts | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/mono/browser/runtime/logging.ts b/src/mono/browser/runtime/logging.ts index acb184e9630cbf..403d0b61bda3ef 100644 --- a/src/mono/browser/runtime/logging.ts +++ b/src/mono/browser/runtime/logging.ts @@ -185,7 +185,7 @@ function performDeferredSymbolMapParsing () { //# chrome //# at http://127.0.0.1:63817/dotnet.wasm:wasm-function[8963]:0x1e23f4 - regexes.push(/(?[a-z]+:\/\/[^ )]*:wasm-function\[(?\d+)\]:0x[a-fA-F\d]+)/); + regexes.push(/(?[a-z]+:\/\/[a-zA-Z0-9.:/_]*:wasm-function\[(?\d+)\]:0x[a-fA-F\d]+)/); //# .wasm-function[8962] regexes.push(/(?<[^ >]+>[.:]wasm-function\[(?[0-9]+)\])/); diff --git a/src/native/libs/System.Native.Browser/diagnostics/symbolicate.ts b/src/native/libs/System.Native.Browser/diagnostics/symbolicate.ts index 3003880a1c6faa..f7df178e57eefe 100644 --- a/src/native/libs/System.Native.Browser/diagnostics/symbolicate.ts +++ b/src/native/libs/System.Native.Browser/diagnostics/symbolicate.ts @@ -19,7 +19,7 @@ export function symbolicateStackTrace(message: string): string { try { for (let i = 0; i < regexes.length; i++) { - const newRaw = message.replace(new RegExp(regexes[i], "g"), (substring, ...args) => { + const newRaw = message.replace(regexes[i], (substring, ...args) => { const groups = args.find(arg => { return typeof (arg) == "object" && arg.replaceSection !== undefined; }); @@ -55,17 +55,17 @@ function initSymbolMap() { // V8 // at :wasm-function[1900]:0x83f63 // at dlfree (:wasm-function[18739]:0x2328ef) - regexes.push(/at (?[^:()]+:wasm-function\[(?\d+)\]:0x[a-fA-F\d]+)((?![^)a-fA-F\d])|$)/); + regexes.push(/at (?[^:()]+:wasm-function\[(?\d+)\]:0x[a-fA-F\d]+)((?![^)a-fA-F\d])|$)/g); //# 5: WASM [009712b2], function #111 (''), pc=0x7c16595c973 (+0x53), pos=38740 (+11) - regexes.push(/(?:WASM \[[\da-zA-Z]+\], (?function #(?[\d]+) \(''\)))/); + regexes.push(/(?:WASM \[[\da-zA-Z]+\], (?function #(?[\d]+) \(''\)))/g); //# chrome //# at http://127.0.0.1:63817/dotnet.wasm:wasm-function[8963]:0x1e23f4 - regexes.push(/(?[a-z]+:\/\/[^ )]*:wasm-function\[(?\d+)\]:0x[a-fA-F\d]+)/); + regexes.push(/(?[a-z]+:\/\/[a-zA-Z0-9.:/_]*:wasm-function\[(?\d+)\]:0x[a-fA-F\d]+)/g); //# .wasm-function[8962] - regexes.push(/(?<[^ >]+>[.:]wasm-function\[(?[0-9]+)\])/); + regexes.push(/(?<[^ >]+>[.:]wasm-function\[(?[0-9]+)\])/g); const text = symbolTable; symbolTable = undefined; From de31ebc74161e77fb0f5e861ee9c88c6a10749d1 Mon Sep 17 00:00:00 2001 From: pavelsavara Date: Mon, 16 Feb 2026 23:31:21 +0100 Subject: [PATCH 097/123] fix --- src/native/corehost/browserhost/loader/assets.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/native/corehost/browserhost/loader/assets.ts b/src/native/corehost/browserhost/loader/assets.ts index 836ad90e99859e..ee4afc35ab2c1a 100644 --- a/src/native/corehost/browserhost/loader/assets.ts +++ b/src/native/corehost/browserhost/loader/assets.ts @@ -184,7 +184,7 @@ async function fetchText(asset: AssetEntryInternal): Promise { } function loadResource(asset: AssetEntryInternal): Promise { - if (noThrotttleNoRetry[asset.behavior]) { + if (noThrottleNoRetry[asset.behavior]) { // `response.arrayBuffer()` can't be called twice. return loadResourceFetch(asset); } @@ -359,7 +359,7 @@ const behaviorToContentTypeMap: { [key: string]: string | undefined } = { "dotnetwasm": "application/wasm", }; -const noThrotttleNoRetry: { [key: string]: number | undefined } = { +const noThrottleNoRetry: { [key: string]: number | undefined } = { "dotnetwasm": 1, "symbols": 1, }; From e1a23e3b0b9e607a95a720598fa673fb697487d0 Mon Sep 17 00:00:00 2001 From: Radek Doulik Date: Tue, 17 Feb 2026 08:39:44 +0100 Subject: [PATCH 098/123] Fix watchdog --- src/tests/Common/CLRTest.Execute.Bash.targets | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/tests/Common/CLRTest.Execute.Bash.targets b/src/tests/Common/CLRTest.Execute.Bash.targets index 7fb69cba2ac61a..336c33a6dd6f68 100644 --- a/src/tests/Common/CLRTest.Execute.Bash.targets +++ b/src/tests/Common/CLRTest.Execute.Bash.targets @@ -353,8 +353,10 @@ run_with_timeout() { wait "$pid" local exit_code=$? - # Kill watchdog if still running + # Kill watchdog and its children (sleep process) if still running + pkill -P "$watchdog" 2>/dev/null kill "$watchdog" 2>/dev/null + wait "$watchdog" 2>/dev/null # If the process was killed by SIGKILL (128+9 = 137), map to 99 if [ $exit_code -eq 137 ]; then From 171818e202cb74b2321fad245edb4ff5bbf57b11 Mon Sep 17 00:00:00 2001 From: Radek Doulik Date: Tue, 17 Feb 2026 09:30:15 +0100 Subject: [PATCH 099/123] Regenerate --- src/coreclr/vm/wasm/callhelpers-reverse.cpp | 78 ++++++++++----------- 1 file changed, 39 insertions(+), 39 deletions(-) diff --git a/src/coreclr/vm/wasm/callhelpers-reverse.cpp b/src/coreclr/vm/wasm/callhelpers-reverse.cpp index eaed7b6944928c..493767ee35bfcf 100644 --- a/src/coreclr/vm/wasm/callhelpers-reverse.cpp +++ b/src/coreclr/vm/wasm/callhelpers-reverse.cpp @@ -586,45 +586,45 @@ static int32_t Call_System_Private_CoreLib_Internal_Runtime_InteropServices_ComA extern const ReverseThunkMapEntry g_ReverseThunks[] = { - { 2644319185, 3863938719, { &MD_System_Private_CoreLib_System_GC__RegisterNoGCRegionCallback_g__Callback_7C_72_0_I32_RetVoid, (void*)&Call_System_Private_CoreLib_System_GC__RegisterNoGCRegionCallback_g__Callback_7C_72_0_I32_RetVoid } } /* alternate key source: g__Callback|72_0#1:System.Private.CoreLib:System:GC */, - { 2644321927, 1336557534, { &MD_System_Private_CoreLib_System_Threading_ThreadPool_BackgroundJobHandler_Void_RetVoid, (void*)&Call_System_Private_CoreLib_System_Threading_ThreadPool_BackgroundJobHandler_Void_RetVoid } } /* alternate key source: BackgroundJobHandler#0:System.Private.CoreLib:System.Threading:ThreadPool */, - { 3685902048, 2901966433, { &MD_System_Runtime_InteropServices_JavaScript_System_Runtime_InteropServices_JavaScript_JavaScriptExports_BindAssemblyExports_I32_RetVoid, (void*)&Call_System_Runtime_InteropServices_JavaScript_System_Runtime_InteropServices_JavaScript_JavaScriptExports_BindAssemblyExports_I32_RetVoid } } /* alternate key source: BindAssemblyExports#1:System.Runtime.InteropServices.JavaScript:System.Runtime.InteropServices.JavaScript:JavaScriptExports */, - { 3685901981, 2601830388, { &MD_System_Runtime_InteropServices_JavaScript_System_Runtime_InteropServices_JavaScript_JavaScriptExports_CallDelegate_I32_RetVoid, (void*)&Call_System_Runtime_InteropServices_JavaScript_System_Runtime_InteropServices_JavaScript_JavaScriptExports_CallDelegate_I32_RetVoid } } /* alternate key source: CallDelegate#1:System.Runtime.InteropServices.JavaScript:System.Runtime.InteropServices.JavaScript:JavaScriptExports */, - { 3685902049, 433365813, { &MD_System_Runtime_InteropServices_JavaScript_System_Runtime_InteropServices_JavaScript_JavaScriptExports_CallJSExport_I32_I32_RetVoid, (void*)&Call_System_Runtime_InteropServices_JavaScript_System_Runtime_InteropServices_JavaScript_JavaScriptExports_CallJSExport_I32_I32_RetVoid } } /* alternate key source: CallJSExport#2:System.Runtime.InteropServices.JavaScript:System.Runtime.InteropServices.JavaScript:JavaScriptExports */, - { 2644318075, 1821934012, { &MD_System_Private_CoreLib_System_StartupHookProvider_CallStartupHook_I32_I32_RetVoid, (void*)&Call_System_Private_CoreLib_System_StartupHookProvider_CallStartupHook_I32_I32_RetVoid } } /* alternate key source: CallStartupHook#2:System.Private.CoreLib:System:StartupHookProvider */, - { 2644335770, 3358042195, { &MD_System_Private_CoreLib_System_StubHelpers_MngdRefCustomMarshaler_ClearManaged_I32_I32_I32_I32_RetVoid, (void*)&Call_System_Private_CoreLib_System_StubHelpers_MngdRefCustomMarshaler_ClearManaged_I32_I32_I32_I32_RetVoid } } /* alternate key source: ClearManaged#4:System.Private.CoreLib:System.StubHelpers:MngdRefCustomMarshaler */, - { 2644335772, 2311968855, { &MD_System_Private_CoreLib_System_StubHelpers_MngdRefCustomMarshaler_ClearNative_I32_I32_I32_I32_RetVoid, (void*)&Call_System_Private_CoreLib_System_StubHelpers_MngdRefCustomMarshaler_ClearNative_I32_I32_I32_I32_RetVoid } } /* alternate key source: ClearNative#4:System.Private.CoreLib:System.StubHelpers:MngdRefCustomMarshaler */, - { 3685902050, 3113228365, { &MD_System_Runtime_InteropServices_JavaScript_System_Runtime_InteropServices_JavaScript_JavaScriptExports_CompleteTask_I32_RetVoid, (void*)&Call_System_Runtime_InteropServices_JavaScript_System_Runtime_InteropServices_JavaScript_JavaScriptExports_CompleteTask_I32_RetVoid } } /* alternate key source: CompleteTask#1:System.Runtime.InteropServices.JavaScript:System.Runtime.InteropServices.JavaScript:JavaScriptExports */, - { 2644319192, 3378852959, { &MD_System_Private_CoreLib_System_GC_ConfigCallback_I32_I32_I32_I32_I64_RetVoid, (void*)&Call_System_Private_CoreLib_System_GC_ConfigCallback_I32_I32_I32_I32_I64_RetVoid } } /* alternate key source: ConfigCallback#5:System.Private.CoreLib:System:GC */, - { 2644335774, 823296796, { &MD_System_Private_CoreLib_System_StubHelpers_MngdRefCustomMarshaler_ConvertContentsToManaged_I32_I32_I32_I32_RetVoid, (void*)&Call_System_Private_CoreLib_System_StubHelpers_MngdRefCustomMarshaler_ConvertContentsToManaged_I32_I32_I32_I32_RetVoid } } /* alternate key source: ConvertContentsToManaged#4:System.Private.CoreLib:System.StubHelpers:MngdRefCustomMarshaler */, - { 2644335776, 3788988216, { &MD_System_Private_CoreLib_System_StubHelpers_MngdRefCustomMarshaler_ConvertContentsToNative_I32_I32_I32_I32_RetVoid, (void*)&Call_System_Private_CoreLib_System_StubHelpers_MngdRefCustomMarshaler_ConvertContentsToNative_I32_I32_I32_I32_RetVoid } } /* alternate key source: ConvertContentsToNative#4:System.Private.CoreLib:System.StubHelpers:MngdRefCustomMarshaler */, - { 2644338057, 1243134822, { &MD_System_Private_CoreLib_System_Reflection_LoaderAllocator_Create_I32_I32_RetVoid, (void*)&Call_System_Private_CoreLib_System_Reflection_LoaderAllocator_Create_I32_I32_RetVoid } } /* alternate key source: Create#2:System.Private.CoreLib:System.Reflection:LoaderAllocator */, - { 2644325561, 1196551088, { &MD_System_Private_CoreLib_System_Globalization_CalendarData_EnumCalendarInfoCallback_I32_I32_RetVoid, (void*)&Call_System_Private_CoreLib_System_Globalization_CalendarData_EnumCalendarInfoCallback_I32_I32_RetVoid } } /* alternate key source: EnumCalendarInfoCallback#2:System.Private.CoreLib:System.Globalization:CalendarData */, - { 2644360760, 2613312799, { &MD_System_Private_CoreLib_Internal_Runtime_InteropServices_ComActivator_GetClassFactoryForTypeInternal_I32_RetI32, (void*)&Call_System_Private_CoreLib_Internal_Runtime_InteropServices_ComActivator_GetClassFactoryForTypeInternal_I32_RetI32 } } /* alternate key source: GetClassFactoryForTypeInternal#1:System.Private.CoreLib:Internal.Runtime.InteropServices:ComActivator */, - { 2644318622, 2605868264, { &MD_System_Private_CoreLib_System_Resolver_GetCodeInfo_I32_I32_I32_I32_I32_I32_RetVoid, (void*)&Call_System_Private_CoreLib_System_Resolver_GetCodeInfo_I32_I32_I32_I32_I32_I32_RetVoid } } /* alternate key source: GetCodeInfo#6:System.Private.CoreLib:System:Resolver */, - { 2644360770, 993231473, { &MD_System_Private_CoreLib_Internal_Runtime_InteropServices_ComponentActivator_GetFunctionPointer_I32_I32_I32_I32_I32_I32_RetI32, (void*)&Call_System_Private_CoreLib_Internal_Runtime_InteropServices_ComponentActivator_GetFunctionPointer_I32_I32_I32_I32_I32_I32_RetI32 } } /* alternate key source: GetFunctionPointer#6:System.Private.CoreLib:Internal.Runtime.InteropServices:ComponentActivator */, - { 2644318625, 4101188193, { &MD_System_Private_CoreLib_System_Resolver_GetJitContext_I32_I32_I32_I32_RetVoid, (void*)&Call_System_Private_CoreLib_System_Resolver_GetJitContext_I32_I32_I32_I32_RetVoid } } /* alternate key source: GetJitContext#4:System.Private.CoreLib:System:Resolver */, - { 2644318623, 2512220404, { &MD_System_Private_CoreLib_System_Resolver_GetLocalsSignature_I32_I32_I32_RetVoid, (void*)&Call_System_Private_CoreLib_System_Resolver_GetLocalsSignature_I32_I32_I32_RetVoid } } /* alternate key source: GetLocalsSignature#3:System.Private.CoreLib:System:Resolver */, - { 3685902051, 1081971317, { &MD_System_Runtime_InteropServices_JavaScript_System_Runtime_InteropServices_JavaScript_JavaScriptExports_GetManagedStackTrace_I32_RetVoid, (void*)&Call_System_Runtime_InteropServices_JavaScript_System_Runtime_InteropServices_JavaScript_JavaScriptExports_GetManagedStackTrace_I32_RetVoid } } /* alternate key source: GetManagedStackTrace#1:System.Runtime.InteropServices.JavaScript:System.Runtime.InteropServices.JavaScript:JavaScriptExports */, - { 2644318620, 831291767, { &MD_System_Private_CoreLib_System_Resolver_GetStringLiteral_I32_I32_I32_I32_RetVoid, (void*)&Call_System_Private_CoreLib_System_Resolver_GetStringLiteral_I32_I32_I32_I32_RetVoid } } /* alternate key source: GetStringLiteral#4:System.Private.CoreLib:System:Resolver */, - { 2644348541, 513042204, { &MD_System_Private_CoreLib_System_Diagnostics_Tracing_EventSource_InitializeDefaultEventSources_I32_RetVoid, (void*)&Call_System_Private_CoreLib_System_Diagnostics_Tracing_EventSource_InitializeDefaultEventSources_I32_RetVoid } } /* alternate key source: InitializeDefaultEventSources#1:System.Private.CoreLib:System.Diagnostics.Tracing:EventSource */, - { 2644360775, 3422156547, { &MD_System_Private_CoreLib_Internal_Runtime_InteropServices_ComponentActivator_LoadAssembly_I32_I32_I32_RetI32, (void*)&Call_System_Private_CoreLib_Internal_Runtime_InteropServices_ComponentActivator_LoadAssembly_I32_I32_I32_RetI32 } } /* alternate key source: LoadAssembly#3:System.Private.CoreLib:Internal.Runtime.InteropServices:ComponentActivator */, - { 2644360774, 542185314, { &MD_System_Private_CoreLib_Internal_Runtime_InteropServices_ComponentActivator_LoadAssemblyAndGetFunctionPointer_I32_I32_I32_I32_I32_I32_RetI32, (void*)&Call_System_Private_CoreLib_Internal_Runtime_InteropServices_ComponentActivator_LoadAssemblyAndGetFunctionPointer_I32_I32_I32_I32_I32_I32_RetI32 } } /* alternate key source: LoadAssemblyAndGetFunctionPointer#6:System.Private.CoreLib:Internal.Runtime.InteropServices:ComponentActivator */, - { 2644360773, 3765950975, { &MD_System_Private_CoreLib_Internal_Runtime_InteropServices_ComponentActivator_LoadAssemblyBytes_I32_I32_I32_I32_I32_I32_RetI32, (void*)&Call_System_Private_CoreLib_Internal_Runtime_InteropServices_ComponentActivator_LoadAssemblyBytes_I32_I32_I32_I32_I32_I32_RetI32 } } /* alternate key source: LoadAssemblyBytes#6:System.Private.CoreLib:Internal.Runtime.InteropServices:ComponentActivator */, - { 2644339256, 343912841, { &MD_System_Private_CoreLib_System_Runtime_InteropServices_TypeMapLazyDictionary_NewExternalTypeEntry_I32_I32_RetI32, (void*)&Call_System_Private_CoreLib_System_Runtime_InteropServices_TypeMapLazyDictionary_NewExternalTypeEntry_I32_I32_RetI32 } } /* alternate key source: NewExternalTypeEntry#2:System.Private.CoreLib:System.Runtime.InteropServices:TypeMapLazyDictionary */, - { 2644339257, 3327247096, { &MD_System_Private_CoreLib_System_Runtime_InteropServices_TypeMapLazyDictionary_NewProxyTypeEntry_I32_I32_RetI32, (void*)&Call_System_Private_CoreLib_System_Runtime_InteropServices_TypeMapLazyDictionary_NewProxyTypeEntry_I32_I32_RetI32 } } /* alternate key source: NewProxyTypeEntry#2:System.Private.CoreLib:System.Runtime.InteropServices:TypeMapLazyDictionary */, - { 2644340379, 3837429452, { &MD_System_Private_CoreLib_System_Runtime_Loader_AssemblyLoadContext_OnAssemblyLoad_I32_I32_RetVoid, (void*)&Call_System_Private_CoreLib_System_Runtime_Loader_AssemblyLoadContext_OnAssemblyLoad_I32_I32_RetVoid } } /* alternate key source: OnAssemblyLoad#2:System.Private.CoreLib:System.Runtime.Loader:AssemblyLoadContext */, - { 2644340374, 1632250712, { &MD_System_Private_CoreLib_System_Runtime_Loader_AssemblyLoadContext_OnAssemblyResolve_I32_I32_I32_I32_RetVoid, (void*)&Call_System_Private_CoreLib_System_Runtime_Loader_AssemblyLoadContext_OnAssemblyResolve_I32_I32_I32_I32_RetVoid } } /* alternate key source: OnAssemblyResolve#4:System.Private.CoreLib:System.Runtime.Loader:AssemblyLoadContext */, - { 2644340377, 2158495436, { &MD_System_Private_CoreLib_System_Runtime_Loader_AssemblyLoadContext_OnResourceResolve_I32_I32_I32_I32_RetVoid, (void*)&Call_System_Private_CoreLib_System_Runtime_Loader_AssemblyLoadContext_OnResourceResolve_I32_I32_I32_I32_RetVoid } } /* alternate key source: OnResourceResolve#4:System.Private.CoreLib:System.Runtime.Loader:AssemblyLoadContext */, - { 2644340376, 3572430398, { &MD_System_Private_CoreLib_System_Runtime_Loader_AssemblyLoadContext_OnTypeResolve_I32_I32_I32_I32_RetVoid, (void*)&Call_System_Private_CoreLib_System_Runtime_Loader_AssemblyLoadContext_OnTypeResolve_I32_I32_I32_I32_RetVoid } } /* alternate key source: OnTypeResolve#4:System.Private.CoreLib:System.Runtime.Loader:AssemblyLoadContext */, - { 2644360761, 4239234100, { &MD_System_Private_CoreLib_Internal_Runtime_InteropServices_ComActivator_RegisterClassForTypeInternal_I32_RetI32, (void*)&Call_System_Private_CoreLib_Internal_Runtime_InteropServices_ComActivator_RegisterClassForTypeInternal_I32_RetI32 } } /* alternate key source: RegisterClassForTypeInternal#1:System.Private.CoreLib:Internal.Runtime.InteropServices:ComActivator */, - { 3685901980, 1403522766, { &MD_System_Runtime_InteropServices_JavaScript_System_Runtime_InteropServices_JavaScript_JavaScriptExports_ReleaseJSOwnedObjectByGCHandle_I32_RetVoid, (void*)&Call_System_Runtime_InteropServices_JavaScript_System_Runtime_InteropServices_JavaScript_JavaScriptExports_ReleaseJSOwnedObjectByGCHandle_I32_RetVoid } } /* alternate key source: ReleaseJSOwnedObjectByGCHandle#1:System.Runtime.InteropServices.JavaScript:System.Runtime.InteropServices.JavaScript:JavaScriptExports */, - { 2644340375, 225437511, { &MD_System_Private_CoreLib_System_Runtime_Loader_AssemblyLoadContext_Resolve_I32_I32_I32_I32_RetVoid, (void*)&Call_System_Private_CoreLib_System_Runtime_Loader_AssemblyLoadContext_Resolve_I32_I32_I32_I32_RetVoid } } /* alternate key source: Resolve#4:System.Private.CoreLib:System.Runtime.Loader:AssemblyLoadContext */, - { 2644340372, 260403842, { &MD_System_Private_CoreLib_System_Runtime_Loader_AssemblyLoadContext_ResolveSatelliteAssembly_I32_I32_I32_I32_RetVoid, (void*)&Call_System_Private_CoreLib_System_Runtime_Loader_AssemblyLoadContext_ResolveSatelliteAssembly_I32_I32_I32_I32_RetVoid } } /* alternate key source: ResolveSatelliteAssembly#4:System.Private.CoreLib:System.Runtime.Loader:AssemblyLoadContext */, - { 2644340373, 2533042349, { &MD_System_Private_CoreLib_System_Runtime_Loader_AssemblyLoadContext_ResolveUsingEvent_I32_I32_I32_I32_RetVoid, (void*)&Call_System_Private_CoreLib_System_Runtime_Loader_AssemblyLoadContext_ResolveUsingEvent_I32_I32_I32_I32_RetVoid } } /* alternate key source: ResolveUsingEvent#4:System.Private.CoreLib:System.Runtime.Loader:AssemblyLoadContext */, - { 2644317641, 1963568864, { &MD_System_Private_CoreLib_System_AppContext_Setup_I32_I32_I32_I32_RetVoid, (void*)&Call_System_Private_CoreLib_System_AppContext_Setup_I32_I32_I32_I32_RetVoid } } /* alternate key source: Setup#4:System.Private.CoreLib:System:AppContext */, - { 2644321597, 167179540, { &MD_System_Private_CoreLib_System_Threading_TimerQueue_TimerHandler_Void_RetVoid, (void*)&Call_System_Private_CoreLib_System_Threading_TimerQueue_TimerHandler_Void_RetVoid } } /* alternate key source: TimerHandler#0:System.Private.CoreLib:System.Threading:TimerQueue */, - { 2644360758, 2150642223, { &MD_System_Private_CoreLib_Internal_Runtime_InteropServices_ComActivator_UnregisterClassForTypeInternal_I32_RetI32, (void*)&Call_System_Private_CoreLib_Internal_Runtime_InteropServices_ComActivator_UnregisterClassForTypeInternal_I32_RetI32 } } /* alternate key source: UnregisterClassForTypeInternal#1:System.Private.CoreLib:Internal.Runtime.InteropServices:ComActivator */ + { 2644319182, 3863938719, { &MD_System_Private_CoreLib_System_GC__RegisterNoGCRegionCallback_g__Callback_7C_72_0_I32_RetVoid, (void*)&Call_System_Private_CoreLib_System_GC__RegisterNoGCRegionCallback_g__Callback_7C_72_0_I32_RetVoid } } /* alternate key source: g__Callback|72_0#1:System.Private.CoreLib:System:GC */, + { 2644321744, 1336557534, { &MD_System_Private_CoreLib_System_Threading_ThreadPool_BackgroundJobHandler_Void_RetVoid, (void*)&Call_System_Private_CoreLib_System_Threading_ThreadPool_BackgroundJobHandler_Void_RetVoid } } /* alternate key source: BackgroundJobHandler#0:System.Private.CoreLib:System.Threading:ThreadPool */, + { 3685902049, 2901966433, { &MD_System_Runtime_InteropServices_JavaScript_System_Runtime_InteropServices_JavaScript_JavaScriptExports_BindAssemblyExports_I32_RetVoid, (void*)&Call_System_Runtime_InteropServices_JavaScript_System_Runtime_InteropServices_JavaScript_JavaScriptExports_BindAssemblyExports_I32_RetVoid } } /* alternate key source: BindAssemblyExports#1:System.Runtime.InteropServices.JavaScript:System.Runtime.InteropServices.JavaScript:JavaScriptExports */, + { 3685902050, 2601830388, { &MD_System_Runtime_InteropServices_JavaScript_System_Runtime_InteropServices_JavaScript_JavaScriptExports_CallDelegate_I32_RetVoid, (void*)&Call_System_Runtime_InteropServices_JavaScript_System_Runtime_InteropServices_JavaScript_JavaScriptExports_CallDelegate_I32_RetVoid } } /* alternate key source: CallDelegate#1:System.Runtime.InteropServices.JavaScript:System.Runtime.InteropServices.JavaScript:JavaScriptExports */, + { 3685902054, 433365813, { &MD_System_Runtime_InteropServices_JavaScript_System_Runtime_InteropServices_JavaScript_JavaScriptExports_CallJSExport_I32_I32_RetVoid, (void*)&Call_System_Runtime_InteropServices_JavaScript_System_Runtime_InteropServices_JavaScript_JavaScriptExports_CallJSExport_I32_I32_RetVoid } } /* alternate key source: CallJSExport#2:System.Runtime.InteropServices.JavaScript:System.Runtime.InteropServices.JavaScript:JavaScriptExports */, + { 2644318070, 1821934012, { &MD_System_Private_CoreLib_System_StartupHookProvider_CallStartupHook_I32_I32_RetVoid, (void*)&Call_System_Private_CoreLib_System_StartupHookProvider_CallStartupHook_I32_I32_RetVoid } } /* alternate key source: CallStartupHook#2:System.Private.CoreLib:System:StartupHookProvider */, + { 2644335563, 3358042195, { &MD_System_Private_CoreLib_System_StubHelpers_MngdRefCustomMarshaler_ClearManaged_I32_I32_I32_I32_RetVoid, (void*)&Call_System_Private_CoreLib_System_StubHelpers_MngdRefCustomMarshaler_ClearManaged_I32_I32_I32_I32_RetVoid } } /* alternate key source: ClearManaged#4:System.Private.CoreLib:System.StubHelpers:MngdRefCustomMarshaler */, + { 2644335565, 2311968855, { &MD_System_Private_CoreLib_System_StubHelpers_MngdRefCustomMarshaler_ClearNative_I32_I32_I32_I32_RetVoid, (void*)&Call_System_Private_CoreLib_System_StubHelpers_MngdRefCustomMarshaler_ClearNative_I32_I32_I32_I32_RetVoid } } /* alternate key source: ClearNative#4:System.Private.CoreLib:System.StubHelpers:MngdRefCustomMarshaler */, + { 3685902051, 3113228365, { &MD_System_Runtime_InteropServices_JavaScript_System_Runtime_InteropServices_JavaScript_JavaScriptExports_CompleteTask_I32_RetVoid, (void*)&Call_System_Runtime_InteropServices_JavaScript_System_Runtime_InteropServices_JavaScript_JavaScriptExports_CompleteTask_I32_RetVoid } } /* alternate key source: CompleteTask#1:System.Runtime.InteropServices.JavaScript:System.Runtime.InteropServices.JavaScript:JavaScriptExports */, + { 2644319193, 3378852959, { &MD_System_Private_CoreLib_System_GC_ConfigCallback_I32_I32_I32_I32_I64_RetVoid, (void*)&Call_System_Private_CoreLib_System_GC_ConfigCallback_I32_I32_I32_I32_I64_RetVoid } } /* alternate key source: ConfigCallback#5:System.Private.CoreLib:System:GC */, + { 2644335567, 823296796, { &MD_System_Private_CoreLib_System_StubHelpers_MngdRefCustomMarshaler_ConvertContentsToManaged_I32_I32_I32_I32_RetVoid, (void*)&Call_System_Private_CoreLib_System_StubHelpers_MngdRefCustomMarshaler_ConvertContentsToManaged_I32_I32_I32_I32_RetVoid } } /* alternate key source: ConvertContentsToManaged#4:System.Private.CoreLib:System.StubHelpers:MngdRefCustomMarshaler */, + { 2644335569, 3788988216, { &MD_System_Private_CoreLib_System_StubHelpers_MngdRefCustomMarshaler_ConvertContentsToNative_I32_I32_I32_I32_RetVoid, (void*)&Call_System_Private_CoreLib_System_StubHelpers_MngdRefCustomMarshaler_ConvertContentsToNative_I32_I32_I32_I32_RetVoid } } /* alternate key source: ConvertContentsToNative#4:System.Private.CoreLib:System.StubHelpers:MngdRefCustomMarshaler */, + { 2644337824, 1243134822, { &MD_System_Private_CoreLib_System_Reflection_LoaderAllocator_Create_I32_I32_RetVoid, (void*)&Call_System_Private_CoreLib_System_Reflection_LoaderAllocator_Create_I32_I32_RetVoid } } /* alternate key source: Create#2:System.Private.CoreLib:System.Reflection:LoaderAllocator */, + { 2644325224, 1196551088, { &MD_System_Private_CoreLib_System_Globalization_CalendarData_EnumCalendarInfoCallback_I32_I32_RetVoid, (void*)&Call_System_Private_CoreLib_System_Globalization_CalendarData_EnumCalendarInfoCallback_I32_I32_RetVoid } } /* alternate key source: EnumCalendarInfoCallback#2:System.Private.CoreLib:System.Globalization:CalendarData */, + { 2644360690, 2613312799, { &MD_System_Private_CoreLib_Internal_Runtime_InteropServices_ComActivator_GetClassFactoryForTypeInternal_I32_RetI32, (void*)&Call_System_Private_CoreLib_Internal_Runtime_InteropServices_ComActivator_GetClassFactoryForTypeInternal_I32_RetI32 } } /* alternate key source: GetClassFactoryForTypeInternal#1:System.Private.CoreLib:Internal.Runtime.InteropServices:ComActivator */, + { 2644318620, 2605868264, { &MD_System_Private_CoreLib_System_Resolver_GetCodeInfo_I32_I32_I32_I32_I32_I32_RetVoid, (void*)&Call_System_Private_CoreLib_System_Resolver_GetCodeInfo_I32_I32_I32_I32_I32_I32_RetVoid } } /* alternate key source: GetCodeInfo#6:System.Private.CoreLib:System:Resolver */, + { 2644360700, 993231473, { &MD_System_Private_CoreLib_Internal_Runtime_InteropServices_ComponentActivator_GetFunctionPointer_I32_I32_I32_I32_I32_I32_RetI32, (void*)&Call_System_Private_CoreLib_Internal_Runtime_InteropServices_ComponentActivator_GetFunctionPointer_I32_I32_I32_I32_I32_I32_RetI32 } } /* alternate key source: GetFunctionPointer#6:System.Private.CoreLib:Internal.Runtime.InteropServices:ComponentActivator */, + { 2644318623, 4101188193, { &MD_System_Private_CoreLib_System_Resolver_GetJitContext_I32_I32_I32_I32_RetVoid, (void*)&Call_System_Private_CoreLib_System_Resolver_GetJitContext_I32_I32_I32_I32_RetVoid } } /* alternate key source: GetJitContext#4:System.Private.CoreLib:System:Resolver */, + { 2644318621, 2512220404, { &MD_System_Private_CoreLib_System_Resolver_GetLocalsSignature_I32_I32_I32_RetVoid, (void*)&Call_System_Private_CoreLib_System_Resolver_GetLocalsSignature_I32_I32_I32_RetVoid } } /* alternate key source: GetLocalsSignature#3:System.Private.CoreLib:System:Resolver */, + { 3685902048, 1081971317, { &MD_System_Runtime_InteropServices_JavaScript_System_Runtime_InteropServices_JavaScript_JavaScriptExports_GetManagedStackTrace_I32_RetVoid, (void*)&Call_System_Runtime_InteropServices_JavaScript_System_Runtime_InteropServices_JavaScript_JavaScriptExports_GetManagedStackTrace_I32_RetVoid } } /* alternate key source: GetManagedStackTrace#1:System.Runtime.InteropServices.JavaScript:System.Runtime.InteropServices.JavaScript:JavaScriptExports */, + { 2644318618, 831291767, { &MD_System_Private_CoreLib_System_Resolver_GetStringLiteral_I32_I32_I32_I32_RetVoid, (void*)&Call_System_Private_CoreLib_System_Resolver_GetStringLiteral_I32_I32_I32_I32_RetVoid } } /* alternate key source: GetStringLiteral#4:System.Private.CoreLib:System:Resolver */, + { 2644348245, 513042204, { &MD_System_Private_CoreLib_System_Diagnostics_Tracing_EventSource_InitializeDefaultEventSources_I32_RetVoid, (void*)&Call_System_Private_CoreLib_System_Diagnostics_Tracing_EventSource_InitializeDefaultEventSources_I32_RetVoid } } /* alternate key source: InitializeDefaultEventSources#1:System.Private.CoreLib:System.Diagnostics.Tracing:EventSource */, + { 2644360449, 3422156547, { &MD_System_Private_CoreLib_Internal_Runtime_InteropServices_ComponentActivator_LoadAssembly_I32_I32_I32_RetI32, (void*)&Call_System_Private_CoreLib_Internal_Runtime_InteropServices_ComponentActivator_LoadAssembly_I32_I32_I32_RetI32 } } /* alternate key source: LoadAssembly#3:System.Private.CoreLib:Internal.Runtime.InteropServices:ComponentActivator */, + { 2644360448, 542185314, { &MD_System_Private_CoreLib_Internal_Runtime_InteropServices_ComponentActivator_LoadAssemblyAndGetFunctionPointer_I32_I32_I32_I32_I32_I32_RetI32, (void*)&Call_System_Private_CoreLib_Internal_Runtime_InteropServices_ComponentActivator_LoadAssemblyAndGetFunctionPointer_I32_I32_I32_I32_I32_I32_RetI32 } } /* alternate key source: LoadAssemblyAndGetFunctionPointer#6:System.Private.CoreLib:Internal.Runtime.InteropServices:ComponentActivator */, + { 2644360703, 3765950975, { &MD_System_Private_CoreLib_Internal_Runtime_InteropServices_ComponentActivator_LoadAssemblyBytes_I32_I32_I32_I32_I32_I32_RetI32, (void*)&Call_System_Private_CoreLib_Internal_Runtime_InteropServices_ComponentActivator_LoadAssemblyBytes_I32_I32_I32_I32_I32_I32_RetI32 } } /* alternate key source: LoadAssemblyBytes#6:System.Private.CoreLib:Internal.Runtime.InteropServices:ComponentActivator */, + { 2644339032, 343912841, { &MD_System_Private_CoreLib_System_Runtime_InteropServices_TypeMapLazyDictionary_NewExternalTypeEntry_I32_I32_RetI32, (void*)&Call_System_Private_CoreLib_System_Runtime_InteropServices_TypeMapLazyDictionary_NewExternalTypeEntry_I32_I32_RetI32 } } /* alternate key source: NewExternalTypeEntry#2:System.Private.CoreLib:System.Runtime.InteropServices:TypeMapLazyDictionary */, + { 2644339033, 3327247096, { &MD_System_Private_CoreLib_System_Runtime_InteropServices_TypeMapLazyDictionary_NewProxyTypeEntry_I32_I32_RetI32, (void*)&Call_System_Private_CoreLib_System_Runtime_InteropServices_TypeMapLazyDictionary_NewProxyTypeEntry_I32_I32_RetI32 } } /* alternate key source: NewProxyTypeEntry#2:System.Private.CoreLib:System.Runtime.InteropServices:TypeMapLazyDictionary */, + { 2644340158, 3837429452, { &MD_System_Private_CoreLib_System_Runtime_Loader_AssemblyLoadContext_OnAssemblyLoad_I32_I32_RetVoid, (void*)&Call_System_Private_CoreLib_System_Runtime_Loader_AssemblyLoadContext_OnAssemblyLoad_I32_I32_RetVoid } } /* alternate key source: OnAssemblyLoad#2:System.Private.CoreLib:System.Runtime.Loader:AssemblyLoadContext */, + { 2644340157, 1632250712, { &MD_System_Private_CoreLib_System_Runtime_Loader_AssemblyLoadContext_OnAssemblyResolve_I32_I32_I32_I32_RetVoid, (void*)&Call_System_Private_CoreLib_System_Runtime_Loader_AssemblyLoadContext_OnAssemblyResolve_I32_I32_I32_I32_RetVoid } } /* alternate key source: OnAssemblyResolve#4:System.Private.CoreLib:System.Runtime.Loader:AssemblyLoadContext */, + { 2644340156, 2158495436, { &MD_System_Private_CoreLib_System_Runtime_Loader_AssemblyLoadContext_OnResourceResolve_I32_I32_I32_I32_RetVoid, (void*)&Call_System_Private_CoreLib_System_Runtime_Loader_AssemblyLoadContext_OnResourceResolve_I32_I32_I32_I32_RetVoid } } /* alternate key source: OnResourceResolve#4:System.Private.CoreLib:System.Runtime.Loader:AssemblyLoadContext */, + { 2644340159, 3572430398, { &MD_System_Private_CoreLib_System_Runtime_Loader_AssemblyLoadContext_OnTypeResolve_I32_I32_I32_I32_RetVoid, (void*)&Call_System_Private_CoreLib_System_Runtime_Loader_AssemblyLoadContext_OnTypeResolve_I32_I32_I32_I32_RetVoid } } /* alternate key source: OnTypeResolve#4:System.Private.CoreLib:System.Runtime.Loader:AssemblyLoadContext */, + { 2644360691, 4239234100, { &MD_System_Private_CoreLib_Internal_Runtime_InteropServices_ComActivator_RegisterClassForTypeInternal_I32_RetI32, (void*)&Call_System_Private_CoreLib_Internal_Runtime_InteropServices_ComActivator_RegisterClassForTypeInternal_I32_RetI32 } } /* alternate key source: RegisterClassForTypeInternal#1:System.Private.CoreLib:Internal.Runtime.InteropServices:ComActivator */, + { 3685901981, 1403522766, { &MD_System_Runtime_InteropServices_JavaScript_System_Runtime_InteropServices_JavaScript_JavaScriptExports_ReleaseJSOwnedObjectByGCHandle_I32_RetVoid, (void*)&Call_System_Runtime_InteropServices_JavaScript_System_Runtime_InteropServices_JavaScript_JavaScriptExports_ReleaseJSOwnedObjectByGCHandle_I32_RetVoid } } /* alternate key source: ReleaseJSOwnedObjectByGCHandle#1:System.Runtime.InteropServices.JavaScript:System.Runtime.InteropServices.JavaScript:JavaScriptExports */, + { 2644340154, 225437511, { &MD_System_Private_CoreLib_System_Runtime_Loader_AssemblyLoadContext_Resolve_I32_I32_I32_I32_RetVoid, (void*)&Call_System_Private_CoreLib_System_Runtime_Loader_AssemblyLoadContext_Resolve_I32_I32_I32_I32_RetVoid } } /* alternate key source: Resolve#4:System.Private.CoreLib:System.Runtime.Loader:AssemblyLoadContext */, + { 2644340155, 260403842, { &MD_System_Private_CoreLib_System_Runtime_Loader_AssemblyLoadContext_ResolveSatelliteAssembly_I32_I32_I32_I32_RetVoid, (void*)&Call_System_Private_CoreLib_System_Runtime_Loader_AssemblyLoadContext_ResolveSatelliteAssembly_I32_I32_I32_I32_RetVoid } } /* alternate key source: ResolveSatelliteAssembly#4:System.Private.CoreLib:System.Runtime.Loader:AssemblyLoadContext */, + { 2644340152, 2533042349, { &MD_System_Private_CoreLib_System_Runtime_Loader_AssemblyLoadContext_ResolveUsingEvent_I32_I32_I32_I32_RetVoid, (void*)&Call_System_Private_CoreLib_System_Runtime_Loader_AssemblyLoadContext_ResolveUsingEvent_I32_I32_I32_I32_RetVoid } } /* alternate key source: ResolveUsingEvent#4:System.Private.CoreLib:System.Runtime.Loader:AssemblyLoadContext */, + { 2644317636, 1963568864, { &MD_System_Private_CoreLib_System_AppContext_Setup_I32_I32_I32_I32_RetVoid, (void*)&Call_System_Private_CoreLib_System_AppContext_Setup_I32_I32_I32_I32_RetVoid } } /* alternate key source: Setup#4:System.Private.CoreLib:System:AppContext */, + { 2644321670, 167179540, { &MD_System_Private_CoreLib_System_Threading_TimerQueue_TimerHandler_Void_RetVoid, (void*)&Call_System_Private_CoreLib_System_Threading_TimerQueue_TimerHandler_Void_RetVoid } } /* alternate key source: TimerHandler#0:System.Private.CoreLib:System.Threading:TimerQueue */, + { 2644360688, 2150642223, { &MD_System_Private_CoreLib_Internal_Runtime_InteropServices_ComActivator_UnregisterClassForTypeInternal_I32_RetI32, (void*)&Call_System_Private_CoreLib_Internal_Runtime_InteropServices_ComActivator_UnregisterClassForTypeInternal_I32_RetI32 } } /* alternate key source: UnregisterClassForTypeInternal#1:System.Private.CoreLib:Internal.Runtime.InteropServices:ComActivator */ }; const size_t g_ReverseThunksCount = sizeof(g_ReverseThunks) / sizeof(g_ReverseThunks[0]); From 19dce74d87ec88291b32adba7a0b5afdf0a071a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Fi=C5=A1era?= Date: Tue, 17 Feb 2026 10:29:29 +0100 Subject: [PATCH 100/123] Emit symbols in WasmSDK --- .../build/Microsoft.NET.Sdk.WebAssembly.Browser.targets | 3 +++ .../AssetsComputingHelper.cs | 3 ++- .../ComputeWasmBuildAssets.cs | 5 ++++- .../ComputeWasmPublishAssets.cs | 4 +++- 4 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/mono/nuget/Microsoft.NET.Sdk.WebAssembly.Pack/build/Microsoft.NET.Sdk.WebAssembly.Browser.targets b/src/mono/nuget/Microsoft.NET.Sdk.WebAssembly.Pack/build/Microsoft.NET.Sdk.WebAssembly.Browser.targets index 707ce66956448e..63d1d60dadeede 100644 --- a/src/mono/nuget/Microsoft.NET.Sdk.WebAssembly.Pack/build/Microsoft.NET.Sdk.WebAssembly.Browser.targets +++ b/src/mono/nuget/Microsoft.NET.Sdk.WebAssembly.Pack/build/Microsoft.NET.Sdk.WebAssembly.Browser.targets @@ -334,6 +334,7 @@ Copyright (c) .NET Foundation. All rights reserved. EnableThreads="$(_WasmEnableThreads)" EnableDiagnostics="$(_WasmEmitDiagnosticModuleBuild)" EmitSourceMap="$(_WasmEmitSourceMapBuild)" + EmitSymbolMap="$(WasmEmitSymbolMap)" FingerprintAssets="$(_WasmFingerprintAssets)" FingerprintDotnetJs="$(_WasmFingerprintDotnetJs)" > @@ -362,6 +363,7 @@ Copyright (c) .NET Foundation. All rights reserved. <_WasmFingerprintPatterns Include="DllFiles" Pattern="*.dll" Expression="#[.{fingerprint}]!" /> <_WasmFingerprintPatterns Include="DatFiles" Pattern="*.dat" Expression="#[.{fingerprint}]!" /> <_WasmFingerprintPatterns Include="Pdb" Pattern="*.pdb" Expression="#[.{fingerprint}]!" /> + <_WasmFingerprintPatterns Include="Symbols" Pattern="*.symbols" Expression="#[.{fingerprint}]!" /> diff --git a/src/tasks/Microsoft.NET.Sdk.WebAssembly.Pack.Tasks/AssetsComputingHelper.cs b/src/tasks/Microsoft.NET.Sdk.WebAssembly.Pack.Tasks/AssetsComputingHelper.cs index 0dbe5e23f6a3c3..3c386681dab3c4 100644 --- a/src/tasks/Microsoft.NET.Sdk.WebAssembly.Pack.Tasks/AssetsComputingHelper.cs +++ b/src/tasks/Microsoft.NET.Sdk.WebAssembly.Pack.Tasks/AssetsComputingHelper.cs @@ -53,6 +53,7 @@ public static bool ShouldFilterCandidate( bool enableThreads, bool enableDiagnostics, bool emitSourceMap, + bool emitSymbolMap, out string reason) { var extension = candidate.GetMetadata("Extension"); @@ -90,7 +91,7 @@ public static bool ShouldFilterCandidate( ".js" when assetType == "native" => $"{fileName}{extension} is not used by Blazor", ".mjs" when assetType == "native" && !(enableThreads && fileName == "dotnet.native.worker") => $"{fileName}{extension} is not used by Blazor", ".pdb" when !copySymbols => "copying symbols is disabled", - ".symbols" when fromMonoPackage => "extension .symbols is not required.", + ".symbols" when !emitSymbolMap => "emitting wasm symbol map is not enabled", _ => null }; diff --git a/src/tasks/Microsoft.NET.Sdk.WebAssembly.Pack.Tasks/ComputeWasmBuildAssets.cs b/src/tasks/Microsoft.NET.Sdk.WebAssembly.Pack.Tasks/ComputeWasmBuildAssets.cs index 34dcf1647aa3e2..c0d117a2027eab 100644 --- a/src/tasks/Microsoft.NET.Sdk.WebAssembly.Pack.Tasks/ComputeWasmBuildAssets.cs +++ b/src/tasks/Microsoft.NET.Sdk.WebAssembly.Pack.Tasks/ComputeWasmBuildAssets.cs @@ -52,6 +52,8 @@ public class ComputeWasmBuildAssets : Task public bool EmitSourceMap { get; set; } + public bool EmitSymbolMap { get; set; } + public bool FingerprintAssets { get; set; } public bool FingerprintDotNetJs { get; set; } @@ -91,7 +93,7 @@ public override bool Execute() for (int i = 0; i < Candidates.Length; i++) { var candidate = Candidates[i]; - if (AssetsComputingHelper.ShouldFilterCandidate(candidate, TimeZoneSupport, InvariantGlobalization, LoadFullICUData, CopySymbols, customIcuCandidateFilename, EnableThreads, EnableDiagnostics, EmitSourceMap, out var reason)) + if (AssetsComputingHelper.ShouldFilterCandidate(candidate, TimeZoneSupport, InvariantGlobalization, LoadFullICUData, CopySymbols, customIcuCandidateFilename, EnableThreads, EnableDiagnostics, EmitSourceMap, EmitSymbolMap, out var reason)) { Log.LogMessage(MessageImportance.Low, "Skipping asset '{0}' because '{1}'", candidate.ItemSpec, reason); filesToRemove.Add(candidate); @@ -251,6 +253,7 @@ private static void ApplyUniqueMetadataProperties(ITaskItem candidate) case ".js" when filename.StartsWith("dotnet"): case ".mjs" when filename.StartsWith("dotnet"): case ".dat" when filename.StartsWith("icudt"): + case ".symbols" when filename.StartsWith("dotnet.native"): candidate.SetMetadata("AssetTraitName", "WasmResource"); candidate.SetMetadata("AssetTraitValue", "native"); break; diff --git a/src/tasks/Microsoft.NET.Sdk.WebAssembly.Pack.Tasks/ComputeWasmPublishAssets.cs b/src/tasks/Microsoft.NET.Sdk.WebAssembly.Pack.Tasks/ComputeWasmPublishAssets.cs index 69205e6f3b982f..bdf13fd5662fb7 100644 --- a/src/tasks/Microsoft.NET.Sdk.WebAssembly.Pack.Tasks/ComputeWasmPublishAssets.cs +++ b/src/tasks/Microsoft.NET.Sdk.WebAssembly.Pack.Tasks/ComputeWasmPublishAssets.cs @@ -58,6 +58,8 @@ public class ComputeWasmPublishAssets : Task public bool EmitSourceMap { get; set; } + public bool EmitSymbolMap { get; set; } + public bool IsWebCilEnabled { get; set; } public bool FingerprintAssets { get; set; } @@ -676,7 +678,7 @@ private void GroupResolvedFilesToPublish( foreach (var candidate in resolvedFilesToPublish) { #pragma warning disable CA1864 // Prefer the 'IDictionary.TryAdd(TKey, TValue)' method. Dictionary.TryAdd() not available in .Net framework. - if (AssetsComputingHelper.ShouldFilterCandidate(candidate, TimeZoneSupport, InvariantGlobalization, LoadFullICUData, CopySymbols, customIcuCandidateFilename, EnableThreads, EnableDiagnostics, EmitSourceMap, out var reason)) + if (AssetsComputingHelper.ShouldFilterCandidate(candidate, TimeZoneSupport, InvariantGlobalization, LoadFullICUData, CopySymbols, customIcuCandidateFilename, EnableThreads, EnableDiagnostics, EmitSourceMap, EmitSymbolMap, out var reason)) { Log.LogMessage(MessageImportance.Low, "Skipping asset '{0}' because '{1}'", candidate.ItemSpec, reason); if (!resolvedFilesToPublishToRemove.ContainsKey(candidate.ItemSpec)) From cd807c7673b390bdbe846a055010bb814b8385ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Fi=C5=A1era?= Date: Tue, 17 Feb 2026 11:23:06 +0100 Subject: [PATCH 101/123] Test --- ...rosoft.NET.Sdk.WebAssembly.Browser.targets | 2 +- .../Wasm.Build.Tests/ModuleConfigTests.cs | 25 +++++++++++++++++++ .../WasmSdkBasedProjectProvider.cs | 2 +- 3 files changed, 27 insertions(+), 2 deletions(-) diff --git a/src/mono/nuget/Microsoft.NET.Sdk.WebAssembly.Pack/build/Microsoft.NET.Sdk.WebAssembly.Browser.targets b/src/mono/nuget/Microsoft.NET.Sdk.WebAssembly.Pack/build/Microsoft.NET.Sdk.WebAssembly.Browser.targets index 63d1d60dadeede..74353513b2bac3 100644 --- a/src/mono/nuget/Microsoft.NET.Sdk.WebAssembly.Pack/build/Microsoft.NET.Sdk.WebAssembly.Browser.targets +++ b/src/mono/nuget/Microsoft.NET.Sdk.WebAssembly.Pack/build/Microsoft.NET.Sdk.WebAssembly.Browser.targets @@ -363,7 +363,7 @@ Copyright (c) .NET Foundation. All rights reserved. <_WasmFingerprintPatterns Include="DllFiles" Pattern="*.dll" Expression="#[.{fingerprint}]!" /> <_WasmFingerprintPatterns Include="DatFiles" Pattern="*.dat" Expression="#[.{fingerprint}]!" /> <_WasmFingerprintPatterns Include="Pdb" Pattern="*.pdb" Expression="#[.{fingerprint}]!" /> - <_WasmFingerprintPatterns Include="Symbols" Pattern="*.symbols" Expression="#[.{fingerprint}]!" /> + <_WasmFingerprintPatterns Include="Symbols" Pattern="*.js.symbols" Expression="#[.{fingerprint}]!" /> {emitSymbolMap.ToString().ToLower()}"; + ProjectInfo info = CopyTestAsset(config, aot: false, TestAsset.WasmBasicTestApp, + $"SymbolMapFile_{emitSymbolMap}_{isPublish}", extraProperties: extraProperties); + + if (isPublish) + PublishProject(info, config, new PublishOptions(AssertAppBundle: false)); + else + BuildProject(info, config, new BuildOptions(AssertAppBundle: false)); + + string frameworkDir = GetBinFrameworkDir(config, forPublish: isPublish); + + // The file may be fingerprinted (e.g. dotnet.native..js.symbols), + // so use a glob pattern to find it. + bool symbolsFileExists = Directory.EnumerateFiles(frameworkDir, "dotnet.native*.js.symbols").Any(); + Assert.Equal(emitSymbolMap, symbolsFileExists); + } } diff --git a/src/mono/wasm/Wasm.Build.Tests/WasmSdkBasedProjectProvider.cs b/src/mono/wasm/Wasm.Build.Tests/WasmSdkBasedProjectProvider.cs index 93cb9af858aa01..e4988229b8ee37 100644 --- a/src/mono/wasm/Wasm.Build.Tests/WasmSdkBasedProjectProvider.cs +++ b/src/mono/wasm/Wasm.Build.Tests/WasmSdkBasedProjectProvider.cs @@ -32,7 +32,7 @@ protected override IReadOnlyDictionary GetAllKnownDotnetFilesToFin { "dotnet.js", true }, { "dotnet.js.map", false }, { "dotnet.native.js", true }, - { "dotnet.native.js.symbols", false }, + { "dotnet.native.js.symbols", true }, { "dotnet.native.wasm", true }, { "dotnet.native.worker.mjs", true }, { "dotnet.runtime.js", true }, From 8139241db614e0fdedb24a1a4e73e9c9c1c9d4ee Mon Sep 17 00:00:00 2001 From: Radek Doulik Date: Tue, 17 Feb 2026 12:05:49 +0100 Subject: [PATCH 102/123] Increase timeouts on browser, I see few timeouts --- eng/pipelines/common/templates/runtimes/test-variables.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/eng/pipelines/common/templates/runtimes/test-variables.yml b/eng/pipelines/common/templates/runtimes/test-variables.yml index 9dc85f2fd4d633..f44a9a01415438 100644 --- a/eng/pipelines/common/templates/runtimes/test-variables.yml +++ b/eng/pipelines/common/templates/runtimes/test-variables.yml @@ -28,6 +28,11 @@ variables: value: 10 - name: timeoutPerTestCollectionInMinutes value: 30 + - ${{ if and(eq(parameters.runtimeFlavor, 'coreclr'), eq(parameters.osGroup, 'browser')) }}: + - name: timeoutPerTestInMinutes + value: 15 + - name: timeoutPerTestCollectionInMinutes + value: 45 - ${{ if in(parameters.testGroup, 'outerloop') }}: - name: timeoutPerTestCollectionInMinutes value: 120 From 318d152259aa605e1035d0eb54f9085aa54ec930 Mon Sep 17 00:00:00 2001 From: Radek Doulik Date: Tue, 17 Feb 2026 12:07:43 +0100 Subject: [PATCH 103/123] Report killing the test from watchdog --- src/tests/Common/CLRTest.Execute.Bash.targets | 1 + 1 file changed, 1 insertion(+) diff --git a/src/tests/Common/CLRTest.Execute.Bash.targets b/src/tests/Common/CLRTest.Execute.Bash.targets index 336c33a6dd6f68..8765f2ba7d30e4 100644 --- a/src/tests/Common/CLRTest.Execute.Bash.targets +++ b/src/tests/Common/CLRTest.Execute.Bash.targets @@ -343,6 +343,7 @@ run_with_timeout() { # Start a watchdog that will kill the process if it exceeds timeout ( sleep "$timeout_sec" + echo "Process $pid exceeded timeout of $timeout_sec seconds. Killing..." if kill -0 "$pid" 2>/dev/null; then kill -9 "$pid" 2>/dev/null fi From 2e9b8ebeb944c2f4158af93996b1f8072d4fc7f8 Mon Sep 17 00:00:00 2001 From: Radek Doulik Date: Tue, 17 Feb 2026 12:20:35 +0100 Subject: [PATCH 104/123] Kill the test only if sleep finished --- src/tests/Common/CLRTest.Execute.Bash.targets | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/tests/Common/CLRTest.Execute.Bash.targets b/src/tests/Common/CLRTest.Execute.Bash.targets index 8765f2ba7d30e4..8c3d5ad2d4f5c4 100644 --- a/src/tests/Common/CLRTest.Execute.Bash.targets +++ b/src/tests/Common/CLRTest.Execute.Bash.targets @@ -343,9 +343,11 @@ run_with_timeout() { # Start a watchdog that will kill the process if it exceeds timeout ( sleep "$timeout_sec" - echo "Process $pid exceeded timeout of $timeout_sec seconds. Killing..." - if kill -0 "$pid" 2>/dev/null; then - kill -9 "$pid" 2>/dev/null + if [ $? -eq 0 ]; then + echo "Process $pid exceeded timeout of $timeout_sec seconds. Killing..." + if kill -0 "$pid" 2>/dev/null; then + kill -9 "$pid" 2>/dev/null + fi fi ) & local watchdog=$! @@ -355,6 +357,7 @@ run_with_timeout() { local exit_code=$? # Kill watchdog and its children (sleep process) if still running + echo Kill watchdog with PID $watchdog pkill -P "$watchdog" 2>/dev/null kill "$watchdog" 2>/dev/null wait "$watchdog" 2>/dev/null From 031c0ce5145c01ed443419621fb20eb2a5459f5d Mon Sep 17 00:00:00 2001 From: Radek Doulik Date: Tue, 17 Feb 2026 14:28:31 +0100 Subject: [PATCH 105/123] Revert 4Gb change and active issue --- src/coreclr/hosts/corerun/CMakeLists.txt | 2 +- src/tests/JIT/jit64/regress/vsw/373472/test.il | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/coreclr/hosts/corerun/CMakeLists.txt b/src/coreclr/hosts/corerun/CMakeLists.txt index 11f34130d8d73a..1ff47656b4765a 100644 --- a/src/coreclr/hosts/corerun/CMakeLists.txt +++ b/src/coreclr/hosts/corerun/CMakeLists.txt @@ -78,7 +78,7 @@ else() RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}") target_link_options(corerun PRIVATE -sINITIAL_MEMORY=134217728 - -sMAXIMUM_MEMORY=4294967296 + -sMAXIMUM_MEMORY=2147483648 -sALLOW_MEMORY_GROWTH=1 -sSTACK_SIZE=5MB -sMODULARIZE=1 diff --git a/src/tests/JIT/jit64/regress/vsw/373472/test.il b/src/tests/JIT/jit64/regress/vsw/373472/test.il index 7aee64a4b25f5b..ba70645e623554 100644 --- a/src/tests/JIT/jit64/regress/vsw/373472/test.il +++ b/src/tests/JIT/jit64/regress/vsw/373472/test.il @@ -50,6 +50,11 @@ type([TestLibrary]TestLibrary.PlatformDetection) string[1] ('IsAppleMobile') } + .custom instance void [Microsoft.DotNet.XUnitExtensions]Xunit.ActiveIssueAttribute::.ctor(string, class [mscorlib]System.Type, string[]) = { + string('https://github.com/dotnet/runtime/issues/120708') + type([TestLibrary]TestLibrary.PlatformDetection) + string[1] ('IsWasm') + } .entrypoint // Code size 40 (0x28) .maxstack 2 From 311f50456f7f03fa562fccdf666893bb2a4aa3a0 Mon Sep 17 00:00:00 2001 From: pavelsavara Date: Tue, 17 Feb 2026 15:11:37 +0100 Subject: [PATCH 106/123] more --- .../corehost/browserhost/loader/logging.ts | 16 ++-------------- .../System.Native.Browser/diagnostics/exit.ts | 15 +++++++-------- 2 files changed, 9 insertions(+), 22 deletions(-) diff --git a/src/native/corehost/browserhost/loader/logging.ts b/src/native/corehost/browserhost/loader/logging.ts index 28a1eff25e4927..6e99b87e69f887 100644 --- a/src/native/corehost/browserhost/loader/logging.ts +++ b/src/native/corehost/browserhost/loader/logging.ts @@ -49,11 +49,8 @@ export function error(msg: string, reason: any) { export function normalizeException(reason: any) { let res = "unknown exception"; if (reason) { - const exitStatus = isExitStatus(reason); - if (typeof reason === "object") { - if (reason.stack === undefined && !exitStatus) { - reason.stack = new Error().stack + ""; - } + if (typeof reason === "object" && reason.status === undefined && reason.stack === undefined) { + reason.stack = new Error().stack + ""; } if (reason.message) { res = reason.message; @@ -83,12 +80,3 @@ function symbolicateStackTrace(message: string): string { } return message; } - -function isExitStatus(reason: any): boolean { - if (!dotnetBrowserUtilsExports.getExitStatus) { - return false; - } - const ExitStatus = dotnetBrowserUtilsExports.getExitStatus(); - return ExitStatus && reason instanceof ExitStatus; -} - diff --git a/src/native/libs/System.Native.Browser/diagnostics/exit.ts b/src/native/libs/System.Native.Browser/diagnostics/exit.ts index f18a6a652c14fd..ceb127094f0e94 100644 --- a/src/native/libs/System.Native.Browser/diagnostics/exit.ts +++ b/src/native/libs/System.Native.Browser/diagnostics/exit.ts @@ -55,10 +55,14 @@ function onExit(exitCode: number, reason: any, silent: boolean): boolean { function logExitReason(exitCode: number, reason: any) { if (exitCode !== 0 && reason) { - const exitStatus = isExitStatus(reason); - reason = dotnetLoaderExports.normalizeException(reason); + const hasExitStatus = typeof reason === "object" && reason.status !== undefined; + if (dotnetLoaderExports.normalizeException) { + reason = dotnetLoaderExports.normalizeException(reason); + } else { + reason = reason + ""; + } const msg = "dotnet exited with " + exitCode; - if (exitStatus) { + if (hasExitStatus) { dotnetLogger.debug(msg, reason); } else { dotnetLogger.error(msg, reason); @@ -66,11 +70,6 @@ function logExitReason(exitCode: number, reason: any) { } } -function isExitStatus(reason: any): boolean { - const ExitStatus = dotnetBrowserUtilsExports.getExitStatus(); - return ExitStatus && reason instanceof ExitStatus; -} - function logExitCode(exitCode: number): void { const message = loaderConfig.logExitCode ? "WASM EXIT " + exitCode From 16ce9ae664b4f9048071e282495398dfe357337d Mon Sep 17 00:00:00 2001 From: Radek Doulik Date: Tue, 17 Feb 2026 15:36:28 +0100 Subject: [PATCH 107/123] Add debug print for libs tests failures --- src/coreclr/vm/dllimport.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/coreclr/vm/dllimport.cpp b/src/coreclr/vm/dllimport.cpp index afa5b7a2401458..65fecacbc515b9 100644 --- a/src/coreclr/vm/dllimport.cpp +++ b/src/coreclr/vm/dllimport.cpp @@ -6197,10 +6197,12 @@ EXTERN_C void LookupUnmanagedCallersOnlyMethodByName(const char* fullQualifiedTy && pMD->HasUnmanagedCallersOnlyAttribute()) { *ppMD = pMD; + printf("Found UCO method %s on type %s MD %s::%s\n", methodName, fullQualifiedTypeName, pMD->m_pszDebugClassName, pMD->m_pszDebugMethodName); return; } } + printf("Did not find UCO method %s on type %s, looking for a method with the given name\n", methodName, fullQualifiedTypeName); // Fallback if no UCO match found. *ppMD = MemberLoader::FindMethodByName(pMT, methodName); } From e7d774e7da8e3742d042b460c3a75dce2ea82886 Mon Sep 17 00:00:00 2001 From: Pavel Savara Date: Tue, 17 Feb 2026 15:56:16 +0100 Subject: [PATCH 108/123] Update src/native/corehost/browserhost/loader/polyfills.ts Co-authored-by: campersau --- src/native/corehost/browserhost/loader/polyfills.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/native/corehost/browserhost/loader/polyfills.ts b/src/native/corehost/browserhost/loader/polyfills.ts index f313cc06ffa4d5..feb0ef249f51c5 100644 --- a/src/native/corehost/browserhost/loader/polyfills.ts +++ b/src/native/corehost/browserhost/loader/polyfills.ts @@ -155,7 +155,7 @@ export function responseLike(url: string, body: ArrayBuffer | string | null, opt text: () => { if (typeof body !== "string" && typeof globalThis.TextDecoder !== "undefined") { const decoder = new globalThis.TextDecoder("utf-8"); - return Promise.resolve(body).then(buffer => decoder.decode(buffer || new Uint8Array())); + return decoder.decode(body || new Uint8Array()); } dotnetAssert.check(body !== null && typeof body === "string", "Response body is not a string."); return Promise.resolve(body); From 49281e8bacbecf6be60b658566cee62c56dbeff1 Mon Sep 17 00:00:00 2001 From: Pavel Savara Date: Tue, 17 Feb 2026 16:00:14 +0100 Subject: [PATCH 109/123] Update src/native/corehost/browserhost/loader/assets.ts Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- src/native/corehost/browserhost/loader/assets.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/native/corehost/browserhost/loader/assets.ts b/src/native/corehost/browserhost/loader/assets.ts index ee4afc35ab2c1a..6ea34f64d41720 100644 --- a/src/native/corehost/browserhost/loader/assets.ts +++ b/src/native/corehost/browserhost/loader/assets.ts @@ -355,7 +355,7 @@ const behaviorToContentTypeMap: { [key: string]: string | undefined } = { "icu": "application/octet-stream", "vfs": "application/octet-stream", "manifest": "application/json", - "symbols": "application/text", + "symbols": "text/plain", "dotnetwasm": "application/wasm", }; From 8b91afc4b3df17d78c4859dd4935b824c6dd3283 Mon Sep 17 00:00:00 2001 From: pavelsavara Date: Tue, 17 Feb 2026 16:09:02 +0100 Subject: [PATCH 110/123] feeedback --- src/mono/sample/wasm/Directory.Build.targets | 6 ------ src/native/corehost/browserhost/loader/assets.ts | 4 +++- src/native/corehost/browserhost/loader/logging.ts | 2 +- src/native/libs/System.Native.Browser/diagnostics/exit.ts | 1 - 4 files changed, 4 insertions(+), 9 deletions(-) diff --git a/src/mono/sample/wasm/Directory.Build.targets b/src/mono/sample/wasm/Directory.Build.targets index 23d87d9b063669..f0772311623403 100644 --- a/src/mono/sample/wasm/Directory.Build.targets +++ b/src/mono/sample/wasm/Directory.Build.targets @@ -54,12 +54,6 @@ - - - - - - Date: Tue, 17 Feb 2026 16:29:48 +0100 Subject: [PATCH 111/123] Update src/native/corehost/browserhost/loader/polyfills.ts Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- src/native/corehost/browserhost/loader/polyfills.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/native/corehost/browserhost/loader/polyfills.ts b/src/native/corehost/browserhost/loader/polyfills.ts index feb0ef249f51c5..aebf928b616a9f 100644 --- a/src/native/corehost/browserhost/loader/polyfills.ts +++ b/src/native/corehost/browserhost/loader/polyfills.ts @@ -155,7 +155,7 @@ export function responseLike(url: string, body: ArrayBuffer | string | null, opt text: () => { if (typeof body !== "string" && typeof globalThis.TextDecoder !== "undefined") { const decoder = new globalThis.TextDecoder("utf-8"); - return decoder.decode(body || new Uint8Array()); + return Promise.resolve(decoder.decode(body || new Uint8Array())); } dotnetAssert.check(body !== null && typeof body === "string", "Response body is not a string."); return Promise.resolve(body); From bc44ac1a60723e429894944ea702074fb9ee32d2 Mon Sep 17 00:00:00 2001 From: Pavel Savara Date: Tue, 17 Feb 2026 16:30:03 +0100 Subject: [PATCH 112/123] Update src/native/libs/System.Native.Browser/diagnostics/symbolicate.ts Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- .../libs/System.Native.Browser/diagnostics/symbolicate.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/native/libs/System.Native.Browser/diagnostics/symbolicate.ts b/src/native/libs/System.Native.Browser/diagnostics/symbolicate.ts index f7df178e57eefe..3e4826ce6fa9a5 100644 --- a/src/native/libs/System.Native.Browser/diagnostics/symbolicate.ts +++ b/src/native/libs/System.Native.Browser/diagnostics/symbolicate.ts @@ -3,7 +3,7 @@ const symbol_map = new Map(); let symbolTable: string | undefined; -const regexes: any[] = []; +const regexes: RegExp[] = []; export function installNativeSymbols(table: string) { symbolTable = table; From d0fdadacf1357c41706e1b605f9b0f95966697dd Mon Sep 17 00:00:00 2001 From: Pavel Savara Date: Tue, 17 Feb 2026 16:31:02 +0100 Subject: [PATCH 113/123] Update src/native/libs/System.Native.Browser/diagnostics/symbolicate.ts Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- .../libs/System.Native.Browser/diagnostics/symbolicate.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/native/libs/System.Native.Browser/diagnostics/symbolicate.ts b/src/native/libs/System.Native.Browser/diagnostics/symbolicate.ts index 3e4826ce6fa9a5..00b1f8b078a5af 100644 --- a/src/native/libs/System.Native.Browser/diagnostics/symbolicate.ts +++ b/src/native/libs/System.Native.Browser/diagnostics/symbolicate.ts @@ -13,7 +13,7 @@ export function symbolicateStackTrace(message: string): string { const origMessage = message; initSymbolMap(); - if (symbol_map.size == 0) + if (symbol_map.size === 0) return message; try { From 0836fbe5be85fc816f996414d9b2eb5319dd8ba5 Mon Sep 17 00:00:00 2001 From: Pavel Savara Date: Tue, 17 Feb 2026 17:06:10 +0100 Subject: [PATCH 114/123] Update src/native/corehost/browserhost/loader/logging.ts Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- src/native/corehost/browserhost/loader/logging.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/native/corehost/browserhost/loader/logging.ts b/src/native/corehost/browserhost/loader/logging.ts index 60949f3b1e8535..144c34e5588da6 100644 --- a/src/native/corehost/browserhost/loader/logging.ts +++ b/src/native/corehost/browserhost/loader/logging.ts @@ -2,7 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. import { loaderConfig } from "./config"; -import { dotnetBrowserUtilsExports, dotnetDiagnosticsExports } from "./cross-module"; +import { dotnetDiagnosticsExports } from "./cross-module"; export function check(condition: unknown, message: string): asserts condition { if (!condition) { From 3f59cb3e6af1cebf1a6ca3de37e62c7fd480c07f Mon Sep 17 00:00:00 2001 From: Pavel Savara Date: Tue, 17 Feb 2026 17:06:22 +0100 Subject: [PATCH 115/123] Update src/native/corehost/browserhost/loader/logging.ts Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- src/native/corehost/browserhost/loader/logging.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/native/corehost/browserhost/loader/logging.ts b/src/native/corehost/browserhost/loader/logging.ts index 144c34e5588da6..836534d2e1bedb 100644 --- a/src/native/corehost/browserhost/loader/logging.ts +++ b/src/native/corehost/browserhost/loader/logging.ts @@ -50,7 +50,11 @@ export function normalizeException(reason: any) { let res = "unknown exception"; if (reason) { if (typeof reason === "object" && reason.status === undefined && reason.stack === undefined) { - reason.stack = new Error().stack + ""; + try { + reason.stack = new Error().stack + ""; + } catch { + // Ignore failure to assign stack; continue logging with what we have. + } } if (reason.message) { res = reason.message; From 9b94935413b01562bb2e1b433b8b2807cd40f45d Mon Sep 17 00:00:00 2001 From: Radek Doulik Date: Tue, 17 Feb 2026 15:39:58 +0100 Subject: [PATCH 116/123] Remove old comment --- src/tests/Common/CLRTest.Execute.Batch.targets | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/tests/Common/CLRTest.Execute.Batch.targets b/src/tests/Common/CLRTest.Execute.Batch.targets index baf66ce678b164..4ddb8eeef95559 100644 --- a/src/tests/Common/CLRTest.Execute.Batch.targets +++ b/src/tests/Common/CLRTest.Execute.Batch.targets @@ -339,8 +339,6 @@ IF NOT DEFINED RunWithNodeJS ( ECHO CORE_ROOT: !CORE_ROOT! ECHO ExePath: !__ExePathUnix! ECHO CLRTestExecutionArguments: %CLRTestExecutionArguments% - REM Disable minidump generation for browser tests - REM active issue https://github.com/dotnet/runtime/issues/124088 ECHO Timeout in ms: !__TestTimeout! set "__RunCmd=node "!__CoreRootWin!\corerun.js" -c "!__CoreRootUnix!" "!__ExePathUnix!" %CLRTestExecutionArguments%" From 39ae198eac0068b2c4f0e17a3261265141831146 Mon Sep 17 00:00:00 2001 From: Radek Doulik Date: Tue, 17 Feb 2026 17:10:04 +0100 Subject: [PATCH 117/123] Fix debug print --- src/coreclr/vm/dllimport.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/coreclr/vm/dllimport.cpp b/src/coreclr/vm/dllimport.cpp index 65fecacbc515b9..f0182dcd895ae1 100644 --- a/src/coreclr/vm/dllimport.cpp +++ b/src/coreclr/vm/dllimport.cpp @@ -6197,7 +6197,7 @@ EXTERN_C void LookupUnmanagedCallersOnlyMethodByName(const char* fullQualifiedTy && pMD->HasUnmanagedCallersOnlyAttribute()) { *ppMD = pMD; - printf("Found UCO method %s on type %s MD %s::%s\n", methodName, fullQualifiedTypeName, pMD->m_pszDebugClassName, pMD->m_pszDebugMethodName); + printf("Found UCO method %s on type %s\n", methodName, fullQualifiedTypeName); return; } } From 771f7db5ed19a37e789b4e1cd008fe639db034e6 Mon Sep 17 00:00:00 2001 From: Radek Doulik Date: Tue, 17 Feb 2026 18:29:24 +0100 Subject: [PATCH 118/123] Move prestub out of CallDescrWorkerInternal --- src/coreclr/vm/callhelpers.cpp | 13 +++++++++- src/coreclr/vm/method.hpp | 12 +++++++++ src/coreclr/vm/reflectioninvocation.cpp | 28 +++++++++++++-------- src/coreclr/vm/wasm/calldescrworkerwasm.cpp | 12 +-------- 4 files changed, 43 insertions(+), 22 deletions(-) diff --git a/src/coreclr/vm/callhelpers.cpp b/src/coreclr/vm/callhelpers.cpp index b86aa01cf75ff1..eb1fc9a4789e82 100644 --- a/src/coreclr/vm/callhelpers.cpp +++ b/src/coreclr/vm/callhelpers.cpp @@ -186,10 +186,16 @@ void* DispatchCallSimple( { GC_TRIGGERS; THROWS; - MODE_COOPERATIVE; } CONTRACTL_END; +#ifdef PORTABLE_ENTRYPOINTS + MethodDesc* pMethod = PortableEntryPoint::GetMethodDesc(pTargetAddress); + (void)pMethod->GetInterpreterCodeWithPrestub(); +#endif // PORTABLE_ENTRYPOINTS + + GCX_COOP(); + #ifdef DEBUGGING_SUPPORTED if (CORDebuggerTraceCall()) g_pDebugInterface->TraceCall((const BYTE *)pTargetAddress); @@ -300,6 +306,11 @@ void MethodDescCallSite::CallTargetWorker(const ARG_SLOT *pArguments, ARG_SLOT * } CONTRACTL_END; +#ifdef PORTABLE_ENTRYPOINTS + MethodDesc* pMethod = PortableEntryPoint::GetMethodDesc(m_pCallTarget); + (void)pMethod->GetInterpreterCodeWithPrestub(); +#endif // PORTABLE_ENTRYPOINTS + // If we're invoking an CoreLib method, lift the restriction on type load limits. Calls into CoreLib are // typically calls into specific and controlled helper methods for security checks and other linktime tasks. // diff --git a/src/coreclr/vm/method.hpp b/src/coreclr/vm/method.hpp index abdd36fc0931f8..23a6aebdee6cac 100644 --- a/src/coreclr/vm/method.hpp +++ b/src/coreclr/vm/method.hpp @@ -1878,6 +1878,18 @@ class MethodDesc _ASSERTE(dac_cast(m_interpreterCode) != INTERPRETER_CODE_POISON); VolatileStore(&m_interpreterCode, interpreterCode); } +#ifdef FEATURE_PORTABLE_ENTRYPOINTS + const PTR_InterpByteCodeStart GetInterpreterCodeWithPrestub() + { + InterpByteCodeStart* targetIp = GetInterpreterCode(); + if (targetIp != NULL) + return targetIp; + + GCX_PREEMP(); + (void)DoPrestub(NULL /* MethodTable */, CallerGCMode::Coop); + return GetInterpreterCode(); + } +#endif // FEATURE_PORTABLE_ENTRYPOINTS // Call this if the m_interpreterCode will never be set to a valid value void PoisonInterpreterCode() diff --git a/src/coreclr/vm/reflectioninvocation.cpp b/src/coreclr/vm/reflectioninvocation.cpp index 37343b4fcb9cc2..097d03eb110c07 100644 --- a/src/coreclr/vm/reflectioninvocation.cpp +++ b/src/coreclr/vm/reflectioninvocation.cpp @@ -356,6 +356,24 @@ extern "C" void QCALLTYPE RuntimeMethodHandle_InvokeMethod( COMPlusThrow(kNotSupportedException, W("NotSupported_Type")); } + // This is duplicated logic from MethodDesc::GetCallTarget + PCODE pTarget; + if (pMeth->IsVtableMethod()) + { + pTarget = pMeth->GetSingleCallableAddrOfVirtualizedCode(&gc.target, ownerType); + } + else + { + pTarget = pMeth->GetSingleCallableAddrOfCode(); + } + +#ifdef PORTABLE_ENTRYPOINTS + MethodDesc* pMethod = PortableEntryPoint::GetMethodDesc(pTarget); + (void)pMethod->GetInterpreterCodeWithPrestub(); +#endif // PORTABLE_ENTRYPOINTS + + GCX_COOP(); + #ifdef _DEBUG if (g_pConfig->ShouldInvokeHalt(pMeth)) { @@ -426,16 +444,6 @@ extern "C" void QCALLTYPE RuntimeMethodHandle_InvokeMethod( callDescrData.hasRetBuff = argit.HasRetBuffArg(); #endif // TARGET_WASM - // This is duplicated logic from MethodDesc::GetCallTarget - PCODE pTarget; - if (pMeth->IsVtableMethod()) - { - pTarget = pMeth->GetSingleCallableAddrOfVirtualizedCode(&gc.target, ownerType); - } - else - { - pTarget = pMeth->GetSingleCallableAddrOfCode(); - } callDescrData.pTarget = pTarget; // Build the arguments on the stack diff --git a/src/coreclr/vm/wasm/calldescrworkerwasm.cpp b/src/coreclr/vm/wasm/calldescrworkerwasm.cpp index 5c64790f55b8c2..63a89fed884f42 100644 --- a/src/coreclr/vm/wasm/calldescrworkerwasm.cpp +++ b/src/coreclr/vm/wasm/calldescrworkerwasm.cpp @@ -14,19 +14,9 @@ extern "C" void STDCALL CallDescrWorkerInternal(CallDescrData* pCallDescrData) _ASSERTE(pCallDescrData != NULL); _ASSERTE(pCallDescrData->pTarget != (PCODE)NULL); - // WASM-TODO: This path has a flaw. The DoPrestub call may trigger a GC, and there is no - // explicit protection for the arguments. All platforms assume part of the call is - // a no GC trigger region, but DoPrestub may trigger a GC. Therefore this needs to be - // revisited to ensure correctness. - MethodDesc* pMethod = PortableEntryPoint::GetMethodDesc(pCallDescrData->pTarget); InterpByteCodeStart* targetIp = pMethod->GetInterpreterCode(); - if (targetIp == NULL) - { - GCX_PREEMP(); - (void)pMethod->DoPrestub(NULL /* MethodTable */, CallerGCMode::Coop); - targetIp = pMethod->GetInterpreterCode(); - } + _ASSERTE(targetIp != nullptr); size_t argsSize = pCallDescrData->nArgsSize; void* retBuff; From a069ddf0d56662dc6d293e1b8aab0e2af19c3ddc Mon Sep 17 00:00:00 2001 From: Radek Doulik Date: Wed, 18 Feb 2026 10:35:18 +0100 Subject: [PATCH 119/123] Revert "Move prestub out of CallDescrWorkerInternal" This reverts commit 771f7db5ed19a37e789b4e1cd008fe639db034e6. --- src/coreclr/vm/callhelpers.cpp | 13 +--------- src/coreclr/vm/method.hpp | 12 --------- src/coreclr/vm/reflectioninvocation.cpp | 28 ++++++++------------- src/coreclr/vm/wasm/calldescrworkerwasm.cpp | 12 ++++++++- 4 files changed, 22 insertions(+), 43 deletions(-) diff --git a/src/coreclr/vm/callhelpers.cpp b/src/coreclr/vm/callhelpers.cpp index eb1fc9a4789e82..b86aa01cf75ff1 100644 --- a/src/coreclr/vm/callhelpers.cpp +++ b/src/coreclr/vm/callhelpers.cpp @@ -186,16 +186,10 @@ void* DispatchCallSimple( { GC_TRIGGERS; THROWS; + MODE_COOPERATIVE; } CONTRACTL_END; -#ifdef PORTABLE_ENTRYPOINTS - MethodDesc* pMethod = PortableEntryPoint::GetMethodDesc(pTargetAddress); - (void)pMethod->GetInterpreterCodeWithPrestub(); -#endif // PORTABLE_ENTRYPOINTS - - GCX_COOP(); - #ifdef DEBUGGING_SUPPORTED if (CORDebuggerTraceCall()) g_pDebugInterface->TraceCall((const BYTE *)pTargetAddress); @@ -306,11 +300,6 @@ void MethodDescCallSite::CallTargetWorker(const ARG_SLOT *pArguments, ARG_SLOT * } CONTRACTL_END; -#ifdef PORTABLE_ENTRYPOINTS - MethodDesc* pMethod = PortableEntryPoint::GetMethodDesc(m_pCallTarget); - (void)pMethod->GetInterpreterCodeWithPrestub(); -#endif // PORTABLE_ENTRYPOINTS - // If we're invoking an CoreLib method, lift the restriction on type load limits. Calls into CoreLib are // typically calls into specific and controlled helper methods for security checks and other linktime tasks. // diff --git a/src/coreclr/vm/method.hpp b/src/coreclr/vm/method.hpp index 23a6aebdee6cac..abdd36fc0931f8 100644 --- a/src/coreclr/vm/method.hpp +++ b/src/coreclr/vm/method.hpp @@ -1878,18 +1878,6 @@ class MethodDesc _ASSERTE(dac_cast(m_interpreterCode) != INTERPRETER_CODE_POISON); VolatileStore(&m_interpreterCode, interpreterCode); } -#ifdef FEATURE_PORTABLE_ENTRYPOINTS - const PTR_InterpByteCodeStart GetInterpreterCodeWithPrestub() - { - InterpByteCodeStart* targetIp = GetInterpreterCode(); - if (targetIp != NULL) - return targetIp; - - GCX_PREEMP(); - (void)DoPrestub(NULL /* MethodTable */, CallerGCMode::Coop); - return GetInterpreterCode(); - } -#endif // FEATURE_PORTABLE_ENTRYPOINTS // Call this if the m_interpreterCode will never be set to a valid value void PoisonInterpreterCode() diff --git a/src/coreclr/vm/reflectioninvocation.cpp b/src/coreclr/vm/reflectioninvocation.cpp index 097d03eb110c07..37343b4fcb9cc2 100644 --- a/src/coreclr/vm/reflectioninvocation.cpp +++ b/src/coreclr/vm/reflectioninvocation.cpp @@ -356,24 +356,6 @@ extern "C" void QCALLTYPE RuntimeMethodHandle_InvokeMethod( COMPlusThrow(kNotSupportedException, W("NotSupported_Type")); } - // This is duplicated logic from MethodDesc::GetCallTarget - PCODE pTarget; - if (pMeth->IsVtableMethod()) - { - pTarget = pMeth->GetSingleCallableAddrOfVirtualizedCode(&gc.target, ownerType); - } - else - { - pTarget = pMeth->GetSingleCallableAddrOfCode(); - } - -#ifdef PORTABLE_ENTRYPOINTS - MethodDesc* pMethod = PortableEntryPoint::GetMethodDesc(pTarget); - (void)pMethod->GetInterpreterCodeWithPrestub(); -#endif // PORTABLE_ENTRYPOINTS - - GCX_COOP(); - #ifdef _DEBUG if (g_pConfig->ShouldInvokeHalt(pMeth)) { @@ -444,6 +426,16 @@ extern "C" void QCALLTYPE RuntimeMethodHandle_InvokeMethod( callDescrData.hasRetBuff = argit.HasRetBuffArg(); #endif // TARGET_WASM + // This is duplicated logic from MethodDesc::GetCallTarget + PCODE pTarget; + if (pMeth->IsVtableMethod()) + { + pTarget = pMeth->GetSingleCallableAddrOfVirtualizedCode(&gc.target, ownerType); + } + else + { + pTarget = pMeth->GetSingleCallableAddrOfCode(); + } callDescrData.pTarget = pTarget; // Build the arguments on the stack diff --git a/src/coreclr/vm/wasm/calldescrworkerwasm.cpp b/src/coreclr/vm/wasm/calldescrworkerwasm.cpp index 63a89fed884f42..5c64790f55b8c2 100644 --- a/src/coreclr/vm/wasm/calldescrworkerwasm.cpp +++ b/src/coreclr/vm/wasm/calldescrworkerwasm.cpp @@ -14,9 +14,19 @@ extern "C" void STDCALL CallDescrWorkerInternal(CallDescrData* pCallDescrData) _ASSERTE(pCallDescrData != NULL); _ASSERTE(pCallDescrData->pTarget != (PCODE)NULL); + // WASM-TODO: This path has a flaw. The DoPrestub call may trigger a GC, and there is no + // explicit protection for the arguments. All platforms assume part of the call is + // a no GC trigger region, but DoPrestub may trigger a GC. Therefore this needs to be + // revisited to ensure correctness. + MethodDesc* pMethod = PortableEntryPoint::GetMethodDesc(pCallDescrData->pTarget); InterpByteCodeStart* targetIp = pMethod->GetInterpreterCode(); - _ASSERTE(targetIp != nullptr); + if (targetIp == NULL) + { + GCX_PREEMP(); + (void)pMethod->DoPrestub(NULL /* MethodTable */, CallerGCMode::Coop); + targetIp = pMethod->GetInterpreterCode(); + } size_t argsSize = pCallDescrData->nArgsSize; void* retBuff; From bb17c169547561dc7b7d6257e5ce1b35d01a113d Mon Sep 17 00:00:00 2001 From: Radek Doulik Date: Tue, 17 Feb 2026 18:29:24 +0100 Subject: [PATCH 120/123] Move prestub out of CallDescrWorkerInternal --- src/coreclr/vm/callhelpers.cpp | 10 ++++++++ src/coreclr/vm/method.hpp | 12 ++++++++++ src/coreclr/vm/reflectioninvocation.cpp | 26 +++++++++++++-------- src/coreclr/vm/wasm/calldescrworkerwasm.cpp | 12 +--------- 4 files changed, 39 insertions(+), 21 deletions(-) diff --git a/src/coreclr/vm/callhelpers.cpp b/src/coreclr/vm/callhelpers.cpp index b86aa01cf75ff1..75c95bb1b8ca5f 100644 --- a/src/coreclr/vm/callhelpers.cpp +++ b/src/coreclr/vm/callhelpers.cpp @@ -190,6 +190,11 @@ void* DispatchCallSimple( } CONTRACTL_END; +#ifdef PORTABLE_ENTRYPOINTS + MethodDesc* pMethod = PortableEntryPoint::GetMethodDesc(pTargetAddress); + (void)pMethod->GetInterpreterCodeWithPrestub(); +#endif // PORTABLE_ENTRYPOINTS + #ifdef DEBUGGING_SUPPORTED if (CORDebuggerTraceCall()) g_pDebugInterface->TraceCall((const BYTE *)pTargetAddress); @@ -300,6 +305,11 @@ void MethodDescCallSite::CallTargetWorker(const ARG_SLOT *pArguments, ARG_SLOT * } CONTRACTL_END; +#ifdef PORTABLE_ENTRYPOINTS + MethodDesc* pMethod = PortableEntryPoint::GetMethodDesc(m_pCallTarget); + (void)pMethod->GetInterpreterCodeWithPrestub(); +#endif // PORTABLE_ENTRYPOINTS + // If we're invoking an CoreLib method, lift the restriction on type load limits. Calls into CoreLib are // typically calls into specific and controlled helper methods for security checks and other linktime tasks. // diff --git a/src/coreclr/vm/method.hpp b/src/coreclr/vm/method.hpp index abdd36fc0931f8..23a6aebdee6cac 100644 --- a/src/coreclr/vm/method.hpp +++ b/src/coreclr/vm/method.hpp @@ -1878,6 +1878,18 @@ class MethodDesc _ASSERTE(dac_cast(m_interpreterCode) != INTERPRETER_CODE_POISON); VolatileStore(&m_interpreterCode, interpreterCode); } +#ifdef FEATURE_PORTABLE_ENTRYPOINTS + const PTR_InterpByteCodeStart GetInterpreterCodeWithPrestub() + { + InterpByteCodeStart* targetIp = GetInterpreterCode(); + if (targetIp != NULL) + return targetIp; + + GCX_PREEMP(); + (void)DoPrestub(NULL /* MethodTable */, CallerGCMode::Coop); + return GetInterpreterCode(); + } +#endif // FEATURE_PORTABLE_ENTRYPOINTS // Call this if the m_interpreterCode will never be set to a valid value void PoisonInterpreterCode() diff --git a/src/coreclr/vm/reflectioninvocation.cpp b/src/coreclr/vm/reflectioninvocation.cpp index 37343b4fcb9cc2..31d9c4db1c5c38 100644 --- a/src/coreclr/vm/reflectioninvocation.cpp +++ b/src/coreclr/vm/reflectioninvocation.cpp @@ -356,6 +356,22 @@ extern "C" void QCALLTYPE RuntimeMethodHandle_InvokeMethod( COMPlusThrow(kNotSupportedException, W("NotSupported_Type")); } + // This is duplicated logic from MethodDesc::GetCallTarget + PCODE pTarget; + if (pMeth->IsVtableMethod()) + { + pTarget = pMeth->GetSingleCallableAddrOfVirtualizedCode(&gc.target, ownerType); + } + else + { + pTarget = pMeth->GetSingleCallableAddrOfCode(); + } + +#ifdef PORTABLE_ENTRYPOINTS + MethodDesc* pMethod = PortableEntryPoint::GetMethodDesc(pTarget); + (void)pMethod->GetInterpreterCodeWithPrestub(); +#endif // PORTABLE_ENTRYPOINTS + #ifdef _DEBUG if (g_pConfig->ShouldInvokeHalt(pMeth)) { @@ -426,16 +442,6 @@ extern "C" void QCALLTYPE RuntimeMethodHandle_InvokeMethod( callDescrData.hasRetBuff = argit.HasRetBuffArg(); #endif // TARGET_WASM - // This is duplicated logic from MethodDesc::GetCallTarget - PCODE pTarget; - if (pMeth->IsVtableMethod()) - { - pTarget = pMeth->GetSingleCallableAddrOfVirtualizedCode(&gc.target, ownerType); - } - else - { - pTarget = pMeth->GetSingleCallableAddrOfCode(); - } callDescrData.pTarget = pTarget; // Build the arguments on the stack diff --git a/src/coreclr/vm/wasm/calldescrworkerwasm.cpp b/src/coreclr/vm/wasm/calldescrworkerwasm.cpp index 5c64790f55b8c2..63a89fed884f42 100644 --- a/src/coreclr/vm/wasm/calldescrworkerwasm.cpp +++ b/src/coreclr/vm/wasm/calldescrworkerwasm.cpp @@ -14,19 +14,9 @@ extern "C" void STDCALL CallDescrWorkerInternal(CallDescrData* pCallDescrData) _ASSERTE(pCallDescrData != NULL); _ASSERTE(pCallDescrData->pTarget != (PCODE)NULL); - // WASM-TODO: This path has a flaw. The DoPrestub call may trigger a GC, and there is no - // explicit protection for the arguments. All platforms assume part of the call is - // a no GC trigger region, but DoPrestub may trigger a GC. Therefore this needs to be - // revisited to ensure correctness. - MethodDesc* pMethod = PortableEntryPoint::GetMethodDesc(pCallDescrData->pTarget); InterpByteCodeStart* targetIp = pMethod->GetInterpreterCode(); - if (targetIp == NULL) - { - GCX_PREEMP(); - (void)pMethod->DoPrestub(NULL /* MethodTable */, CallerGCMode::Coop); - targetIp = pMethod->GetInterpreterCode(); - } + _ASSERTE(targetIp != nullptr); size_t argsSize = pCallDescrData->nArgsSize; void* retBuff; From fa70e3f1d4ab14498ec7518fac6c051625891b9b Mon Sep 17 00:00:00 2001 From: Radek Doulik Date: Wed, 18 Feb 2026 12:53:52 +0100 Subject: [PATCH 121/123] Fix ifdefs --- src/coreclr/vm/callhelpers.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/coreclr/vm/callhelpers.cpp b/src/coreclr/vm/callhelpers.cpp index 75c95bb1b8ca5f..291f0a94f74773 100644 --- a/src/coreclr/vm/callhelpers.cpp +++ b/src/coreclr/vm/callhelpers.cpp @@ -190,10 +190,10 @@ void* DispatchCallSimple( } CONTRACTL_END; -#ifdef PORTABLE_ENTRYPOINTS +#ifdef FEATURE_PORTABLE_ENTRYPOINTS MethodDesc* pMethod = PortableEntryPoint::GetMethodDesc(pTargetAddress); (void)pMethod->GetInterpreterCodeWithPrestub(); -#endif // PORTABLE_ENTRYPOINTS +#endif // FEATURE_PORTABLE_ENTRYPOINTS #ifdef DEBUGGING_SUPPORTED if (CORDebuggerTraceCall()) @@ -305,10 +305,10 @@ void MethodDescCallSite::CallTargetWorker(const ARG_SLOT *pArguments, ARG_SLOT * } CONTRACTL_END; -#ifdef PORTABLE_ENTRYPOINTS +#ifdef FEATURE_PORTABLE_ENTRYPOINTS MethodDesc* pMethod = PortableEntryPoint::GetMethodDesc(m_pCallTarget); (void)pMethod->GetInterpreterCodeWithPrestub(); -#endif // PORTABLE_ENTRYPOINTS +#endif // FEATURE_PORTABLE_ENTRYPOINTS // If we're invoking an CoreLib method, lift the restriction on type load limits. Calls into CoreLib are // typically calls into specific and controlled helper methods for security checks and other linktime tasks. From 9f1649a9eefb2ede3c7980126df6c6fda6599e8e Mon Sep 17 00:00:00 2001 From: Radek Doulik Date: Wed, 18 Feb 2026 13:51:39 +0100 Subject: [PATCH 122/123] Revert "Fix ifdefs" This reverts commit fa70e3f1d4ab14498ec7518fac6c051625891b9b. --- src/coreclr/vm/callhelpers.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/coreclr/vm/callhelpers.cpp b/src/coreclr/vm/callhelpers.cpp index 291f0a94f74773..75c95bb1b8ca5f 100644 --- a/src/coreclr/vm/callhelpers.cpp +++ b/src/coreclr/vm/callhelpers.cpp @@ -190,10 +190,10 @@ void* DispatchCallSimple( } CONTRACTL_END; -#ifdef FEATURE_PORTABLE_ENTRYPOINTS +#ifdef PORTABLE_ENTRYPOINTS MethodDesc* pMethod = PortableEntryPoint::GetMethodDesc(pTargetAddress); (void)pMethod->GetInterpreterCodeWithPrestub(); -#endif // FEATURE_PORTABLE_ENTRYPOINTS +#endif // PORTABLE_ENTRYPOINTS #ifdef DEBUGGING_SUPPORTED if (CORDebuggerTraceCall()) @@ -305,10 +305,10 @@ void MethodDescCallSite::CallTargetWorker(const ARG_SLOT *pArguments, ARG_SLOT * } CONTRACTL_END; -#ifdef FEATURE_PORTABLE_ENTRYPOINTS +#ifdef PORTABLE_ENTRYPOINTS MethodDesc* pMethod = PortableEntryPoint::GetMethodDesc(m_pCallTarget); (void)pMethod->GetInterpreterCodeWithPrestub(); -#endif // FEATURE_PORTABLE_ENTRYPOINTS +#endif // PORTABLE_ENTRYPOINTS // If we're invoking an CoreLib method, lift the restriction on type load limits. Calls into CoreLib are // typically calls into specific and controlled helper methods for security checks and other linktime tasks. From 6633d8db06e0137dd60cbb9dff25d4b72317e8d1 Mon Sep 17 00:00:00 2001 From: Radek Doulik Date: Wed, 18 Feb 2026 13:51:54 +0100 Subject: [PATCH 123/123] Revert "Move prestub out of CallDescrWorkerInternal" This reverts commit bb17c169547561dc7b7d6257e5ce1b35d01a113d. --- src/coreclr/vm/callhelpers.cpp | 10 -------- src/coreclr/vm/method.hpp | 12 ---------- src/coreclr/vm/reflectioninvocation.cpp | 26 ++++++++------------- src/coreclr/vm/wasm/calldescrworkerwasm.cpp | 12 +++++++++- 4 files changed, 21 insertions(+), 39 deletions(-) diff --git a/src/coreclr/vm/callhelpers.cpp b/src/coreclr/vm/callhelpers.cpp index 75c95bb1b8ca5f..b86aa01cf75ff1 100644 --- a/src/coreclr/vm/callhelpers.cpp +++ b/src/coreclr/vm/callhelpers.cpp @@ -190,11 +190,6 @@ void* DispatchCallSimple( } CONTRACTL_END; -#ifdef PORTABLE_ENTRYPOINTS - MethodDesc* pMethod = PortableEntryPoint::GetMethodDesc(pTargetAddress); - (void)pMethod->GetInterpreterCodeWithPrestub(); -#endif // PORTABLE_ENTRYPOINTS - #ifdef DEBUGGING_SUPPORTED if (CORDebuggerTraceCall()) g_pDebugInterface->TraceCall((const BYTE *)pTargetAddress); @@ -305,11 +300,6 @@ void MethodDescCallSite::CallTargetWorker(const ARG_SLOT *pArguments, ARG_SLOT * } CONTRACTL_END; -#ifdef PORTABLE_ENTRYPOINTS - MethodDesc* pMethod = PortableEntryPoint::GetMethodDesc(m_pCallTarget); - (void)pMethod->GetInterpreterCodeWithPrestub(); -#endif // PORTABLE_ENTRYPOINTS - // If we're invoking an CoreLib method, lift the restriction on type load limits. Calls into CoreLib are // typically calls into specific and controlled helper methods for security checks and other linktime tasks. // diff --git a/src/coreclr/vm/method.hpp b/src/coreclr/vm/method.hpp index 23a6aebdee6cac..abdd36fc0931f8 100644 --- a/src/coreclr/vm/method.hpp +++ b/src/coreclr/vm/method.hpp @@ -1878,18 +1878,6 @@ class MethodDesc _ASSERTE(dac_cast(m_interpreterCode) != INTERPRETER_CODE_POISON); VolatileStore(&m_interpreterCode, interpreterCode); } -#ifdef FEATURE_PORTABLE_ENTRYPOINTS - const PTR_InterpByteCodeStart GetInterpreterCodeWithPrestub() - { - InterpByteCodeStart* targetIp = GetInterpreterCode(); - if (targetIp != NULL) - return targetIp; - - GCX_PREEMP(); - (void)DoPrestub(NULL /* MethodTable */, CallerGCMode::Coop); - return GetInterpreterCode(); - } -#endif // FEATURE_PORTABLE_ENTRYPOINTS // Call this if the m_interpreterCode will never be set to a valid value void PoisonInterpreterCode() diff --git a/src/coreclr/vm/reflectioninvocation.cpp b/src/coreclr/vm/reflectioninvocation.cpp index 31d9c4db1c5c38..37343b4fcb9cc2 100644 --- a/src/coreclr/vm/reflectioninvocation.cpp +++ b/src/coreclr/vm/reflectioninvocation.cpp @@ -356,22 +356,6 @@ extern "C" void QCALLTYPE RuntimeMethodHandle_InvokeMethod( COMPlusThrow(kNotSupportedException, W("NotSupported_Type")); } - // This is duplicated logic from MethodDesc::GetCallTarget - PCODE pTarget; - if (pMeth->IsVtableMethod()) - { - pTarget = pMeth->GetSingleCallableAddrOfVirtualizedCode(&gc.target, ownerType); - } - else - { - pTarget = pMeth->GetSingleCallableAddrOfCode(); - } - -#ifdef PORTABLE_ENTRYPOINTS - MethodDesc* pMethod = PortableEntryPoint::GetMethodDesc(pTarget); - (void)pMethod->GetInterpreterCodeWithPrestub(); -#endif // PORTABLE_ENTRYPOINTS - #ifdef _DEBUG if (g_pConfig->ShouldInvokeHalt(pMeth)) { @@ -442,6 +426,16 @@ extern "C" void QCALLTYPE RuntimeMethodHandle_InvokeMethod( callDescrData.hasRetBuff = argit.HasRetBuffArg(); #endif // TARGET_WASM + // This is duplicated logic from MethodDesc::GetCallTarget + PCODE pTarget; + if (pMeth->IsVtableMethod()) + { + pTarget = pMeth->GetSingleCallableAddrOfVirtualizedCode(&gc.target, ownerType); + } + else + { + pTarget = pMeth->GetSingleCallableAddrOfCode(); + } callDescrData.pTarget = pTarget; // Build the arguments on the stack diff --git a/src/coreclr/vm/wasm/calldescrworkerwasm.cpp b/src/coreclr/vm/wasm/calldescrworkerwasm.cpp index 63a89fed884f42..5c64790f55b8c2 100644 --- a/src/coreclr/vm/wasm/calldescrworkerwasm.cpp +++ b/src/coreclr/vm/wasm/calldescrworkerwasm.cpp @@ -14,9 +14,19 @@ extern "C" void STDCALL CallDescrWorkerInternal(CallDescrData* pCallDescrData) _ASSERTE(pCallDescrData != NULL); _ASSERTE(pCallDescrData->pTarget != (PCODE)NULL); + // WASM-TODO: This path has a flaw. The DoPrestub call may trigger a GC, and there is no + // explicit protection for the arguments. All platforms assume part of the call is + // a no GC trigger region, but DoPrestub may trigger a GC. Therefore this needs to be + // revisited to ensure correctness. + MethodDesc* pMethod = PortableEntryPoint::GetMethodDesc(pCallDescrData->pTarget); InterpByteCodeStart* targetIp = pMethod->GetInterpreterCode(); - _ASSERTE(targetIp != nullptr); + if (targetIp == NULL) + { + GCX_PREEMP(); + (void)pMethod->DoPrestub(NULL /* MethodTable */, CallerGCMode::Coop); + targetIp = pMethod->GetInterpreterCode(); + } size_t argsSize = pCallDescrData->nArgsSize; void* retBuff;