Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into consolidation
Browse files Browse the repository at this point in the history
  • Loading branch information
akoeplinger committed Jan 18, 2020
2 parents 0bb92cb + 3ec016e commit 18e51ae
Show file tree
Hide file tree
Showing 683 changed files with 2,565 additions and 1,769 deletions.
4 changes: 2 additions & 2 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project>
<Project TreatAsLocalProperty="RepoRoot">

<PropertyGroup>
<!--
Expand All @@ -20,7 +20,7 @@

<!-- Set these properties early enough for libraries as they import the Arcade SDK not early enough. -->
<PropertyGroup Condition="'$(SkipImportArcadeSdkFromRoot)' == 'true'">
<RepoRoot>$(MSBuildThisFileDirectory)</RepoRoot>
<RepoRoot>$([MSBuild]::EnsureTrailingSlash('$(MSBuildThisFileDirectory)'))</RepoRoot>
<RepositoryEngineeringDir>$([MSBuild]::NormalizeDirectory('$(RepoRoot)', 'eng'))</RepositoryEngineeringDir>
<ArtifactsDir>$([MSBuild]::NormalizeDirectory('$(RepoRoot)', 'artifacts'))</ArtifactsDir>
<ArtifactsBinDir>$([MSBuild]::NormalizeDirectory('$(ArtifactsDir)', 'bin'))</ArtifactsBinDir>
Expand Down
2 changes: 1 addition & 1 deletion docs/design/features/PinnedHeap.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ We have done a lot of work to combat pinning in GC such as

* 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.

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.
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.

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 –

Expand Down
2 changes: 1 addition & 1 deletion docs/design/features/host-startup-hook.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ needs to be built against the same or lower version of .NET Core than the app.

This could be used with `AssemblyLoadContext` APIs to resolve
dependencies not on the TPA list from a shared location, similar to
the GAC on full framework. It could also be used to forcibly preload
the GAC on .NET Framework. It could also be used to forcibly preload
assemblies that are on the TPA list from a different location. Future
changes to `AssemblyLoadContext` could make this easier to use by
making the default load context or TPA list modifiable.
Expand Down
22 changes: 8 additions & 14 deletions docs/workflow/building/libraries/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,8 @@ Here is one example of a daily workflow for a developer working mainly on the li
:: From root in the morning:
git clean -xdf
git pull upstream master & git push origin master
cd src\coreclr
build -release -skiptests
cd ..\..\
build -subsetCategory libraries /p:CoreCLRConfiguration=Release
build -subsetCategory coreclr -c Release
build -subsetCategory libraries -coreclrConfiguration Release
:: The above you may only perform once in a day, or when
:: you pull down significant new changes.
Expand All @@ -35,10 +33,8 @@ The instructions for Linux are essentially the same:
# From root in the morning:
git clean -xdf
git pull upstream master & git push origin master
cd src/coreclr
build -release -skiptests
cd ../../
./build.sh -subsetCategory libraries /p:CoreCLRConfiguration=Release
./build.sh -subsetcategory coreclr -c Release
./build.sh -subsetcategory libraries -coreclrconfiguration Release
# The above you may only perform once in a day, or when
# you pull down significant new changes.
Expand All @@ -59,18 +55,16 @@ The steps above may be all you need to know to make a change. Want more details

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.

These example commands will build a release CoreCLR (and CoreLib) and debug libraries:
These example commands will build a release CoreCLR (and CoreLib), debug libraries, and debug installer:

For Linux:
```
src/coreclr/build.sh -release -skiptests
./build.sh -subsetCategory libraries /p:CoreCLRConfiguration=Release
./build.sh -coreclrconfiguration Release
```

For Windows:
```
src\coreclr\build.cmd -release -skiptests
build.cmd -subsetCategory libraries /p:CoreCLRConfiguration=Release
./build.cmd -coreclrConfiguration Release
```

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

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

For more about running tests, read the [running tests](../../testing/libraries/testing.md) document.
For more about running tests, read the [running tests](../../testing/libraries/testing.md) document.
2 changes: 1 addition & 1 deletion docs/workflow/testing/coreclr/testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Details on test metadata can be found in [test-configuration.md](test-configurat
* [Unix](../../building/coreclr/linux-instructions.md)
* [macOS](../../building/coreclr/osx-instructions.md)
* [Windows](../../building/coreclr/README.md)
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`).
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`).
3) From the src/coreclr directory run the following command:
* Non-Windows - `./build-test.sh`
* Windows - `build-test.cmd`
Expand Down
14 changes: 7 additions & 7 deletions eng/Signing.props
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,13 @@

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

