Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 001b01c

Browse files
committed
Merge branch 'alloc-stack-naot' of github.com:EgorBo/runtime-1 into alloc-stack-naot
2 parents 1ef6ccf + 203593c commit 001b01c

File tree

134 files changed

+6469
-3468
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

134 files changed

+6469
-3468
lines changed

eng/docker/libraries-sdk.linux.Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ FROM $SDK_BASE_IMAGE as target
1414

1515
ARG VERSION=9.0
1616
ARG CONFIGURATION=Release
17-
ENV _DOTNET_INSTALL_CHANNEL="$VERSION.1xx"
17+
ENV _DOTNET_INSTALL_CHANNEL=$VERSION
1818

1919
# Install latest daily SDK:
2020
RUN wget https://dot.net/v1/dotnet-install.sh
@@ -52,4 +52,4 @@ COPY --from=corefxbuild \
5252
ENV _ASPNETCORE_SOURCE="/usr/share/dotnet/shared/Microsoft.AspNetCore.App/$VERSION*"
5353
ENV _ASPNETCORE_DEST="/live-runtime-artifacts/testhost/net$VERSION-linux-$CONFIGURATION-x64/shared/Microsoft.AspNetCore.App"
5454
RUN mkdir -p $_ASPNETCORE_DEST
55-
RUN cp -r $_ASPNETCORE_SOURCE $_ASPNETCORE_DEST
55+
RUN cp -r $_ASPNETCORE_SOURCE $_ASPNETCORE_DEST

eng/docker/libraries-sdk.windows.Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ FROM $SDK_BASE_IMAGE as target
66
SHELL ["pwsh", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]
77

88
ARG VERSION=9.0
9-
ENV _DOTNET_INSTALL_CHANNEL="$VERSION.1xx"
9+
ENV _DOTNET_INSTALL_CHANNEL=$VERSION
1010
ARG CONFIGURATION=Release
1111

1212
USER ContainerAdministrator
@@ -22,4 +22,4 @@ COPY . /live-runtime-artifacts
2222
ENV _ASPNETCORE_SOURCE="C:/Program Files/dotnet/shared/Microsoft.AspNetCore.App/$VERSION*"
2323
ENV _ASPNETCORE_DEST="C:/live-runtime-artifacts/testhost/net$VERSION-windows-$CONFIGURATION-x64/shared/Microsoft.AspNetCore.App"
2424
RUN & New-Item -ItemType Directory -Path $env:_ASPNETCORE_DEST
25-
RUN Copy-Item -Recurse -Path $env:_ASPNETCORE_SOURCE -Destination $env:_ASPNETCORE_DEST
25+
RUN Copy-Item -Recurse -Path $env:_ASPNETCORE_SOURCE -Destination $env:_ASPNETCORE_DEST

