Skip to content

Commit 18e51ae

Browse files
committed
Merge remote-tracking branch 'upstream/master' into consolidation
2 parents 0bb92cb + 3ec016e commit 18e51ae

File tree

683 files changed

+2565
-1769
lines changed

Some content is hidden

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

683 files changed

+2565
-1769
lines changed

Directory.Build.props

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<Project>
1+
<Project TreatAsLocalProperty="RepoRoot">
22

33
<PropertyGroup>
44
<!--
@@ -20,7 +20,7 @@
2020

2121
<!-- Set these properties early enough for libraries as they import the Arcade SDK not early enough. -->
2222
<PropertyGroup Condition="'$(SkipImportArcadeSdkFromRoot)' == 'true'">
23-
<RepoRoot>$(MSBuildThisFileDirectory)</RepoRoot>
23+
<RepoRoot>$([MSBuild]::EnsureTrailingSlash('$(MSBuildThisFileDirectory)'))</RepoRoot>
2424
<RepositoryEngineeringDir>$([MSBuild]::NormalizeDirectory('$(RepoRoot)', 'eng'))</RepositoryEngineeringDir>
2525
<ArtifactsDir>$([MSBuild]::NormalizeDirectory('$(RepoRoot)', 'artifacts'))</ArtifactsDir>
2626
<ArtifactsBinDir>$([MSBuild]::NormalizeDirectory('$(ArtifactsDir)', 'bin'))</ArtifactsBinDir>

docs/design/features/PinnedHeap.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ We have done a lot of work to combat pinning in GC such as
1010

1111
* POPO (Promote Only Pinned Objects) which actually breaks up a plug if it includes both pinned and non pinned objects so we don’t end up pinning the whole plug if survived pinned objects are adjacent to non pinned objects that might occupy large amounts of memory.
1212

13-
We also have provided framework utilities like <span style="color:red">`PinnableBufferCache`</span> (which only exists in the full framework) and modified various framework components to use it.
13+
We also have provided framework utilities like <span style="color:red">`PinnableBufferCache`</span> (which only exists in .NET Framework) and modified various framework components to use it.
1414

1515
With these efforts we were able to mitigate perf problems caused by pinned by a lot. But at the end of the day, due to the nature of “pinning already allocated objects”, we cannot eliminate the situation of interleaved pinned and non pinned objects and that can still cause perf problems for GC. And the long lived scattered pins are the most problematic. They can be separated into 2 categories –
1616

docs/design/features/host-startup-hook.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ needs to be built against the same or lower version of .NET Core than the app.
100100

101101
This could be used with `AssemblyLoadContext` APIs to resolve
102102
dependencies not on the TPA list from a shared location, similar to
103-
the GAC on full framework. It could also be used to forcibly preload
103+
the GAC on .NET Framework. It could also be used to forcibly preload
104104
assemblies that are on the TPA list from a different location. Future
105105
changes to `AssemblyLoadContext` could make this easier to use by
106106
making the default load context or TPA list modifiable.

docs/workflow/building/libraries/README.md

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,8 @@ Here is one example of a daily workflow for a developer working mainly on the li
88
:: From root in the morning:
99
git clean -xdf
1010
git pull upstream master & git push origin master
11-
cd src\coreclr
12-
build -release -skiptests
13-
cd ..\..\
14-
build -subsetCategory libraries /p:CoreCLRConfiguration=Release
11+
build -subsetCategory coreclr -c Release
12+
build -subsetCategory libraries -coreclrConfiguration Release
1513
1614
:: The above you may only perform once in a day, or when
1715
:: you pull down significant new changes.
@@ -35,10 +33,8 @@ The instructions for Linux are essentially the same:
3533
# From root in the morning:
3634
git clean -xdf
3735
git pull upstream master & git push origin master
38-
cd src/coreclr
39-
build -release -skiptests
40-
cd ../../
41-
./build.sh -subsetCategory libraries /p:CoreCLRConfiguration=Release
36+
./build.sh -subsetcategory coreclr -c Release
37+
./build.sh -subsetcategory libraries -coreclrconfiguration Release
4238
4339
# The above you may only perform once in a day, or when
4440
# you pull down significant new changes.
@@ -59,18 +55,16 @@ The steps above may be all you need to know to make a change. Want more details
5955