<ItemsToSign Include="$(CoreCLRArtifactsPath)crossgen2/crossgen2.exe" />
<ItemsToSign Include="$(CoreCLRArtifactsPath)crossgen2/crossgen2.dll" />
<ItemsToSign Include="$(CoreCLRArtifactsPath)crossgen2/ILCompiler.DependencyAnalysisFramework.dll" />
<ItemsToSign Include="$(CoreCLRArtifactsPath)crossgen2/ILCompiler.ReadyToRun.dll" />
<ItemsToSign Include="$(CoreCLRArtifactsPath)crossgen2/ILCompiler.TypeSystem.ReadyToRun.dll" />
<ItemsToSign Include="$(CoreCLRArtifactsPath)crossgen2/clrjitilc.dll" />
<ItemsToSign Include="$(CoreCLRArtifactsPath)crossgen2/jitinterface.dll" />
<ItemsToSign Include="$(CoreCLRCrossgen2Dir)crossgen2.exe" />
<ItemsToSign Include="$(CoreCLRCrossgen2Dir)crossgen2.dll" />
<ItemsToSign Include="$(CoreCLRCrossgen2Dir)ILCompiler.DependencyAnalysisFramework.dll" />
<ItemsToSign Include="$(CoreCLRCrossgen2Dir)ILCompiler.ReadyToRun.dll" />
<ItemsToSign Include="$(CoreCLRCrossgen2Dir)ILCompiler.TypeSystem.ReadyToRun.dll" />
<ItemsToSign Include="$(CoreCLRCrossgen2Dir)clrjitilc.dll" />
<ItemsToSign Include="$(CoreCLRCrossgen2Dir)jitinterface.dll" />

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

Expand Down
12 changes: 12 additions & 0 deletions eng/Subsets.props
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,18 @@
<ProjectToBuild Include="$(RepoToolsLocalDir)regenerate-readme-table.proj" />
</ItemGroup>

<ItemDefinitionGroup Condition="'$(CoreCLRConfiguration)' != ''">
<CoreClrProjectToBuild>
<Properties>Configuration=$(CoreCLRConfiguration)</Properties>
</CoreClrProjectToBuild>
</ItemDefinitionGroup>

<ItemDefinitionGroup Condition="'$(LibrariesConfiguration)' != ''">
<LibrariesProjectToBuild>
<Properties>Configuration=$(LibrariesConfiguration)</Properties>
</LibrariesProjectToBuild>
</ItemDefinitionGroup>

<!-- CoreClr sets -->
<ItemGroup Condition="$(_subsetCategory.Contains('coreclr')) and $(_subset.Contains('all'))">
<CoreClrProjectToBuild Include="$(CoreClrProjectRoot)coreclr.proj" BuildInParallel="false" />
Expand Down
24 changes: 19 additions & 5 deletions eng/build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ Param(
[string]$arch,
[string]$subsetCategory,
[string]$subset,
[string]$coreClrConfiguration,
[string]$librariesConfiguration,
[Parameter(ValueFromRemainingArguments=$true)][String[]]$properties
)

