Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Commit cc73a47

Browse files
committed
Merge
2 parents 0c5e2f1 + ee56e58 commit cc73a47

File tree

364 files changed

+9676
-15081
lines changed

Some content is hidden

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

364 files changed

+9676
-15081
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,7 @@ publish/
152152
*.nuget.g.targets
153153
*.nuget.cache
154154
**/packages/*
155+
*.nuget.dgspec.json
155156
project.lock.json
156157
project.assets.json
157158

Documentation/botr/exceptions.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -301,5 +301,3 @@ Miscellaneous
301301
=============
302302

303303
There are actually a lot of macros involved in EX_TRY. Most of them should never, ever, be used outside of the macro implementations.
304-
305-
One set, BEGIN_EXCEPTION_GLUE / END_EXCEPTION_GLUE, deserves special mention. These were intended to be transitional macros, and were to be replaced with more appropriate macros in the Whidbey project. Of course, they worked just fine, and so they weren't all replaced. Ideally, all instances will be converted during a "cleanup" milestone, and the macros removed. In the meantime, any CLR dev tempted to use them should resist, and instead write EX_TRY/EX_CATCH/EX_CATCH_END or EX_CATCH_HRESULT.

Documentation/botr/ryujit-overview.md

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,9 @@ At this point, a number of analyses and transformations are done on the flowgrap
195195

196196
At this point, a number of properties are computed on the IR, and must remain valid for the remaining phases. We will call this “normalization”
197197

198-
* `lvaMarkLocalVars` – set the reference counts (raw and weighted) for lclVars, sort them, and determine which will be tracked (currently up to 128). Note that after this point any transformation that adds or removes lclVar references must update the reference counts.
198+
* `lvaMarkLocalVars` – if this jit is optimizing, set the reference counts (raw and weighted) for lclVars, sort them, and determine which
199+
will be tracked (currently up to 512). If not optimizing, all locals are given an implicit reference count of one. Reference counts are not incrementally
200+
maintained. They can be recomputed if accurate counts are needed.
199201
* `optOptimizeBools` – this optimizes Boolean expressions, and may change the flowgraph (why is it not done prior to reachability and dominators?)
200202
* Link the trees in evaluation order (setting `gtNext` and `gtPrev` fields): and `fgFindOperOrder()` and `fgSetBlockOrder()`.
201203

@@ -492,7 +494,16 @@ TreeNodeInfo:
492494

493495
## LclVar phase-dependent properties
494496

495-
Prior to normalization, the reference counts (`lvRefCnt` and `lvRefCntWtd`) are not valid. After normalization they must be updated when lclVar references are added or removed.
497+
LclVar ref counts track the number of uses and weighted used of a local in the jit IR. There are two sequences of phases over which ref counts are valid,
498+
tracked via `lvaRefCountState`: an early sequence (state `RCS_EARLY`) and the normal sequence (state `RCS_NORMAL`). Requests for ref counts via `lvRefCnt`
499+
and `lvRefCntWtd` must be aware of the ref count state.
500+
501+
Before struct promotion the ref counts are invalid. Struct promotion enables `RCS_EARLY` and it and subsequent phases through morph compute and uses ref counts
502+
on some locals to guide some struct optimizations. After morph the counts go back to longer being valid.
503+
504+
The `RCS_NORMAL` sequence begins at normalization. Ref counts are computed and generally available via for the rest of the compilation phases.
505+
The counts are not incrementally maintained and may go stale as the IR is optimized or transformed, or maybe very approximate if the jit is not optimizing.
506+
They can be recomputed via `lvaComputeRefCounts` at points where accurate counts are valuable. Currently this happens before and after lower.
496507

497508
# Supporting technologies and components
498509

Documentation/building/unix-test-instructions.md

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,17 +24,13 @@ Please note that this builds the Priority 0 tests. To build priority 1:
2424

2525
During development there are many instances where building an individual test is fast and necessary. All of the necessary tools to build are under `coreclr/Tools`. It is possible to use `coreclr/Tools/MSBuild.dll` as you would normally use MSBuild with a few caveats.
2626

27-
Note that `coreclr/Tools/msbuild.sh` exists as well to make the call shorter.
27+
Note that `coreclr/dotnet.sh` exists as well to make the call shorter.
2828

2929
**!! Note !! -- Passing /p:__BuildOs=[OSX|Linux] is required.**
3030

3131
## Building an Individual Test Example
3232

33-
>`coreclr/Tools/msbuild.sh /maxcpucount coreclr/tests/src/JIT/CodeGenBringUpTests/Array1.csproj /p:__BuildType=Release /p:__BuildOS=OSX`
34-
35-
Or
36-
37-
>`coreclr/Tools/dotnetcli/dotnet coreclr/Tools/MSBuild.dll /maxcpucount coreclr/tests/src/JIT/CodeGenBringUpTests/Array1.csproj /p:__BuildType=Release /p:__BuildOS=OSX`
33+
>`coreclr/dotnet.sh msbuild /maxcpucount coreclr/tests/src/JIT/CodeGenBringUpTests/Array1.csproj /p:__BuildType=Release /p:__BuildOS=OSX`
3834
3935
## Aarch64/armhf multi-arch
4036

Documentation/design-docs/event-counter.md

Lines changed: 26 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -35,23 +35,28 @@ We believe adding some new top-level types will satisfy these requests:
3535
EventCounter(string name, EventSource eventSource);
3636
string DisplayName;
3737
void WriteMetric(float metric);
38-
38+
void AddMetaData(string key, string value);
3939
}
4040

4141
class PollingCounter {
4242
PollingCounter(string name, EventSource eventSource Func<float> getMetricFunction);
4343
string DisplayName;
44+
void AddMetaData(string key, string value);
4445
}
4546

4647
class IncrementingEventCounter {
4748
IncrementingEventCounter(string name, EventSource eventSource);
4849
string DisplayName;
49-
Increment(float increment = 1);
50+
TimeSpan DisplayRateTimeScale;
51+
void Increment(float increment = 1);
52+
void AddMetaData(string key, string value);
5053
}
5154

5255
class IncrementingPollingCounter {
5356
IncrementingPollingCounter(string name, EventSource eventSource, Func<float> getCountFunction);
5457
string DisplayName;
58+
TimeSpan DisplayRateTimeScale;
59+
void AddMetaData(string key, string value);
5560
}
5661

5762

@@ -60,16 +65,18 @@ EventCounter does what it has always done, producing a set of 5 stats (Min/Max/M
6065
On the wire EventCounter and PollingCounter both produce an event with name "EventCounters" and example body:
6166

6267
Payload = {
63-
DisplayName: "Request Bytes"
68+
DisplayName: "Request Bytes",
69+
DisplayRateTimeScale: "1",
6470
Name: "request-bytes",
6571
Mean: 12.32,
66-
StandardDeviation: 2.45
67-
Count: 7
68-
Min: -3.4
69-
Max: 22.98
70-
IntervalSec: 1.00324
71-
Series: "Interval=1"
72-
CounterType: "Mean"
72+
StandardDeviation: 2.45,
73+
Count: 7,
74+
Min: -3.4,
75+
Max: 22.98,
76+
IntervalSec: 1.00324,
77+
Series: "Interval=1",
78+
CounterType: "Mean",
79+
MetaData: "key1=value1,key2=value2,key3=value3"
7380
}
7481

7582

@@ -79,12 +86,14 @@ IncrementingEventCounter and IncrementingPollingCounter, unlike the previous two
7986
On the wire IncrementingEventCounter and IncrementingPollingCounter both produce an event with the name "EventCounters" and example body:
8087

8188
Payload = {
82-
DisplayName: "Exceptions Thrown"
83-
Name: "exceptions-thrown"
84-
Increment: 246
85-
IntervalSec: 1.0043
86-
Series: "Interval=1"
87-
CounterType: "Sum"
89+
DisplayName: "Exceptions Thrown",
90+
DisplayRateTimeScale: "1",
91+
Name: "exceptions-thrown",
92+
Increment: 246,
93+
IntervalSec: 1.0043,
94+
Series: "Interval=1",
95+
CounterType: "Sum",
96+
MetaData: "key1=value1,key2=value2,key3=value3"
8897
}
8998

9099

@@ -99,4 +108,4 @@ For EventCounter and PollingCounter we expect simple viewers to use the display
99108

100109
### Metadata
101110

102-
I added fields for DisplayName and CounterType directly to the payload. Vance suggested adding a 'Metadata' field, which I would be OK with, but I see no benefit to using it for fields we can anticipate will exist in advance, and we already have strongly typed APIs that generate their values. In the future if we added an API that let EventCounter consumers set arbitrary key value pairs on the counter, that seems like the data we'd want to encode in a Metadata string.
111+
To add any optional metadata about the counters that we do not already provide a way of encoding, users can call the `AddMetaData(string key, string value)` API. This API exists on all variants of the Counter APIs, and allows users to add one or many key-value pairs of metadata, which is dumped to the Payload as a comma-separated string value. This API exists so that users can add any metadata about their Counter that is not known to us and is different from the ones we provide by default (i.e. `DisplayName`, `CounterType`, `DisplayRateTimeScale`).

Documentation/project-docs/linux-performance-tracing.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ need to fetch EXACTLY the right version of crossgen for the runtime you happen t
9292
using. If you place the crossgen tool in the same directory as the .NET Runtime DLLs (e.g. libcoreclr.so), then perfcollect can
9393
find it and add the framework symbols to the trace file for you.
9494

95-
Normally when you create a .NET application it just generates the DLL for the code you wrote, using a shared copy of the runtime
95+
Normally when you create a .NET application, it just generates the DLL for the code you wrote, using a shared copy of the runtime
9696
for the rest. However you can also generate what is called a 'self-contained' version of an application and this contains all
9797
runtime DLLs. It turns out that the crossgen tool is part of the Nuget package that is used to create these self-contained apps, so
9898
one way of getting the right crossgen tool is to create a self contained package of any application.
@@ -104,8 +104,8 @@ So you could do the following
104104
> dotnet new console
105105
> dotnet publish --self-contained -r linux-x64
106106
>```
107-
Which creates a new helloWorld application and builds it as a self-contained app. The only subtlty here is that if you have
108-
multiple versions of the .NET Runtime installed the instructcions above will use the latest. As long as your app also uses
107+
Which creates a new helloWorld application and builds it as a self-contained app. The only subtlety here is that if you have
108+
multiple versions of the .NET Runtime installed, the instructions above will use the latest. As long as your app also uses
109109
the latest (likely) then these instructions will work without modification.
110110
111111
As a side effect of creating the self-contained application the dotnet tool will download a nuget package
@@ -127,11 +127,11 @@ issue should go away. This only has to be one once per machine (until you upda
127127
128128
### Alternative: Turn off use of precompiled code
129129
130-
If you don't have the abiltiy to update the .NET Rutnime (to add crossgen), or if the above procedure did not work
131-
for some reasion, there is another approach to getting framework symbols. You can tell the runtime to simply
132-
not use the precompiled framework code. The all code will be Just in time compiled and the special crossgen tool
130+
If you don't have the abiltiy to update the .NET Runtime (to add crossgen), or if the above procedure did not work
131+
for some reason, there is another approach to getting framework symbols. You can tell the runtime to simply
132+
not use the precompiled framework code. The code will be Just in time compiled and the special crossgen tool
133133
is not needed. This works, but will increase startup time for your code by something like a second or two. If you
134-
can tolerate that (you probably can), then this is an alternative. You were already setting envinronment variables
134+
can tolerate that (you probably can), then this is an alternative. You were already setting environment variables
135135
in order to get symbols, you simply need to add one more.
136136
> ```bash
137137
> export COMPlus_ZapDisable=1

Documentation/workflow/RunningTests.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,10 @@ Note: The CoreCLR must be built prior to building an individual test. See first
3131

3232
### Examples
3333

34-
* Using the `msbuild.sh` script
35-
* `coreclr/Tools/msbuild.sh /maxcpucount coreclr/tests/src/JIT/CodeGenBringUpTests/Array1.csproj /p:__BuildType=Release /p:__BuildOS=OSX`
36-
* Calling `MSBuild.dll` directly
37-
* `coreclr/Tools/dotnetcli/dotnet coreclr/Tools/MSBuild.dll /maxcpucount coreclr/tests/src/JIT/CodeGenBringUpTests/Array1.csproj /p:__BuildType=Release /p:__BuildOS=OSX`
34+
* Using the `dotnet.sh` script
35+
* `coreclr/dotnet.sh msbuild /maxcpucount coreclr/tests/src/JIT/CodeGenBringUpTests/Array1.csproj /p:__BuildType=Release /p:__BuildOS=OSX`
3836

3937
## Additional Documents
4038

4139
* [Windows](https://github.com/dotnet/coreclr/blob/master/Documentation/building/windows-test-instructions.md)
42-
* [Non-Windows](https://github.com/dotnet/coreclr/blob/master/Documentation/building/unix-test-instructions.md)
40+
* [Non-Windows](https://github.com/dotnet/coreclr/blob/master/Documentation/building/unix-test-instructions.md)

azure-pipelines.yml

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,22 +9,22 @@ variables:
99
resources:
1010
containers:
1111
- container: ubuntu_1404_arm_cross_build_image
12-
image: microsoft/dotnet-buildtools-prereqs:ubuntu-14.04-cross-e435274-20180426002420
12+
image: mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-14.04-cross-e435274-20180426002420
1313

1414
- container: ubuntu_1604_arm64_cross_build_image
15-
image: microsoft/dotnet-buildtools-prereqs:ubuntu-16.04-cross-arm64-a3ae44b-20180315221921
15+
image: mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-16.04-cross-arm64-a3ae44b-20180315221921
1616

1717
- container: musl_x64_build_image
18-
image: microsoft/dotnet-buildtools-prereqs:alpine-3.6-WithNode-f4d3fe3-20181220200247
18+
image: mcr.microsoft.com/dotnet-buildtools/prereqs:alpine-3.6-WithNode-f4d3fe3-20181220200247
1919

2020
- container: musl_arm64_build_image
21-
image: microsoft/dotnet-buildtools-prereqs:ubuntu-16.04-cross-arm64-alpine10fcdcf-20190208200917
21+
image: mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-16.04-cross-arm64-alpine10fcdcf-20190208200917
2222

2323
- container: centos7_x64_build_image
24-
image: microsoft/dotnet-buildtools-prereqs:centos-7-d485f41-20173404063424
24+
image: mcr.microsoft.com/dotnet-buildtools/prereqs:centos-7-d485f41-20173404063424
2525

2626
- container: centos6_x64_build_image
27-
image: microsoft/dotnet-buildtools-prereqs:centos-6-376e1a3-20174311014331
27+
image: mcr.microsoft.com/dotnet-buildtools/prereqs:centos-6-376e1a3-20174311014331
2828

2929
trigger:
3030
- master
@@ -149,6 +149,12 @@ jobs:
149149
testGroup: outerloop
150150
${{ if eq(variables['Build.DefinitionName'], 'coreclr-outerloop-jitminopts-jitstress1-jitstress2') }}:
151151
testGroup: outerloop-jitminopts-jitstress1-jitstress2
152+
${{ if eq(variables['Build.DefinitionName'], 'coreclr-outerloop-jitstressregs') }}:
153+
testGroup: outerloop-jitstressregs
154+
${{ if eq(variables['Build.DefinitionName'], 'coreclr-outerloop-jitstress2-jitstressregs') }}:
155+
testGroup: outerloop-jitstress2-jitstressregs
156+
${{ if eq(variables['Build.DefinitionName'], 'coreclr-outerloop-gcstress0x3-gcstress0xc') }}:
157+
testGroup: outerloop-gcstress0x3-gcstress0xc
152158

153159
# CI
154160
- ${{ if and(eq(variables['System.TeamProject'], 'public'), in(variables['Build.Reason'], 'IndividualCI', 'BatchedCI')) }}:

build-packages.cmd

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,11 @@ if [!processedArgs!]==[] (
3333

3434
:ArgsDone
3535

36+
call "%__ProjectDir%"\setup_vs_tools.cmd
37+
38+
REM setup_vs_tools.cmd will correctly echo error message.
39+
if NOT '%ERRORLEVEL%' == '0' exit /b 1
40+
3641
call %__ProjectDir%/dotnet.cmd msbuild /nologo /verbosity:minimal /clp:Summary /nodeReuse:false^
3742
/p:__BuildOS=Windows_NT /flp:v=detailed;Append;LogFile=build-packages.log^
3843
/l:BinClashLogger,Tools/Microsoft.DotNet.Build.Tasks.dll;LogFile=binclash.log^

build-test.cmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ set __MsbuildWrn=/flp1:WarningsOnly;LogFile="%__BuildWrn%"
224224
set __MsbuildErr=/flp2:ErrorsOnly;LogFile="%__BuildErr%"
225225
set __Logging=!__MsbuildLog! !__MsbuildWrn! !__MsbuildErr!
226226

227-
call "%__ProjectDir%\msbuild.cmd" /nologo /verbosity:minimal /clp:Summary /nodeReuse:false^
227+
call "%__ProjectDir%\cmake_msbuild.cmd" /nologo /verbosity:minimal /clp:Summary /nodeReuse:false^
228228
/l:BinClashLogger,Tools/net46/Microsoft.DotNet.Build.Tasks.dll;LogFile=binclash.log^
229229
/p:RestoreDefaultOptimizationDataPackage=false /p:PortableBuild=true^
230230
/p:UsePartialNGENOptimization=false /maxcpucount^

build-test.sh

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ build_test_wrappers()
6464
__Logging="$__MsbuildLog $__MsbuildWrn $__MsbuildErr /consoleloggerparameters:$buildVerbosity"
6565

6666
nextCommand="\"${__DotNetCli}\" msbuild \"${__ProjectDir}/tests/runtest.proj\" /p:RestoreAdditionalProjectSources=https://dotnet.myget.org/F/dotnet-core/ /p:BuildWrappers=true /p:TargetsWindows=false $__Logging /p:__BuildOS=$__BuildOS /p:__BuildType=$__BuildType /p:__BuildArch=$__BuildArch"
67-
echo "$nextCommand"
6867
eval $nextCommand
6968

7069
if [ $? -ne 0 ]; then
@@ -587,7 +586,7 @@ __SourceDir="$__ProjectDir/src"
587586
__PackagesDir="$__ProjectDir/packages"
588587
__RootBinDir="$__ProjectDir/bin"
589588
__BuildToolsDir="$__ProjectDir/Tools"
590-
__DotNetCli="${__BuildToolsDir}/dotnetcli/dotnet"
589+
__DotNetCli="$__ProjectDir/dotnet.sh"
591590
__UnprocessedBuildArgs=
592591
__CommonMSBuildArgs=
593592
__MSBCleanBuildArgs=
@@ -879,9 +878,6 @@ initTargetDistroRid
879878

880879
# Override tool directory
881880

882-
__CoreClrVersion=1.1.0
883-
__sharedFxDir=$__BuildToolsDir/dotnetcli/shared/Microsoft.NETCore.App/$__CoreClrVersion/
884-
885881
if [[ (-z "$__GenerateLayoutOnly") && (-z "$__GenerateTestHostOnly") && (-z "$__BuildTestWrappersOnly") ]]; then
886882
build_Tests
887883
elif [ ! -z "$__BuildTestWrappersOnly" ]; then

0 commit comments

Comments
 (0)