6056
This document explains how to work on libraries. In order to work on library projects or run library tests it is necessary to have built CoreCLR (aka, the "runtime") to give the libraries something to run on. You should normally build CoreCLR in release configuration and libraries in debug configuration. If you haven't already done so, please read [this document](../../README.md#Configurations) to understand configurations.
6157

62-
These example commands will build a release CoreCLR (and CoreLib) and debug libraries:
58+
These example commands will build a release CoreCLR (and CoreLib), debug libraries, and debug installer:
6359

6460
For Linux:
6561
```
66-
src/coreclr/build.sh -release -skiptests
67-
./build.sh -subsetCategory libraries /p:CoreCLRConfiguration=Release
62+
./build.sh -coreclrconfiguration Release
6863
```
6964

7065
For Windows:
7166
```
72-
src\coreclr\build.cmd -release -skiptests
73-
build.cmd -subsetCategory libraries /p:CoreCLRConfiguration=Release
67+
./build.cmd -coreclrConfiguration Release
7468
```
7569

7670
Detailed information about building and testing CoreCLR and the libraries is in the documents linked below.
@@ -220,4 +214,4 @@ If you are working on Windows, and use Visual Studio, you can open individual li
220214

221215
For more details about running tests inside Visual Studio, [go here](../../testing/libraries/testing-vs.md)
222216

223-
For more about running tests, read the [running tests](../../testing/libraries/testing.md) document.
217+
For more about running tests, read the [running tests](../../testing/libraries/testing.md) document.

docs/workflow/testing/coreclr/testing.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Details on test metadata can be found in [test-configuration.md](test-configurat
88
* [Unix](../../building/coreclr/linux-instructions.md)
99
* [macOS](../../building/coreclr/osx-instructions.md)
1010
* [Windows](../../building/coreclr/README.md)
11-
2) [Build the libraries](../../building/libraries/README.md) in Release configuration. Pass the configuration of CoreCLR you just built to the build script (e.g. `/p:CoreCLRConfiguration=Debug`).
11+
2) [Build the libraries](../../building/libraries/README.md) in Release configuration. Pass the configuration of CoreCLR you just built to the build script (e.g. `-coreclrConfiguration Debug`).
1212
3) From the src/coreclr directory run the following command:
1313
* Non-Windows - `./build-test.sh`
1414
* Windows - `build-test.cmd`

eng/Signing.props

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,13 @@
3838

3939
<ItemsToSign Include="$(CoreCLRArtifactsPath)System.Private.CoreLib.dll" />
4040

41-
<ItemsToSign Include="$(CoreCLRArtifactsPath)crossgen2/crossgen2.exe" />
42-
<ItemsToSign Include="$(CoreCLRArtifactsPath)crossgen2/crossgen2.dll" />
43-
<ItemsToSign Include="$(CoreCLRArtifactsPath)crossgen2/ILCompiler.DependencyAnalysisFramework.dll" />
44-
<ItemsToSign Include="$(CoreCLRArtifactsPath)crossgen2/ILCompiler.ReadyToRun.dll" />
45-
<ItemsToSign Include="$(CoreCLRArtifactsPath)crossgen2/ILCompiler.TypeSystem.ReadyToRun.dll" />
46-
<ItemsToSign Include="$(CoreCLRArtifactsPath)crossgen2/clrjitilc.dll" />
47-
<ItemsToSign Include="$(CoreCLRArtifactsPath)crossgen2/jitinterface.dll" />
41+
<ItemsToSign Include="$(CoreCLRCrossgen2Dir)crossgen2.exe" />
42+
<ItemsToSign Include="$(CoreCLRCrossgen2Dir)crossgen2.dll" />
43+
<ItemsToSign Include="$(CoreCLRCrossgen2Dir)ILCompiler.DependencyAnalysisFramework.dll" />
44+
<ItemsToSign Include="$(CoreCLRCrossgen2Dir)ILCompiler.ReadyToRun.dll" />
45+
<ItemsToSign Include="$(CoreCLRCrossgen2Dir)ILCompiler.TypeSystem.ReadyToRun.dll" />
46+
<ItemsToSign Include="$(CoreCLRCrossgen2Dir)clrjitilc.dll" />
47+
<ItemsToSign Include="$(CoreCLRCrossgen2Dir)jitinterface.dll" />
4848

4949
<ItemsToSign Include="@(CoreCLRCrossTargetItemsToSign)" />
5050