Expand Down Expand Up @@ -64,14 +66,26 @@ $subsetCategory = $subsetCategory.ToLowerInvariant()
if ($vs) {
. $PSScriptRoot\common\tools.ps1

if (-Not (Test-Path $vs)) {
$vs = Join-Path "$PSScriptRoot\..\src\libraries" $vs | Join-Path -ChildPath "$vs.sln"
# Microsoft.DotNet.CoreSetup.sln is special - hosting tests are currently meant to run on the
# bootstrapped .NET Core, not on the live-built runtime.
if ([System.IO.Path]::GetFileName($vs) -ieq "Microsoft.DotNet.CoreSetup.sln") {
if (-Not (Test-Path $vs)) {
$vs = Join-Path "$PSScriptRoot\..\src\installer" $vs
}

# This tells .NET Core to use the bootstrapped runtime to run the tests
$env:DOTNET_ROOT=InitializeDotNetCli -install:$false
}
else {
if (-Not (Test-Path $vs)) {
$vs = Join-Path "$PSScriptRoot\..\src\libraries" $vs | Join-Path -ChildPath "$vs.sln"
}

$archTestHost = if ($arch) { $arch } else { "x64" }
$archTestHost = if ($arch) { $arch } else { "x64" }

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

# This tells MSBuild to load the SDK from the directory of the bootstrapped SDK
$env:DOTNET_MSBUILD_SDK_RESOLVER_CLI_DIR=InitializeDotNetCli -install:$false
Expand Down
8 changes: 8 additions & 0 deletions eng/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,14 @@ while [[ $# > 0 ]]; do
arguments="$arguments /p:BuildNativeStripSymbols=true"
shift 1
;;
-coreclrconfiguration)
arguments="$arguments /p:CoreCLRConfiguration=$2"
shift 2
;;
-librariesconfiguration)
arguments="$arguments /p:LibrariesConfiguration=$2"
shift 2
;;
*)
ea=$1

Expand Down
1 change: 1 addition & 0 deletions eng/liveBuilds.targets
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
<!-- Set up artifact subpaths. -->
<PropertyGroup>
<CoreCLRSharedFrameworkDir>$([MSBuild]::NormalizeDirectory('$(CoreCLRArtifactsPath)', 'sharedFramework'))</CoreCLRSharedFrameworkDir>
<CoreCLRCrossgen2Dir>$([MSBuild]::NormalizeDirectory('$(CoreCLRArtifactsPath)', 'crossgen2'))</CoreCLRCrossgen2Dir>

<LibrariesPackagesDir>$([MSBuild]::NormalizeDirectory('$(LibrariesArtifactsPath)', 'packages', '$(LibrariesConfiguration)'))</LibrariesPackagesDir>
<LibrariesShippingPackagesDir>$([MSBuild]::NormalizeDirectory('$(LibrariesPackagesDir)', 'Shipping'))</LibrariesShippingPackagesDir>
Expand Down
7 changes: 4 additions & 3 deletions eng/pipelines/libraries/helix-queues-setup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,11 @@ jobs:
- (Alpine.310.Amd64.Open)[email protected]/dotnet-buildtools/prereqs:alpine-3.10-helix-3043688-20190918214010
- (Alpine.311.Amd64.Open)[email protected]/dotnet-buildtools/prereqs:alpine-3.11-helix-08e8e40-20200107182408

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

# Linux x64
- ${{ if eq(parameters.platform, 'Linux_x64') }}:
Expand Down
2 changes: 1 addition & 1 deletion src/coreclr/EmptyProps.props
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
<!-- This file is intentionally empty. It is copied by build.cmd into the bin directory as both Directory.Build.props
and Directory.Build.targets to prevent CMake built projects from dependending on the Directory.Build infrastructure
in the root of the source tree. In particular this was necessary to compile DacTableGen, which is currently compiled
against the desktop framework.
against .NET Framework.
-->
</Project>
7 changes: 0 additions & 7 deletions src/coreclr/configurecompiler.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -373,16 +373,13 @@ endif(CLR_CMAKE_PLATFORM_FREEBSD)
#-----------------------------------
if (CLR_CMAKE_PLATFORM_ARCH_AMD64)
add_definitions(-D_AMD64_)
add_definitions(-DAMD64)
add_definitions(-DBIT64)
elseif (CLR_CMAKE_PLATFORM_ARCH_I386)
add_definitions(-D_X86_)
elseif (CLR_CMAKE_PLATFORM_ARCH_ARM)
add_definitions(-D_ARM_)
add_definitions(-DARM)
elseif (CLR_CMAKE_PLATFORM_ARCH_ARM64)
add_definitions(-D_ARM64_)
add_definitions(-DARM64)
add_definitions(-DBIT64)
else ()
clr_unknown_arch()
Expand All @@ -392,16 +389,12 @@ if (CLR_CMAKE_PLATFORM_UNIX)
if(CLR_CMAKE_PLATFORM_LINUX)
if(CLR_CMAKE_PLATFORM_UNIX_AMD64)
message("Detected Linux x86_64")
add_definitions(-DLINUX64)
elseif(CLR_CMAKE_PLATFORM_UNIX_ARM)
message("Detected Linux ARM")
add_definitions(-DLINUX32)
elseif(CLR_CMAKE_PLATFORM_UNIX_ARM64)
message("Detected Linux ARM64")
add_definitions(-DLINUX64)
elseif(CLR_CMAKE_PLATFORM_UNIX_X86)
message("Detected Linux i686")
add_definitions(-DLINUX32)
else()
clr_unknown_arch()
endif()
Expand Down
1 change: 0 additions & 1 deletion src/coreclr/crosscomponents.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,5 @@ if(NOT CLR_CMAKE_PLATFORM_LINUX AND NOT FEATURE_CROSSBITNESS)
list (APPEND CLR_CROSS_COMPONENTS_LIST
mscordaccore
mscordbi
sos
)
endif()
2 changes: 1 addition & 1 deletion src/coreclr/dependencies.props
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<!-- Tests/infrastructure dependency versions. -->
<PropertyGroup>
<XunitPerformanceApiPackageVersion>1.0.0-beta-build0015</XunitPerformanceApiPackageVersion>
<MicrosoftDiagnosticsTracingTraceEventPackageVersion>2.0.43</MicrosoftDiagnosticsTracingTraceEventPackageVersion>
<MicrosoftDiagnosticsTracingTraceEventPackageVersion>2.0.49</MicrosoftDiagnosticsTracingTraceEventPackageVersion>
<MicrosoftDiagnosticsToolsRuntimeClientVersion>1.0.4-preview6.19326.1</MicrosoftDiagnosticsToolsRuntimeClientVersion>
<CommandLineParserVersion>2.2.0</CommandLineParserVersion>

Expand Down
47 changes: 47 additions & 0 deletions src/coreclr/format.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
diff --git a/src/coreclr/src/jit/importer.cpp b/src/coreclr/src/jit/importer.cpp
index a71c325ff48..c0569355c89 100644
--- a/src/coreclr/src/jit/importer.cpp
+++ b/src/coreclr/src/jit/importer.cpp
@@ -15184,41 +15184,41 @@ void Compiler::impImportBlockCode(BasicBlock* block)
info.compCompHnd->compareTypesForEquality(resolvedToken.hClass, clsHnd);

if (compare == TypeCompareState::Must)
{
JITDUMP("\nOptimizing %s (%s) -- type test will succeed\n",
opcode == CEE_UNBOX ? "UNBOX" : "UNBOX.ANY", eeGetClassName(clsHnd));

// For UNBOX, null check (if necessary), and then leave the box payload byref on the stack.
if (opcode == CEE_UNBOX)
{
GenTree* cloneOperand;
op1 = impCloneExpr(op1, &cloneOperand, NO_CLASS_HANDLE, (unsigned)CHECK_SPILL_ALL,
nullptr DEBUGARG("optimized unbox clone"));

GenTree* boxPayloadOffset = gtNewIconNode(TARGET_POINTER_SIZE, TYP_I_IMPL);
GenTree* boxPayloadAddress =
gtNewOperNode(GT_ADD, TYP_BYREF, cloneOperand, boxPayloadOffset);
GenTree* nullcheck = gtNewOperNode(GT_NULLCHECK, TYP_I_IMPL, op1);
block->bbFlags |= BBF_HAS_NULLCHECK;
optMethodFlags |= OMF_HAS_NULLCHECK;
- GenTree* result = gtNewOperNode(GT_COMMA, TYP_BYREF, nullcheck, boxPayloadAddress);
+ GenTree* result = gtNewOperNode(GT_COMMA, TYP_BYREF, nullcheck, boxPayloadAddress);
impPushOnStack(result, tiRetVal);
break;
}

// For UNBOX.ANY load the struct from the box payload byref (the load will nullcheck)
assert(opcode == CEE_UNBOX_ANY);
GenTree* boxPayloadOffset = gtNewIconNode(TARGET_POINTER_SIZE, TYP_I_IMPL);
GenTree* boxPayloadAddress = gtNewOperNode(GT_ADD, TYP_BYREF, op1, boxPayloadOffset);
impPushOnStack(boxPayloadAddress, tiRetVal);
oper = GT_OBJ;
goto OBJ;
}
else
{
JITDUMP("\nUnable to optimize %s -- can't resolve type comparison\n",
opcode == CEE_UNBOX ? "UNBOX" : "UNBOX.ANY");
}
}
else
{
Loading

0 comments on commit 18e51ae

Please sign in to comment.