Skip to content
Merged
Show file tree
Hide file tree
Changes from 20 commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
d114103
rebase
pavelsavara Oct 22, 2025
4f633d3
wip
pavelsavara Oct 22, 2025
27daa57
cleanup
pavelsavara Oct 22, 2025
775afc3
cleanup
pavelsavara Oct 22, 2025
53facd5
Update src/coreclr/vm/qcallentrypoints.cpp
pavelsavara Oct 23, 2025
58b16dd
Update src/coreclr/vm/qcallentrypoints.cpp
pavelsavara Oct 23, 2025
3f36576
Update src/coreclr/vm/assembly.cpp
pavelsavara Oct 23, 2025
f76d16c
Update src/coreclr/vm/assembly.cpp
pavelsavara Oct 23, 2025
c03375c
Update src/coreclr/vm/assembly.cpp
pavelsavara Oct 23, 2025
cfd23db
Update src/coreclr/vm/assembly.cpp
pavelsavara Oct 23, 2025
e823885
Update src/coreclr/vm/qcallentrypoints.cpp
pavelsavara Oct 23, 2025
72fa2de
Update src/coreclr/vm/wasm/helpers.cpp
pavelsavara Oct 23, 2025
f533328
Update src/coreclr/vm/wasm/helpers.cpp
pavelsavara Oct 23, 2025
7e95e6d
Update src/coreclr/vm/assembly.cpp
pavelsavara Oct 23, 2025
cebd055
Update src/coreclr/vm/assembly.cpp
pavelsavara Oct 23, 2025
66f38f2
Update src/coreclr/vm/assembly.cpp
pavelsavara Oct 23, 2025
7586670
Update src/coreclr/vm/assembly.cpp
pavelsavara Oct 23, 2025
bad0ec9
Update src/coreclr/vm/assembly.cpp
pavelsavara Oct 23, 2025
748dcc3
Update src/coreclr/vm/assembly.cpp
pavelsavara Oct 23, 2025
7803d72
feedback
pavelsavara Oct 23, 2025
e3e48c5
Merge branch 'main' into browser_async_main
pavelsavara Oct 24, 2025
063a40c
wip
pavelsavara Oct 24, 2025
f6ce84a
Merge branch 'main' into browser_async_main
pavelsavara Oct 27, 2025
d20157a
feedback
pavelsavara Oct 27, 2025
f210f97
propagate exit code and exception for corerun
pavelsavara Oct 27, 2025
a3a4cd4
Merge branch 'main' into browser_async_main
pavelsavara Oct 27, 2025
2bcffb1
fix browserhost
pavelsavara Oct 27, 2025
409c2f1
fix
pavelsavara Oct 27, 2025
d85edbc
fix
pavelsavara Oct 27, 2025
e0e16a5
Update src/native/corehost/browserhost/host/host.ts
pavelsavara Oct 27, 2025
0af8464
Update src/native/libs/System.Native.Browser/utils/strings.ts
pavelsavara Oct 27, 2025
38c6ead
feedback
pavelsavara Oct 27, 2025
2ad67c9
cleanup
pavelsavara Oct 27, 2025
f439d0c
Merge branch 'main' into browser_async_main
pavelsavara Oct 29, 2025
1c23039
implement https://github.com/dotnet/runtime/issues/121046
pavelsavara Oct 29, 2025
2f62f04
Update src/libraries/System.Private.CoreLib/src/System/Runtime/Compil…
pavelsavara Oct 29, 2025
e62473b
feedback
pavelsavara Oct 29, 2025
6730a82
Update src/coreclr/vm/assembly.cpp
pavelsavara Oct 30, 2025
9565dbb
feedback
pavelsavara Oct 30, 2025
9ed35b1
Merge branch 'main' into browser_async_main
pavelsavara Oct 30, 2025
55a5f6e
fix
pavelsavara Oct 30, 2025
8383b8a
feedback
pavelsavara Oct 31, 2025
6795541
Merge branch 'main' into browser_async_main
pavelsavara Oct 31, 2025
f54121f
GCPROTECT_BEGIN
pavelsavara Nov 3, 2025
8e748fd
Merge branch 'main' into browser_async_main
pavelsavara Nov 3, 2025
cae9ae9
Update src/libraries/System.Private.CoreLib/src/System/Runtime/Compil…
pavelsavara Nov 3, 2025
efd3396
Update src/libraries/System.Private.CoreLib/src/System/Runtime/Compil…
pavelsavara Nov 3, 2025
8cf4102
Update src/libraries/System.Private.CoreLib/src/System/Runtime/Compil…
pavelsavara Nov 3, 2025
ab944ff
Update src/coreclr/vm/assembly.cpp
pavelsavara Nov 3, 2025
6ae68d6
Update src/coreclr/vm/assembly.cpp
pavelsavara Nov 3, 2025
ff4dbe0
doc feedback
pavelsavara Nov 3, 2025
0a423d0
Merge branch 'main' into browser_async_main
pavelsavara Nov 3, 2025
78bdb31
Update src/coreclr/vm/assembly.cpp
pavelsavara Nov 4, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions docs/workflow/building/coreclr/wasm.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,9 @@ In config below please replace `/path/to/runtime/` by a **absolute unix path** t
"env": {
"CORE_ROOT":"/path/to/runtime/artifacts/bin/coreclr/browser.wasm.Debug/IL/"
},
"runtimeArgs": [
"--stack-trace-limit=1000"
],
"args": [
"/path/to/runtime/artifacts/bin/coreclr/browser.wasm.Debug/IL/helloworld.dll"
],
Expand All @@ -140,6 +143,9 @@ In config below please replace `/path/to/runtime/` by a **absolute unix path** t
"skipFiles": [
"<node_internals>/**"
],
"runtimeArgs": [
"--stack-trace-limit=1000"
],
"args": [
"HelloWorld.dll"
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@
<Compile Include="$(BclSourcesRoot)\System\Runtime\CompilerServices\GenericsHelpers.cs" />
<Compile Include="$(BclSourcesRoot)\System\Runtime\CompilerServices\InitHelpers.cs" />
<Compile Include="$(BclSourcesRoot)\System\Runtime\CompilerServices\AsyncHelpers.CoreCLR.cs" />
<Compile Include="$(BclSourcesRoot)\System\Runtime\CompilerServices\AsyncHelpers.Browser.cs" Condition="'$(TargetsBrowser)' == 'true'" />
<Compile Include="$(BclSourcesRoot)\System\Runtime\CompilerServices\RuntimeHelpers.CoreCLR.cs" />
<Compile Include="$(BclSourcesRoot)\System\Runtime\CompilerServices\StaticsHelpers.cs" />
<Compile Include="$(BclSourcesRoot)\System\Runtime\CompilerServices\VirtualDispatchHelpers.cs" />
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

using System.Diagnostics.CodeAnalysis;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Threading.Tasks;

namespace System.Runtime.CompilerServices
{
public static partial class AsyncHelpers
{
[DynamicDependency(nameof(MainWrapper))]
[DynamicDependency(nameof(MainWrapperVoid))]
static AsyncHelpers()
{
}

private static void MainWrapper(object exitCodeTask)
{
var task = (Task<int>)exitCodeTask;
task.ContinueWith(t =>
{
if (t.IsFaulted)
{
SystemJS_RejectMainPromise(t.Exception.Message);
}
else
{
SystemJS_ResolveMainPromise(t.Result);
}
}, TaskScheduler.Default);
}

private static void MainWrapperVoid(object exitCodeTask)
{
var task = (Task)exitCodeTask;
task.ContinueWith(t =>
{
if (t.IsFaulted)
{
SystemJS_RejectMainPromise(t.Exception.Message);
}
else
{
SystemJS_ResolveMainPromise(0);
}
}, TaskScheduler.Default);
}

[LibraryImport(RuntimeHelpers.QCall)]
private static unsafe partial void SystemJS_RejectMainPromise([MarshalAs(UnmanagedType.LPWStr)] string pMessage);

[LibraryImport(RuntimeHelpers.QCall)]
private static partial void SystemJS_ResolveMainPromise(int exitCode);
}
}
3 changes: 2 additions & 1 deletion src/coreclr/hosts/corerun/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,12 @@ else()
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}")
target_link_options(corerun PRIVATE
-fwasm-exceptions
-sEXIT_RUNTIME=1
-sEXIT_RUNTIME=0
-sINITIAL_MEMORY=134217728
-sMAXIMUM_MEMORY=2147483648
-sALLOW_MEMORY_GROWTH=1
-sSTACK_SIZE=5MB
-sEXPORTED_RUNTIME_METHODS=UTF8ToString,cwrap,ccall,HEAPU8,HEAPU32,HEAPU64,safeSetTimeout,maybeExit
-sEXPORTED_FUNCTIONS=_main,_GetDotNetRuntimeContractDescriptor
-sENVIRONMENT=node,shell,web
-Wl,-error-limit=0)
Expand Down
5 changes: 5 additions & 0 deletions src/coreclr/hosts/corerun/corerun.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -539,6 +539,7 @@ static int run(const configuration& config)
actions.after_execute_assembly();
}

#if !defined(TARGET_BROWSER)
int latched_exit_code = 0;
result = coreclr_shutdown2_func(CurrentClrInstance, CurrentAppDomainId, &latched_exit_code);
if (FAILED(result))
Expand All @@ -553,6 +554,10 @@ static int run(const configuration& config)
::free((void*)s_core_libs_path);
::free((void*)s_core_root_path);
return exit_code;
#else // TARGET_BROWSER
// In browser we don't shutdown the runtime here as we want to keep it alive
return 0;
#endif // TARGET_BROWSER
}

// Display the command line options
Expand Down
3 changes: 3 additions & 0 deletions src/coreclr/vm/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -921,6 +921,9 @@ elseif(CLR_CMAKE_TARGET_ARCH_RISCV64)
gcinfodecoder.cpp
)
elseif(CLR_CMAKE_TARGET_ARCH_WASM)
set(VM_HEADERS_WKS_ARCH_ASM
${ARCH_SOURCES_DIR}/entrypoints.h
)
set(VM_SOURCES_WKS_ARCH
${ARCH_SOURCES_DIR}/calldescrworkerwasm.cpp
${ARCH_SOURCES_DIR}/profiler.cpp
Expand Down
Loading