eng/native/gen-buildsys.cmd

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,19 +61,20 @@ if /i "%__Arch%" == "wasm" (
6161
)
6262
if /i "%__Os%" == "wasi" (
6363
set "__repoRoot=!__repoRoot:\=/!"
64-
if "%WASI_SDK22_PATH%" == "" (
64+
if not "!__repoRoot:~-1!" == "/" set "__repoRoot=!__repoRoot!/"
65+
if "%WASI_SDK_PATH%" == "" (
6566
if not exist "%__repoRoot%\src\mono\wasi\wasi-sdk" (
66-
echo Error: Should set WASI_SDK22_PATH environment variable pointing to WASI SDK root.
67+
echo Error: Should set WASI_SDK_PATH environment variable pointing to WASI SDK root.
6768
exit /B 1
6869
)
6970

70-
set "WASI_SDK22_PATH=%__repoRoot%\src\mono\wasi\wasi-sdk"
71+
set "WASI_SDK_PATH=%__repoRoot%\src\mono\wasi\wasi-sdk"
7172
)
7273
:: replace backslash with forward slash and append last slash
73-
set "WASI_SDK22_PATH=!WASI_SDK22_PATH:\=/!"
74-
if not "!WASI_SDK22_PATH:~-1!" == "/" set "WASI_SDK22_PATH=!WASI_SDK22_PATH!/"
74+
set "WASI_SDK_PATH=!WASI_SDK_PATH:\=/!"
75+
if not "!WASI_SDK_PATH:~-1!" == "/" set "WASI_SDK_PATH=!WASI_SDK_PATH!/"
7576
set __CmakeGenerator=Ninja
76-
set __ExtraCmakeParams=%__ExtraCmakeParams% -DCLR_CMAKE_TARGET_OS=wasi -DCLR_CMAKE_TARGET_ARCH=wasm "-DWASI_SDK_PREFIX=!WASI_SDK22_PATH!" "-DCMAKE_TOOLCHAIN_FILE=!WASI_SDK22_PATH!share/cmake/wasi-sdk.cmake" "-DCMAKE_SYSROOT=!WASI_SDK22_PATH!share/wasi-sysroot"
77+
set __ExtraCmakeParams=%__ExtraCmakeParams% -DCLR_CMAKE_TARGET_OS=wasi -DCLR_CMAKE_TARGET_ARCH=wasm "-DWASI_SDK_PREFIX=!WASI_SDK_PATH!" "-DCMAKE_TOOLCHAIN_FILE=!__repoRoot!/src/native/external/wasi-sdk-p2.cmake" "-DCMAKE_SYSROOT=!WASI_SDK_PATH!share/wasi-sysroot" "-DCMAKE_CROSSCOMPILING_EMULATOR=node --experimental-wasm-bigint --experimental-wasi-unstable-preview1"
7778
)
7879
) else (
7980
set __ExtraCmakeParams=%__ExtraCmakeParams% "-DCMAKE_SYSTEM_VERSION=10.0"

eng/native/gen-buildsys.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,11 +94,12 @@ if [[ "$scan_build" == "ON" && -n "$SCAN_BUILD_COMMAND" ]]; then
9494
cmake_command="$SCAN_BUILD_COMMAND $cmake_command"
9595
fi
9696

97+
cmake_extra_defines_wasm=()
9798
if [[ "$host_arch" == "wasm" ]]; then
9899
if [[ "$target_os" == "browser" ]]; then
99100
cmake_command="emcmake $cmake_command"
100101
elif [[ "$target_os" == "wasi" ]]; then
101-
cmake_extra_defines="$cmake_extra_defines -DCLR_CMAKE_TARGET_OS=wasi -DCLR_CMAKE_TARGET_ARCH=wasm -DWASI_SDK_PREFIX=$WASI_SDK22_PATH -DCMAKE_TOOLCHAIN_FILE=${WASI_SDK22_PATH}share/cmake/wasi-sdk.cmake" "-DCMAKE_SYSROOT=${WASI_SDK22_PATH}share/wasi-sysroot"
102+
cmake_extra_defines_wasm=("-DCLR_CMAKE_TARGET_OS=wasi" "-DCLR_CMAKE_TARGET_ARCH=wasm" "-DWASI_SDK_PREFIX=$WASI_SDK_PATH" "-DCMAKE_TOOLCHAIN_FILE=$reporoot/src/native/external/wasi-sdk-p2.cmake" "-DCMAKE_SYSROOT=${WASI_SDK_PATH}share/wasi-sysroot" "-DCMAKE_CROSSCOMPILING_EMULATOR=node --experimental-wasm-bigint --experimental-wasi-unstable-preview1")
102103
else
103104
echo "target_os was not specified"
104105
exit 1
@@ -112,6 +113,7 @@ $cmake_command \
112113
"-DCMAKE_INSTALL_PREFIX=$__CMakeBinDir" \
113114
$cmake_extra_defines \
114115
$__UnprocessedCMakeArgs \
116+
"${cmake_extra_defines_wasm[@]}" \
115117
-S "$1" \
116118
-B "$2"
117119

eng/native/init-vs-env.cmd

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,8 @@
66
set "__VCBuildArch="
77
if /i "%~1" == "x86" (set __VCBuildArch=x86)
88
if /i "%~1" == "x64" (set __VCBuildArch=x86_amd64)
9-
if /i "%~1" == "arm" (set __VCBuildArch=x86_arm)
10-
if /i "%~1" == "arm64" (set __VCBuildArch=x86_arm64)
11-
if /i "%~1" == "wasm" (if /i "%PROCESSOR_ARCHITECTURE%" == "ARM64" (set __VCBuildArch=x86_arm64) else (set __VCBuildArch=x86_amd64))
9+
if /i "%~1" == "arm64" (if /i "%PROCESSOR_ARCHITECTURE%" == "ARM64" (set __VCBuildArch=arm64) else (set __VCBuildArch=x86_arm64))
10+
if /i "%~1" == "wasm" (if /i "%PROCESSOR_ARCHITECTURE%" == "ARM64" (set __VCBuildArch=arm64) else (set __VCBuildArch=x86_amd64))
1211

1312
:: Default to highest Visual Studio version available that has Visual C++ tools.
1413
::

eng/pipelines/coreclr/templates/run-superpmi-diffs-job.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ jobs:
122122
helixType: 'build/tests/'
123123
helixQueues: ${{ join(',', parameters.helixQueues) }}
124124
creator: dotnet-bot
125-
WorkItemTimeout: 3:00 # 3 hours
125+
WorkItemTimeout: 5:00 # 5 hours
126126
WorkItemDirectory: '$(WorkItemDirectory)'
127127
CorrelationPayloadDirectory: '$(CorrelationPayloadDirectory)'
128128
helixProjectArguments: '$(Build.SourcesDirectory)/src/coreclr/scripts/superpmi-diffs.proj'

eng/testing/tests.wasi.targets

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
>true</InstallWasmtimeForTests>
1414

1515
<!--<InstallWorkloadUsingArtifactsDependsOn>_GetWorkloadsToInstall;$(InstallWorkloadUsingArtifactsDependsOn)</InstallWorkloadUsingArtifactsDependsOn>-->
16-
<WASI_SDK22_PATH Condition="'$(WASI_SDK22_PATH)' == ''">$([MSBuild]::NormalizeDirectory($(MonoProjectRoot), 'wasi', 'wasi-sdk'))</WASI_SDK22_PATH>
17-
<WASI_SDK22_PATH>$([MSBuild]::EnsureTrailingSlash('$(WASI_SDK22_PATH)').Replace('\', '/'))</WASI_SDK22_PATH>
16+
<WASI_SDK_PATH Condition="'$(WASI_SDK_PATH)' == '' or !Exists('$(WASI_SDK_PATH)/VERSION22PATCHED')">$([MSBuild]::NormalizeDirectory($(MonoProjectRoot), 'wasi', 'wasi-sdk'))</WASI_SDK_PATH>
17+
<WASI_SDK_PATH>$([MSBuild]::EnsureTrailingSlash('$(WASI_SDK_PATH)').Replace('\', '/'))</WASI_SDK_PATH>
1818

1919
<_BundleAOTTestWasmAppForHelixDependsOn>$(_BundleAOTTestWasmAppForHelixDependsOn);PrepareForWasiBuildApp;_PrepareForAOTOnHelix</_BundleAOTTestWasmAppForHelixDependsOn>
2020
</PropertyGroup>

src/coreclr/build-runtime.cmd

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -363,11 +363,8 @@ if %__BuildNative% EQU 1 (
363363
REM Set the environment for the native build
364364
set __VCTargetArch=amd64
365365
if /i "%__HostArch%" == "x86" ( set __VCTargetArch=x86 )
366-
if /i "%__HostArch%" == "arm" (
367-
set __VCTargetArch=x86_arm
368-
)
369366
if /i "%__HostArch%" == "arm64" (
370-
set __VCTargetArch=x86_arm64
367+
if /i "%__ProcessorArch%" == "ARM64" (set __VCTargetArch=arm64) else (set __VCTargetArch=x86_arm64)
371368
)
372369

373370
if NOT DEFINED SkipVCEnvInit (

src/coreclr/gc/gc.cpp

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52138,6 +52138,38 @@ void GCHeap::DiagWalkHeap (walk_fn fn, void* context, int gen_number, bool walk_
5213852138
gc_heap::walk_heap (fn, context, gen_number, walk_large_object_heap_p);
5213952139
}
5214052140

52141+
// Walking the GC Heap requires that the EE is suspended and all heap allocation contexts are fixed.
52142+
// DiagWalkHeap is invoked only during a GC, where both requirements are met.
52143+
// So DiagWalkHeapWithACHandling facilitates a GC Heap walk outside of a GC by handling allocation contexts logic,
52144+
// and it leaves the responsibility of suspending and resuming EE to the callers.
52145+
void GCHeap::DiagWalkHeapWithACHandling (walk_fn fn, void* context, int gen_number, bool walk_large_object_heap_p)
52146+
{
52147+
#ifdef MULTIPLE_HEAPS
52148+
for (int hn = 0; hn < gc_heap::n_heaps; hn++)
52149+
{
52150+
gc_heap* hp = gc_heap::g_heaps [hn];
52151+
#else
52152+
{
52153+
gc_heap* hp = pGenGCHeap;
52154+
#endif //MULTIPLE_HEAPS
52155+
hp->fix_allocation_contexts (FALSE);
52156+
}
52157+
52158+
DiagWalkHeap (fn, context, gen_number, walk_large_object_heap_p);
52159+
52160+
52161+
#ifdef MULTIPLE_HEAPS
52162+
for (int hn = 0; hn < gc_heap::n_heaps; hn++)
52163+
{
52164+
gc_heap* hp = gc_heap::g_heaps [hn];
52165+
#else
52166+
{
52167+
gc_heap* hp = pGenGCHeap;
52168+
#endif //MULTIPLE_HEAPS
52169+
hp->repair_allocation_contexts (TRUE);
52170+
}
52171+
}
52172+
5214152173
void GCHeap::DiagWalkFinalizeQueue (void* gc_context, fq_walk_fn fn)
5214252174
{
5214352175
gc_heap* hp = (gc_heap*)gc_context;

src/coreclr/gc/gcimpl.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,8 @@ class GCHeap : public IGCHeapInternal
316316
virtual void DiagGetGCSettings(EtwGCSettingsInfo* etw_settings);
317317

318318
virtual unsigned int GetGenerationWithRange(Object* object, uint8_t** ppStart, uint8_t** ppAllocated, uint8_t** ppReserved);
319+
320+
virtual void DiagWalkHeapWithACHandling(walk_fn fn, void* context, int gen_number, bool walk_large_object_heap_p);
319321
public:
320322
Object * NextObj (Object * object);
321323

0 commit comments

Comments
 (0)