eng/Subsets.props

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,18 @@
102102
<ProjectToBuild Include="$(RepoToolsLocalDir)regenerate-readme-table.proj" />
103103
</ItemGroup>
104104

105+
<ItemDefinitionGroup Condition="'$(CoreCLRConfiguration)' != ''">
106+
<CoreClrProjectToBuild>
107+
<Properties>Configuration=$(CoreCLRConfiguration)</Properties>
108+
</CoreClrProjectToBuild>
109+
</ItemDefinitionGroup>
110+
111+
<ItemDefinitionGroup Condition="'$(LibrariesConfiguration)' != ''">
112+
<LibrariesProjectToBuild>
113+
<Properties>Configuration=$(LibrariesConfiguration)</Properties>
114+
</LibrariesProjectToBuild>
115+
</ItemDefinitionGroup>
116+
105117
<!-- CoreClr sets -->
106118
<ItemGroup Condition="$(_subsetCategory.Contains('coreclr')) and $(_subset.Contains('all'))">
107119
<CoreClrProjectToBuild Include="$(CoreClrProjectRoot)coreclr.proj" BuildInParallel="false" />

eng/build.ps1

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ Param(
1414
[string]$arch,
1515
[string]$subsetCategory,
1616
[string]$subset,
17+
[string]$coreClrConfiguration,
18+
[string]$librariesConfiguration,
1719
[Parameter(ValueFromRemainingArguments=$true)][String[]]$properties
1820
)
1921

@@ -64,14 +66,26 @@ $subsetCategory = $subsetCategory.ToLowerInvariant()
6466
if ($vs) {
6567
. $PSScriptRoot\common\tools.ps1
6668

67-
if (-Not (Test-Path $vs)) {
68-
$vs = Join-Path "$PSScriptRoot\..\src\libraries" $vs | Join-Path -ChildPath "$vs.sln"
69+
# Microsoft.DotNet.CoreSetup.sln is special - hosting tests are currently meant to run on the
70+
# bootstrapped .NET Core, not on the live-built runtime.
71+
if ([System.IO.Path]::GetFileName($vs) -ieq "Microsoft.DotNet.CoreSetup.sln") {
72+
if (-Not (Test-Path $vs)) {
73+
$vs = Join-Path "$PSScriptRoot\..\src\installer" $vs
74+
}
75+
76+
# This tells .NET Core to use the bootstrapped runtime to run the tests
77+
$env:DOTNET_ROOT=InitializeDotNetCli -install:$false
6978
}
79+
else {
80+
if (-Not (Test-Path $vs)) {
81+
$vs = Join-Path "$PSScriptRoot\..\src\libraries" $vs | Join-Path -ChildPath "$vs.sln"
82+
}
7083

71-
$archTestHost = if ($arch) { $arch } else { "x64" }
84+
$archTestHost = if ($arch) { $arch } else { "x64" }
7285

73-
# This tells .NET Core to use the same dotnet.exe that build scripts use
74-
$env:DOTNET_ROOT="$PSScriptRoot\..\artifacts\bin\testhost\netcoreapp5.0-Windows_NT-$configuration-$archTestHost";
86+
# This tells .NET Core to use the same dotnet.exe that build scripts use
87+
$env:DOTNET_ROOT="$PSScriptRoot\..\artifacts\bin\testhost\netcoreapp5.0-Windows_NT-$configuration-$archTestHost";
88+
}
7589

7690
# This tells MSBuild to load the SDK from the directory of the bootstrapped SDK
7791
$env:DOTNET_MSBUILD_SDK_RESOLVER_CLI_DIR=InitializeDotNetCli -install:$false

eng/build.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,14 @@ while [[ $# > 0 ]]; do
125125
arguments="$arguments /p:BuildNativeStripSymbols=true"
126126
shift 1
127127
;;
128+
-coreclrconfiguration)
129+
arguments="$arguments /p:CoreCLRConfiguration=$2"
130+
shift 2
131+
;;
132+
-librariesconfiguration)
133+
arguments="$arguments /p:LibrariesConfiguration=$2"
134+
shift 2
135+
;;
128136
*)
129137
ea=$1
130138

eng/liveBuilds.targets

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@
6464
<!-- Set up artifact subpaths. -->
6565
<PropertyGroup>
6666
<CoreCLRSharedFrameworkDir>$([MSBuild]::NormalizeDirectory('$(CoreCLRArtifactsPath)', 'sharedFramework'))</CoreCLRSharedFrameworkDir>
67+
<CoreCLRCrossgen2Dir>$([MSBuild]::NormalizeDirectory('$(CoreCLRArtifactsPath)', 'crossgen2'))</CoreCLRCrossgen2Dir>
6768

6869
<LibrariesPackagesDir>$([MSBuild]::NormalizeDirectory('$(LibrariesArtifactsPath)', 'packages', '$(LibrariesConfiguration)'))</LibrariesPackagesDir>
6970
<LibrariesShippingPackagesDir>$([MSBuild]::NormalizeDirectory('$(LibrariesPackagesDir)', 'Shipping'))</LibrariesShippingPackagesDir>

eng/pipelines/libraries/helix-queues-setup.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,11 @@ jobs:
4040
- (Alpine.310.Amd64.Open)[email protected]/dotnet-buildtools/prereqs:alpine-3.10-helix-3043688-20190918214010
4141
- (Alpine.311.Amd64.Open)[email protected]/dotnet-buildtools/prereqs:alpine-3.11-helix-08e8e40-20200107182408
4242

43+
# Issue tracking this being re-enabled https://github.com/dotnet/runtime/issues/1723
4344
# Linux musl arm64
44-
- ${{ if eq(parameters.platform, 'Linux_musl_arm64') }}:
45-
- ${{ if eq(parameters.jobParameters.isFullMatrix, true) }}:
46-
- (Alpine.38.Arm64.Open)[email protected]/dotnet-buildtools/prereqs:alpine-3.8-helix-arm64v8-a45aeeb-20190620184035
45+
#- ${{ if eq(parameters.platform, 'Linux_musl_arm64') }}:
46+
# - ${{ if eq(parameters.jobParameters.isFullMatrix, true) }}:
47+
# - (Alpine.38.Arm64.Open)[email protected]/dotnet-buildtools/prereqs:alpine-3.8-helix-arm64v8-a45aeeb-20190620184035
4748

4849
# Linux x64
4950
- ${{ if eq(parameters.platform, 'Linux_x64') }}:

src/coreclr/EmptyProps.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33
<!-- This file is intentionally empty. It is copied by build.cmd into the bin directory as both Directory.Build.props
44
and Directory.Build.targets to prevent CMake built projects from dependending on the Directory.Build infrastructure
55
in the root of the source tree. In particular this was necessary to compile DacTableGen, which is currently compiled
6-
against the desktop framework.
6+
against .NET Framework.
77
-->
88
</Project>

src/coreclr/configurecompiler.cmake

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -373,16 +373,13 @@ endif(CLR_CMAKE_PLATFORM_FREEBSD)
373373
#-----------------------------------
374374
if (CLR_CMAKE_PLATFORM_ARCH_AMD64)
375375
add_definitions(-D_AMD64_)
376-
add_definitions(-DAMD64)
377376
add_definitions(-DBIT64)
378377
elseif (CLR_CMAKE_PLATFORM_ARCH_I386)
379378
add_definitions(-D_X86_)
380379
elseif (CLR_CMAKE_PLATFORM_ARCH_ARM)
381380
add_definitions(-D_ARM_)
382-
add_definitions(-DARM)
383381
elseif (CLR_CMAKE_PLATFORM_ARCH_ARM64)
384382
add_definitions(-D_ARM64_)
385-
add_definitions(-DARM64)
386383
add_definitions(-DBIT64)
387384
else ()
388385
clr_unknown_arch()
@@ -392,16 +389,12 @@ if (CLR_CMAKE_PLATFORM_UNIX)
392389
if(CLR_CMAKE_PLATFORM_LINUX)
393390
if(CLR_CMAKE_PLATFORM_UNIX_AMD64)
394391
message("Detected Linux x86_64")
395-
add_definitions(-DLINUX64)
396392
elseif(CLR_CMAKE_PLATFORM_UNIX_ARM)
397393
message("Detected Linux ARM")
398-
add_definitions(-DLINUX32)
399394
elseif(CLR_CMAKE_PLATFORM_UNIX_ARM64)
400395
message("Detected Linux ARM64")
401-
add_definitions(-DLINUX64)
402396
elseif(CLR_CMAKE_PLATFORM_UNIX_X86)
403397
message("Detected Linux i686")
404-
add_definitions(-DLINUX32)
405398
else()
406399
clr_unknown_arch()
407400
endif()

src/coreclr/crosscomponents.cmake

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,5 @@ if(NOT CLR_CMAKE_PLATFORM_LINUX AND NOT FEATURE_CROSSBITNESS)
1313
list (APPEND CLR_CROSS_COMPONENTS_LIST
1414
mscordaccore
1515
mscordbi
16-
sos
1716
)
1817
endif()

src/coreclr/dependencies.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<!-- Tests/infrastructure dependency versions. -->
99
<PropertyGroup>
1010
<XunitPerformanceApiPackageVersion>1.0.0-beta-build0015</XunitPerformanceApiPackageVersion>
11-
<MicrosoftDiagnosticsTracingTraceEventPackageVersion>2.0.43</MicrosoftDiagnosticsTracingTraceEventPackageVersion>
11+
<MicrosoftDiagnosticsTracingTraceEventPackageVersion>2.0.49</MicrosoftDiagnosticsTracingTraceEventPackageVersion>
1212
<MicrosoftDiagnosticsToolsRuntimeClientVersion>1.0.4-preview6.19326.1</MicrosoftDiagnosticsToolsRuntimeClientVersion>
1313
<CommandLineParserVersion>2.2.0</CommandLineParserVersion>
1414

src/coreclr/format.patch

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
diff --git a/src/coreclr/src/jit/importer.cpp b/src/coreclr/src/jit/importer.cpp
2+
index a71c325ff48..c0569355c89 100644
3+
--- a/src/coreclr/src/jit/importer.cpp
4+
+++ b/src/coreclr/src/jit/importer.cpp
5+
@@ -15184,41 +15184,41 @@ void Compiler::impImportBlockCode(BasicBlock* block)
6+
info.compCompHnd->compareTypesForEquality(resolvedToken.hClass, clsHnd);
7+
8+
if (compare == TypeCompareState::Must)
9+
{
10+
JITDUMP("\nOptimizing %s (%s) -- type test will succeed\n",
11+
opcode == CEE_UNBOX ? "UNBOX" : "UNBOX.ANY", eeGetClassName(clsHnd));
12+
13+
// For UNBOX, null check (if necessary), and then leave the box payload byref on the stack.
14+
if (opcode == CEE_UNBOX)
15+
{
16+
GenTree* cloneOperand;
17+
op1 = impCloneExpr(op1, &cloneOperand, NO_CLASS_HANDLE, (unsigned)CHECK_SPILL_ALL,
18+
nullptr DEBUGARG("optimized unbox clone"));
19+
20+
GenTree* boxPayloadOffset = gtNewIconNode(TARGET_POINTER_SIZE, TYP_I_IMPL);
21+
GenTree* boxPayloadAddress =
22+
gtNewOperNode(GT_ADD, TYP_BYREF, cloneOperand, boxPayloadOffset);
23+
GenTree* nullcheck = gtNewOperNode(GT_NULLCHECK, TYP_I_IMPL, op1);
24+
block->bbFlags |= BBF_HAS_NULLCHECK;
25+
optMethodFlags |= OMF_HAS_NULLCHECK;
26+
- GenTree* result = gtNewOperNode(GT_COMMA, TYP_BYREF, nullcheck, boxPayloadAddress);
27+
+ GenTree* result = gtNewOperNode(GT_COMMA, TYP_BYREF, nullcheck, boxPayloadAddress);
28+
impPushOnStack(result, tiRetVal);
29+
break;
30+
}
31+
32+
// For UNBOX.ANY load the struct from the box payload byref (the load will nullcheck)
33+
assert(opcode == CEE_UNBOX_ANY);
34+
GenTree* boxPayloadOffset = gtNewIconNode(TARGET_POINTER_SIZE, TYP_I_IMPL);
35+
GenTree* boxPayloadAddress = gtNewOperNode(GT_ADD, TYP_BYREF, op1, boxPayloadOffset);
36+
impPushOnStack(boxPayloadAddress, tiRetVal);
37+
oper = GT_OBJ;
38+
goto OBJ;
39+
}
40+
else
41+
{
42+
JITDUMP("\nUnable to optimize %s -- can't resolve type comparison\n",
43+
opcode == CEE_UNBOX ? "UNBOX" : "UNBOX.ANY");
44+
}
45+
}
46+
else
47+
{

0 commit comments

Comments
 (0)