Ben Adams [Thu, 31 Oct 2019 09:47:57 +0000 (09:47 +0000)]
Don't needlessly refresh proc count (dotnet/coreclr#27543)
Commit migrated from https://github.com/dotnet/coreclr/commit/
946e57b61a4db9ccb574fc3a754f783208080947
Tomáš Rylek [Thu, 31 Oct 2019 06:40:41 +0000 (23:40 -0700)]
Fix GC stress runs (dotnet/coreclr#27565)
As Jeremy discovered, my recent CoreCLR pipeline optimization change
broke GC stress tests. This change should fix the problem; I have
also deleted the platform-matrix-managed-test-build script that is
no longer used.
Thanks
Tomas
Commit migrated from https://github.com/dotnet/coreclr/commit/
d931f7772e9d7ee9299682fcb43b8d9a0a9429ca
Jakob Botsch Nielsen [Thu, 31 Oct 2019 00:04:21 +0000 (01:04 +0100)]
Fix slow tailcalls to VSD (dotnet/coreclr#27363)
* Fix slow tailcalls to VSDs
This was broken when fgCanFastTailCall was changed to call
fgInitArgInfo. fgInitArgInfo has side effects and will in some cases add
arguments to the arg list. Specifically for calls to VSD, the VSD arg is
added, however this case is treated specially for slow tailcalls and it
does not expect the arg to be here.
This targeted fix just removes this arg from the arg list.
* Reenable more_tailcalls on x64 Windows
* Disable more_tailcalls on Unix, arm32 and arm64
* Address feedback
* Disable STRESS_UNSAFE_BUFFER_CHECKS for more_tailcalls
Commit migrated from https://github.com/dotnet/coreclr/commit/
f4a886369b270d648552d4ae973e1c92d4202b8c
mikedn [Wed, 30 Oct 2019 18:04:06 +0000 (20:04 +0200)]
Enable block init unroll on ARM32 (dotnet/coreclr#27450)
* Enable block init unroll on ARM32
* Small LowerBlockStore cleanup
Commit migrated from https://github.com/dotnet/coreclr/commit/
41546b05e31c0ba72537ec6445176086964717bb
Andy Ayers [Wed, 30 Oct 2019 16:58:06 +0000 (09:58 -0700)]
JIT: add pass to merge common throw helper calls (dotnet/coreclr#27113)
Look for blocks with single statement noreturn calls, and try to reroute
flow so there's just one block call that all predecessors target.
Resolves dotnet/coreclr#14770.
Note this impairs debuggability of optimized code a bit, as it can change which
line of code apparently invokes a throw helper in a backtrace. But since we're
already commoning jit-inserted throw helpers (like array index OOB) this is not
breaking any new ground.
We could also handle commoning BBJ_THROW blocks, with some extra effort,
but prototyping indicates duplicate throws are pretty rare.
This phase runs just before `optOptimizeFlow`, so that we can leverage
the ref counts and predecessor lists to ensure we make correct flow updates.
It doesn't bother trying to clean out IR, that happens naturally as blocks
become unreferenced.
In some cases nothrow helpers end up being tail call candidates. We now suppress
tail calling noreturn methods if there is more than one such call site in the method,
hoping that instead we can merge the calls.
Commit migrated from https://github.com/dotnet/coreclr/commit/
b962c97257400bee07805ccee66cd85d97195b40
Egor Chesakov [Wed, 30 Oct 2019 16:29:25 +0000 (09:29 -0700)]
Add BitwiseSelect (dotnet/coreclr#27430)
Commit migrated from https://github.com/dotnet/coreclr/commit/
a6e54c083708f2711f573b10fcb7217fc008ecb9
Egor Chesakov [Wed, 30 Oct 2019 05:37:04 +0000 (22:37 -0700)]
Add ComputeCrc32, ComputeCrc32C (dotnet/coreclr#27421)
Commit migrated from https://github.com/dotnet/coreclr/commit/
74ec37af01d33b11f788ef20a80403badf13ae99
Egor Chesakov [Wed, 30 Oct 2019 05:36:13 +0000 (22:36 -0700)]
Remove unsigned overloads of LeadingSignCount (dotnet/coreclr#27533)
Commit migrated from https://github.com/dotnet/coreclr/commit/
a9ab3ca5849c601e6843d59febf6f163d5179843
Tomáš Rylek [Wed, 30 Oct 2019 03:57:02 +0000 (20:57 -0700)]
Fix copying of framework assemblies excluded from compilation (dotnet/coreclr#27534)
Commit migrated from https://github.com/dotnet/coreclr/commit/
73a6c7bf96a5671807006ab11e699ee5eb99693f
Elinor Fung [Tue, 29 Oct 2019 22:11:50 +0000 (15:11 -0700)]
Move activity tracking helpers for assembly loads out of ActivityTracker
Commit migrated from https://github.com/dotnet/coreclr/commit/
139e79c08485866fdf5f6245e49a4f65acc7968f
Jan Kotas [Tue, 29 Oct 2019 20:52:38 +0000 (13:52 -0700)]
Move runtime specific methods out of the runtime partition
Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
Commit migrated from https://github.com/dotnet/coreclr/commit/
f1ff212f4c2775d48b1a30cc0842ec9b42178ea8
Carlos Sanchez Lopez [Tue, 29 Oct 2019 22:48:49 +0000 (15:48 -0700)]
Add file creation method that takes an ACL (dotnet/corefxdotnet/coreclr#42099)
Approved API Proposal: dotnet/coreclr#41614
Related change for directory creation method that takes an ACL: dotnet/coreclr#41834 -merged and ported to 3.1 Prev2
Description
We have extension methods in System.IO.FileSystem.AclExtensions that let the user get and set ACLs for existing files, but we do not have methods that create files with predefined ACLs.
.NET ACL (Access Control List) support is Windows specific. This change will reside inside the System.IO.FileSystem.AccessControl assembly.
Customer impact
Before this change, customers had to create a file or filestream, then set its ACLs. This presents a few problems:
Potential security hole as files can be accessed between creation and modification.
Porting difficulties as there isn't a 1-1 API replacement
Stability issues with background processes (file filters) can prevent modifying ACLs right after creation (typically surfaces as a security exception).
This change addresses those problems by adding a new extension method that allows creating a file and ensuring the provided ACLs are set during creation.
This change is expected to be backported to 3.1.
Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
Commit migrated from https://github.com/dotnet/coreclr/commit/
be9323fa75dba520599815b1faa68e19a87a39a9
Stephen Toub [Mon, 28 Oct 2019 17:47:23 +0000 (13:47 -0400)]
Move PreserveDependencyAttribute to shared (dotnet/corefxdotnet/coreclr#42174)
We need to use it in corelib, too.
Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
Commit migrated from https://github.com/dotnet/coreclr/commit/
549ba51466e56dec67056499706213524bfa6c63
Filip Navara [Mon, 28 Oct 2019 17:14:44 +0000 (18:14 +0100)]
Fix building portable thread pool on Windows (dotnet/corertdotnet/coreclr#7849)
Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
Commit migrated from https://github.com/dotnet/coreclr/commit/
c058fad9b54ce3061b862c50f2a85304baf3b5ba
mikedn [Tue, 29 Oct 2019 22:53:59 +0000 (00:53 +0200)]
Enable reuse reg val on ARM32 (dotnet/coreclr#27506)
Commit migrated from https://github.com/dotnet/coreclr/commit/
00e89cf4f9c39ff093fbe9e060bab84cb586fa02
Aaron Robinson [Tue, 29 Oct 2019 22:13:46 +0000 (15:13 -0700)]
Revert removal of SuppressGCTransition from SystemNative_GetTimestamp() (dotnet/coreclr#27473)
* Revert removal of SuppressGCTransition from SystemNative_GetTimestamp()
* Insert GC_POLL before statement with unmanaged call.
* JIT test for insertion of GCPoll
Commit migrated from https://github.com/dotnet/coreclr/commit/
77f64aa03e74496c34ca484d6351263fe978757d
Sergey Andreenko [Tue, 29 Oct 2019 19:01:02 +0000 (19:01 +0000)]
Fix simple general warnings found by PVS. (dotnet/coreclr#27283)
* Delete unused `scAvailable`.
* Delete unused `PhysRegIntervalIterator`.
* Expression is always true.
* Possible overflow.
* Delete unreachable/unused code.
* Two or more case-branches perform the same actions.
* Check self-copying.
* The 'isOnStack' variable is assigned values twice successively.
* The 'then' statement is equivalent to the 'else' statement.
`MAX_COST` is `UCHAR_MAX` so if `unsigned char cost >= MAX_COST` then it is equal to ``MAX_COST`.
So the code was correct, but confusing.
* Expression 'newPage == nullptr' is always true.
* Expression 'inconsistentProfileData' is always false.
* A part of conditional expression is always false: typ == TYP_BOOL.
* A part of conditional expression is always true: emitFullGCinfo.
We have an early return from this function if `emitFullGCinfo == false`.
* A part of conditional expression is always true: asgNode.
We have an early return if it is nullptr.
* delete an unused function with errors.
There were 3 incorrent printf arguments.
* Delete another unused function without return.
* An excessive check can be simplified. The '(A && B) || (!A && !B)' expression is equivalent to the 'bool(A) == bool(B)' expression,
* The expression is of enum type. It is odd that it is used as an expression of a Boolean-type.
* the usage of '#pragma warning(default: X)' is incorrect in this context. The '#pragma warning(push/pop)' should be used instead.
That function and almost the whole file is unused, do we want to delete it?
* The expression 'eeGetHelperNum(method)' is of enum type. It is odd that it is used as an expression of a Boolean-type.
* `nodeThis` and `nodeOther` are always true.
* 'this == nullptr' expression should be avoided - this expression is always false on newer compilers, because 'this' pointer can never be NULL.
Don't compare `this` with null.
* Variables 'm_Cost', 'm_Size' are initialized through the call to the same function. It's probably an error or un-optimized code. Consider inspecting the 'Expr()->GetCostSz()' expression.
* Parameter 'toRefPosition' is not used inside function body.
* Expression 'parentOfArgObj == parentArgx' is always true.
We assigned `parentOfArgObj ` to `parentArgx` and did not change any of them before that check.
* The 'srcCount' variable is assigned values twice successively. Perhaps this is a mistake.
* Response review.
Commit migrated from https://github.com/dotnet/coreclr/commit/
80867d1b5753ea5625b63aecccab1084c84e62af
Drew Scoggins [Tue, 29 Oct 2019 18:34:39 +0000 (11:34 -0700)]
Add osGroup parameter to perf call (dotnet/coreclr#27444)
* Add osGroup parameter to perf call
* Change parameters to match queue schema
* Remove space
Commit migrated from https://github.com/dotnet/coreclr/commit/
9cae8fab0b75539e497c4931bbd2758306abcf85
Adeel Mujahid [Tue, 29 Oct 2019 16:58:17 +0000 (18:58 +0200)]
Delete null comparisons of non-null arguments (dotnet/coreclr#27523)
Remove gcc nonnull-compare suppression and impossible conditions.
> error: nonnull argument 'this' compared to NULL
> [-Werror=nonnull-compare]
Commit migrated from https://github.com/dotnet/coreclr/commit/
4afbe3a43814803bcdc1cefb1e2f2792257cf02f
Vladimir Sadov [Tue, 29 Oct 2019 16:55:27 +0000 (09:55 -0700)]
Reduce frequency of GC long running tests to twice a week. Make Gc simulator tests run nightly, for now. (dotnet/coreclr#27521)
Commit migrated from https://github.com/dotnet/coreclr/commit/
564dcc0525e623578c91e6d0fbe28c9af9e426b4
Jeremy Koritzinsky [Tue, 29 Oct 2019 16:20:33 +0000 (09:20 -0700)]
Fix resolving IBCMerge's path in build.cmd (dotnet/coreclr#27513)
* Resolve IBCMerge's path via NuGetPackageRoot since we never actually restore ibcmerge.csproj directly.
* Additional fixes to get IBCMerge working again.
* Update src/.nuget/optdata/ibcmerge.csproj
Co-Authored-By: Elinor Fung <47805090+elinor-fung@users.noreply.github.com>
Commit migrated from https://github.com/dotnet/coreclr/commit/
ff7c12cc6c208176b76e62c793c3754fe8cac9ed
Egor Chesakov [Tue, 29 Oct 2019 02:02:12 +0000 (19:02 -0700)]
Implement stack probing using helpers on win-arm and linux-arm (dotnet/coreclr#27184)
Commit migrated from https://github.com/dotnet/coreclr/commit/
eae780cfa390ba1ea26f575a7082b961ea473864
Noah Falk [Tue, 29 Oct 2019 00:59:52 +0000 (17:59 -0700)]
Support large EventSource filter args (dotnet/coreclr#27500)
1. Fix NullReferenceException. When the filter args exceeded the
hard-coded size limit GetDataFromController would return data = null.
The code previously asserted that data was not null and triggered NRE
when it was. The fix correctly null checks the value instead of
asserting and uses an empty args dictionary in this case, the same as if
filter args had been empty to begin with.
2. ETW has always limited filter args to 1024 bytes but EventPipe has no
such restriction. When using DiagnosticSourceEventSource it can be
useful to specify a larger filter arg blob. I can't do anything about
ETW's restriction but there is no need for the runtime to force
EventPipe to be equally limited. The larger size also reduces the chance
that we need to hit the fallback path above causing filter args to be
ignored.
Commit migrated from https://github.com/dotnet/coreclr/commit/
857797d9ba9be6f82b83ae6c29b51d490d41cf87
Omair Majid [Tue, 29 Oct 2019 00:13:11 +0000 (20:13 -0400)]
Add a destructor for MethodCallSummarizer (dotnet/coreclr#24088)
The destructor cleans up resources allocated by MethodCallSummarizer
during its normal lifetime.
Commit migrated from https://github.com/dotnet/coreclr/commit/
caaed1b78c3c20dc17e39e2986712264149ae923
Ilia [Mon, 28 Oct 2019 23:20:47 +0000 (02:20 +0300)]
Move required _Unwind_* definitions to src/vm/exceptionhandling.cpp; Remove src/pal/inc/pal_unwind.h (dotnet/coreclr#27509)
Fixes dotnet/coreclr#27503
Commit migrated from https://github.com/dotnet/coreclr/commit/
2773be53ea7e8e1b9297b167c697ccd22f4cfb42
Jan Vorlicek [Mon, 28 Oct 2019 23:13:18 +0000 (16:13 -0700)]
Fix GCStress C issue with the fix to VS2019 optimization (dotnet/coreclr#27507)
* Fix GCStress C issue with the fix to VS2019 optimization
There is a place in the runtime that we hit during GCStress C and that
was creating uninitialized GCFrame and initializing it only
conditionally. In the GCFrame destructor, we always try to pop the
GCFrame out of the per-thread linked list and this was breaking it.
The fix is to always initialize the GCFrame. In the problematic place,
it was not being initialized / pushed on the linked list when number of
GC slots it was to protect was 0. But the logic in GCFrame works just
fine even in that case, so I've made the initialization over there
unconditional.
I've also made a couple of methods in the GCFrame private as they are
never supposed to be called from the outside, removed the default
GCFrame constructor so that noone can create uninitialized GCFrame
anymore and also removed placement new from GCFrame that doesn't seem to
have any purpose.
* Reflect more feedback
* Folded the Pop and Push functions into their callers
* Folded the Initialize to the constructor
Commit migrated from https://github.com/dotnet/coreclr/commit/
eb5d634dc11f7cc4b07bf0d089246feedb28af84
Tomáš Rylek [Mon, 28 Oct 2019 22:07:42 +0000 (15:07 -0700)]
CoreCLR pipeline optimizations (dotnet/coreclr#27059)
Today, R2R compilation of test MSIL using Crossgen happens during
test execution in Helix. This means that the managed artifacts for a
given OS / architecture / config combo are identical for a R2R /
non-R2R job. Additionally, we need very few artifacts for running
the CoreFX tests. In practice it turns out we only need to build the
test host. We can exploit these facts to further reduce the number
of test build jobs in CoreCLR pipelines.
Thanks
Tomas
Commit migrated from https://github.com/dotnet/coreclr/commit/
446c6fe0bfae263bee0c3ace46a5b9a74015e4d1
Jan Kotas [Mon, 28 Oct 2019 18:00:04 +0000 (11:00 -0700)]
Cleanup (dotnet/coreclr#27502)
* Delete empty FireCustomerDebugProbe FCall
* Delete duplicate C++ compiler command line options
Commit migrated from https://github.com/dotnet/coreclr/commit/
8460516ceb23458f7a279bb73aa6176e17e8a90d
Carol Eidt [Mon, 28 Oct 2019 16:00:07 +0000 (09:00 -0700)]
Preparatory changes for EH WriteThru (dotnet/coreclr#26863)
* Preparatory changes for EH WriteThru
- Add a method on BasicBlock to determine EH flow in or out
Commit migrated from https://github.com/dotnet/coreclr/commit/
50750540fa45e44ccc3847fbf5ec9afa4bc6d552
Tomáš Rylek [Mon, 28 Oct 2019 15:11:49 +0000 (08:11 -0700)]
Switch Crossgen2 over to the new command-line parser (dotnet/coreclr#27489)
With this change, Crossgen2 passes basic validation. If possible,
I would love to be able to merge this in ASAP as it's of paramount
importance for our repo consolidation efforts. I'll be happy to
follow up cleaning this change as necessary.
1) Update to a newer version of the System.CommandLine.Experimental
package enabling more general binding syntax needed for unambiguous
binding of multi-value arguments vs. options.
2) Explicitly specify arity for multi-value options as for whatever
reason the default maximum is 255 (lower than the number of reference
assemblies in Core_Root, for instance).
3) Reference paths cannot be bound to FileInfo[] as their syntax
supports wildcards.
Thanks
Tomas
Commit migrated from https://github.com/dotnet/coreclr/commit/
627fb420a81ba83b711ca1b6c9db2eb8c4660e42
Adeel Mujahid [Mon, 28 Oct 2019 13:40:24 +0000 (15:40 +0200)]
Cast SIMD size value to unsigned explicitly (dotnet/coreclr#27487)
Commit migrated from https://github.com/dotnet/coreclr/commit/
65d1d6cca2595cd05b80ab20e36b64dee869fd86
Jan Kotas [Mon, 28 Oct 2019 12:08:15 +0000 (05:08 -0700)]
Streamline default ctor path in reflection on custom attributes (dotnet/coreclr#27451)
Saves some allocations and removes a few FCalls/QCalls
Commit migrated from https://github.com/dotnet/coreclr/commit/
0a62070eb35da65eef13cac66a66e302bf44e563
Vladimir Sadov [Mon, 28 Oct 2019 06:07:48 +0000 (23:07 -0700)]
Put `GCSimulatorTest` tests into a separate pipeline. (dotnet/coreclr#27192)
* GcSimulator pipeline and tests
* Disable GC-sim tests on Linux x64 for now until OOMs are resolved.
Commit migrated from https://github.com/dotnet/coreclr/commit/
a4da38a23e25ad93c9cfa1c676cc5c3f720755c0
Dan Moseley [Mon, 28 Oct 2019 03:26:10 +0000 (20:26 -0700)]
Log path in a particular BIFE (dotnet/coreclr#27469)
Commit migrated from https://github.com/dotnet/coreclr/commit/
68e07f1fd68aa1aa568c6de571c44a388d3710bd
Elinor Fung [Mon, 28 Oct 2019 02:22:53 +0000 (19:22 -0700)]
Basic infrastructure for binder tracing (dotnet/coreclr#27383)
Commit migrated from https://github.com/dotnet/coreclr/commit/
f55bc3a97fc0dc0d17e1c05495c0f6e2d494af73
Adeel Mujahid [Sun, 27 Oct 2019 22:50:03 +0000 (00:50 +0200)]
Use named nested anonymous types (dotnet/coreclr#27485)
Commit migrated from https://github.com/dotnet/coreclr/commit/
b46c8577cca18f42ff43783f1cdb27f4866cb73a
Jan Vorlicek [Sun, 27 Oct 2019 21:50:56 +0000 (14:50 -0700)]
Fix GCRefMap generation in crossgen2 (dotnet/coreclr#27484)
There was a bug in the index table - it was pointing to the last
GCRefMap in the previous stride instead of the first one in the new
stride.
I've modified R2RDump too to use the index table when loading GCRefMaps.
While it was not incorrect, the fact that it was not using the index
table has hidden this issue. Now it uses the same algorithm as the
runtime.
Commit migrated from https://github.com/dotnet/coreclr/commit/
7f7f0e54713a6a7fcf3d2bdc7a15caa58eaec5f6
Jan Kotas [Sun, 27 Oct 2019 20:57:01 +0000 (13:57 -0700)]
Avoid __declspec(uuid(x)) for better portability (dotnet/coreclr#27482)
Commit migrated from https://github.com/dotnet/coreclr/commit/
822cdffb88b6acbeae7d3ee1fb3fe28d90b2ba92
Stephen Toub [Sun, 27 Oct 2019 20:48:18 +0000 (16:48 -0400)]
Fix StreamReader to pass cancellation token into ReadBufferAsync (dotnet/coreclr#27464)
ReadAsyncInternal is correctly passing its token into the two call sites where it delegates directly to the underlying stream, but in one place it calls through ReadBufferAsync, which is currently not defined to take a token. Fix that, and pass the token through.
Commit migrated from https://github.com/dotnet/coreclr/commit/
5d0be1504e1dd5e2b8064b6a87cdf1023c7d4afa
Dan Moseley [Sun, 27 Oct 2019 19:11:21 +0000 (12:11 -0700)]
Remove empty lines caused by empty fusion log string (dotnet/coreclr#27471)
* Remove empty lines caused by empty fusion log string
* Remove fusion log more
Commit migrated from https://github.com/dotnet/coreclr/commit/
7cdde63900a258a26a758f13107766e60e84596a
Jan Kotas [Sun, 27 Oct 2019 12:31:10 +0000 (05:31 -0700)]
Delete unnecessary abstraction from stubbed out SecurityElement (dotnet/coreclr#27474)
The stubbed out SecurityElement implementation does not support extensibility that ISecurityElementFactory was designed for.
Commit migrated from https://github.com/dotnet/coreclr/commit/
b64c20169d2f91130351ba30971be75fb623f58a
Jan Kotas [Sun, 27 Oct 2019 12:30:55 +0000 (05:30 -0700)]
Cleanup unused internal COM interfaces (dotnet/coreclr#27477)
Regenerated prebuilt *.idl/*_i.cpp
Commit migrated from https://github.com/dotnet/coreclr/commit/
34c5c62de536617f05107634711e5dacd68413be
Vitek Karas [Sun, 27 Oct 2019 06:53:49 +0000 (23:53 -0700)]
Remove internal binder flags (dotnet/coreclr#27476)
Removed flags:
* Dynamic bind flags were only used for one assert - which is obviously always true (otherwise it would fail)
* Ignore dynamic bind flag was never used.
* Bind cache failures flags was on the other hand always used - so hardcode it directly
* Change the other flags to simple booleans as it makes the code easier to read (and there are now only 2 such flags). Also renamed:
* cache rerun -> skip failure caching
* ignore ref/def match -> skip version compatibility check
Minor additional cleanup
Commit migrated from https://github.com/dotnet/coreclr/commit/
7c5a46c27f2120528b13e7db78521134531e5edc
Tanner Gooding [Sun, 27 Oct 2019 06:48:05 +0000 (23:48 -0700)]
Removing IsSIMDVectorAssembly and obsoleting isInSIMDModule (dotnet/coreclr#27467)
* Removing IsSIMDVectorAssembly from the VM layer
* Removing SimdHelper from crossgen2
* Obsoleting isInSIMDModule in the VM layer
* Renaming isInSIMDModule to isIntrinsicType
* Implementing isIntrinsicType for the JIT/EE interface
* Update JITEEVersionIdentifier
* Update crossgen2 JITEEVersionIdentifier
Commit migrated from https://github.com/dotnet/coreclr/commit/
ca6c03eed7d38819b8b093b7ee6098a4c69cd6c8
Vitek Karas [Sun, 27 Oct 2019 06:46:40 +0000 (23:46 -0700)]
Binder utils cleanup (dotnet/coreclr#27475)
* Binder utils cleanup
* Binder startup cleanup
Commit migrated from https://github.com/dotnet/coreclr/commit/
e4c043dff38e38f15b1f8e4aa32f8919a18166bd
Dan Moseley [Sun, 27 Oct 2019 05:47:15 +0000 (22:47 -0700)]
Add path to not-absolute-path exception (dotnet/coreclr#27470)
Commit migrated from https://github.com/dotnet/coreclr/commit/
4a24657e1f44a21782feec10b048d193f29052fa
Jan Vorlicek [Sat, 26 Oct 2019 22:47:06 +0000 (15:47 -0700)]
Fix vs2019 optimization issue take 2 (dotnet/coreclr#27452)
* Revert "Fix the problem with the VS2019 fix on x86 (dotnet/coreclr#26957)"
This reverts commit dotnet/coreclr@
4081d86f221e6694f0dfd13b99e0d5b1045d2e89.
* Revert "Fix issue with locals overlapping out of scope GCFrame (dotnet/coreclr#26763)"
This reverts commit dotnet/coreclr@
6059e75e13593b0820e178f8baaace32c09aca6e.
* Fix VS2019 optimization issue take 2
* Stop using FrameWithCookie for GCFrame
* Removed call to SetHasPromotedBytes, the function, the field on
thread and its getter / setter as it is not used for anything.
* Updated ifdefs on GetGCFrame and GetFrame
Commit migrated from https://github.com/dotnet/coreclr/commit/
d815d217f1930c4443834db41f172474953ede9b
dotnet-maestro[bot] [Sat, 26 Oct 2019 20:48:50 +0000 (13:48 -0700)]
[master] Update dependencies from dotnet/corefx (dotnet/coreclr#27431)
* Update dependencies from https://github.com/dotnet/corefx build
20191024.13
- Microsoft.NETCore.Platforms - 5.0.0-alpha.1.19524.13
- Microsoft.Private.CoreFx.NETCoreApp - 5.0.0-alpha.1.19524.13
* Update dependencies from https://github.com/dotnet/corefx build
20191024.14
- Microsoft.NETCore.Platforms - 5.0.0-alpha.1.19524.14
- Microsoft.Private.CoreFx.NETCoreApp - 5.0.0-alpha.1.19524.14
* Update dependencies from https://github.com/dotnet/corefx build
20191025.6
- Microsoft.NETCore.Platforms - 5.0.0-alpha.1.19525.6
- Microsoft.Private.CoreFx.NETCoreApp - 5.0.0-alpha.1.19525.6
* Workaround https://github.com/dotnet/coreclr/issues/27465
Commit migrated from https://github.com/dotnet/coreclr/commit/
cfdec444348ab26e151c33cd3aa79a8a3cff36b0
Sinan Kaya [Sat, 26 Oct 2019 16:34:16 +0000 (12:34 -0400)]
Can't declare variable and also have extern c (dotnet/coreclr#27457)
* Can't declare variable and also have extern c
* Remove extern c from variable declartion
Commit migrated from https://github.com/dotnet/coreclr/commit/
9b832e6eee9c1e93e2bfa4422d9c91a0f6da9452
Jan Vorlicek [Sat, 26 Oct 2019 15:18:52 +0000 (08:18 -0700)]
Enable building with clang 9 (dotnet/coreclr#27415)
* Enable building with clang 9
Update the docker images that we use for building.
* Add missing clang9 option to build.sh / build-test.sh
* Fix clang version matching and MUSL build
* Prevent Clang 9 from optimizing out s_gsCookie write
Commit migrated from https://github.com/dotnet/coreclr/commit/
33905fb9a95f955d3554120d19632d81e8c885f6
Yoh Deadfall [Sat, 26 Oct 2019 14:56:52 +0000 (17:56 +0300)]
Removed unused strings from resources (dotnet/coreclr#27304)
Commit migrated from https://github.com/dotnet/coreclr/commit/
6f2791fd0555e5d13ead6484736216e952efc20e
pi1024e [Sat, 26 Oct 2019 14:56:03 +0000 (10:56 -0400)]
Removing unneeded function calls and empty bodies (dotnet/coreclr#27420)
Commit migrated from https://github.com/dotnet/coreclr/commit/
9a60a6e7e8622adfb1848a7af7d42207f29ec3c4
Ben Adams [Sat, 26 Oct 2019 13:57:12 +0000 (14:57 +0100)]
Avoid mod operator when fast alternative available (dotnet/coreclr#27299)
Commit migrated from https://github.com/dotnet/coreclr/commit/
e532bf642a3a381d53ff52c234f29deb7d11e7a0
Sinan Kaya [Sat, 26 Oct 2019 11:49:45 +0000 (07:49 -0400)]
Remove extra qualifier (dotnet/coreclr#27455)
Commit migrated from https://github.com/dotnet/coreclr/commit/
a2f10df4c15f1d78e7bced554b6797bfaa42fda9
Sinan Kaya [Sat, 26 Oct 2019 11:43:43 +0000 (07:43 -0400)]
Cleanup SELECTANY (dotnet/coreclr#27459)
Commit migrated from https://github.com/dotnet/coreclr/commit/
7e113634633a077eef77e85af9557d77f1b08750
Stephen Toub [Sat, 26 Oct 2019 00:57:13 +0000 (20:57 -0400)]
Avoid unnecessary allocations in Exception.ToString
Commit migrated from https://github.com/dotnet/coreclr/commit/
373a7b2ea2b6067a6a12775dd54a9e20dd0190d1
Stephen Toub [Sat, 26 Oct 2019 00:44:13 +0000 (20:44 -0400)]
Use ValueStringBuilder instead of StringBuidler{Cache} in multiple places
Commit migrated from https://github.com/dotnet/coreclr/commit/
29694529dcae65e75e7917126c56e88fc4596332
Sinan Kaya [Sat, 26 Oct 2019 06:24:51 +0000 (02:24 -0400)]
Remove class declarator (dotnet/coreclr#27456)
Commit migrated from https://github.com/dotnet/coreclr/commit/
6fe16376353a4cd7912f81a70163dac3c74bcfb4
Vladimir Sadov [Sat, 26 Oct 2019 01:45:06 +0000 (18:45 -0700)]
Faster conversions (dotnet/coreclr#23548)
Improved performance of complex casts by caching results of cast analysis.
* Easy out for same types.
* Introduce cast cache
* Use managed heap for the cache
* Fixes. Get rid of a fake array typedesc.
* TypeDesc conversions caching
* Removed NoGC helpers
* Cache typedesc conversions
* Renamed remaining trivial NoGC casting helpers
* Some cleanups. Comments, redundant code.
* PR feedback.
Commit migrated from https://github.com/dotnet/coreclr/commit/
a55a7eb68951ca47b0241ef6cb79287f9fd554e1
Tomáš Rylek [Fri, 25 Oct 2019 22:45:19 +0000 (15:45 -0700)]
Switch R2RDump over to the new command line parser (dotnet/coreclr#27440)
This change modifies R2RDump to use the new
System.CommandLine.Experimental module instead of the obsoleted
System.CommandLine parser we were using before. Apart from general
hygiene w.r.t. using up-to-date components one practical reason
for this switch-over is that the old parser is only available on
the unreliable myget.org nuget feed we plan to drop as part of
our planned repo consolidation.
During debugging of the change I noticed a bug in the implementation
of the "--verbose" option - it shouldn't be setting EntryPoints,
otherwise we actually end up with a super-terse output including
just the entry points. I have anecdotally verified that, after fixing
this in both the "new" and "old" R2RDump both produce identical output.
Thanks
Tomas
Commit migrated from https://github.com/dotnet/coreclr/commit/
a0d03272dbe691005d74edff73a36c012d38fa1b
Ilia [Fri, 25 Oct 2019 22:28:05 +0000 (01:28 +0300)]
Profiler API to modify environment variables (dotnet/coreclr#23383) (dotnet/coreclr#27157)
Commit migrated from https://github.com/dotnet/coreclr/commit/
457449f412b4b1fa1f8248cb1632de7d528e09db
Andrew Au [Fri, 25 Oct 2019 22:17:04 +0000 (15:17 -0700)]
[crossgen2] Avoid ambiguous devirtualization (dotnet/coreclr#27424)
Commit migrated from https://github.com/dotnet/coreclr/commit/
d374f8c99e7092470366a88ea2abc1001d05864f
Fadi Hanna [Fri, 25 Oct 2019 21:58:58 +0000 (14:58 -0700)]
Packaging for crossgen2 as a framework dependent application. (dotnet/coreclr#27296)
* Packaging for crossgen2 as a framework dependent application.
This requires us to manually emit a runtimeconfig json for now, since the build produces a self-contained version of crossgen2.
Also includes some minor cleanups to the way we build crossgen2:
- Removed from build.proj since we explicitly build it as a self-contained application from build.cmd/build.sh
- Removed the output path property from the csproj files. We use an explicit -o argument when publishing to specify the output folder
Commit migrated from https://github.com/dotnet/coreclr/commit/
02169dec1324f712dc0d102d1147008e1992a46b
Jeremy Koritzinsky [Fri, 25 Oct 2019 21:45:33 +0000 (14:45 -0700)]
Use Unsafe.IsNullRef instead of manual IL in HandleMarshaler.C… (dotnet/coreclr#27443)
Commit migrated from https://github.com/dotnet/coreclr/commit/
a8c9959a96507a745923bb548e8946bd94ffbbf2
Jeremy Koritzinsky [Fri, 25 Oct 2019 21:10:10 +0000 (14:10 -0700)]
Use global packages cache for local builds by default in CoreC… (dotnet/coreclr#27373)
* Get the product build to use the global package cache only.
* Move external.csproj out to the tests folder. Fix restore location so external.csproj correctly resolves its nuget-generated props/targets files.
* Fix typo.
* Fix expected failure case on platforms that don't support PGO/IBC.
* Don't error out if optimization data is not supported for the current platform.
* Fix casing that was causing the Linux x64 build to fail to find the pgo/ibc packages.
* Fix condition.
* Pass OS-Arch-Config to external test package restore.
* The platform-specific version of Microsoft.NETCore.CoreDisTools is an older version for non-Windows, so hardcode that version in stress_dependencies.csproj
Commit migrated from https://github.com/dotnet/coreclr/commit/
f0887c4aea35f503dd212f0dab997f79d9f96f85
Michal Strehovský [Fri, 25 Oct 2019 19:46:08 +0000 (21:46 +0200)]
Match HasLayoutMetadata to CoreCLR (dotnet/coreclr#27438)
This caught my attention because I was messing with `IsBlittableType`.
The condition `type.BaseType.IsValueType` is never true because one can never have a type whose base type is a valuetype.
I was trying to find out where this code is coming from so I can fix it only to realize it was silently deleted in dotnet/coreclr#23015.
Commit migrated from https://github.com/dotnet/coreclr/commit/
510dd30127777d85ea8831bdc474397a0b2070a8
mikedn [Fri, 25 Oct 2019 17:56:34 +0000 (20:56 +0300)]
Fix block store local address containment on ARM (dotnet/coreclr#27338)
When the source/destination address was local, genCodeForCpBlkUnroll was folding the local offset into the address mode of the generated load/store instructions as if the local address was contained. But lowering didn't actually contain the address so useless ADD instructions were still being generated.
Commit migrated from https://github.com/dotnet/coreclr/commit/
4d6fae3c42789f139e5a7c05207554bd76983780
Vladimir Sadov [Fri, 25 Oct 2019 17:14:45 +0000 (10:14 -0700)]
Use half-fences for volatile loads/stores on Windows ARM64 (dotnet/coreclr#27384)
* Use half-fences for volatile load/stores on Windows ARM64
* Updated Volatile.h in gc/env as well.
unified on type names and warning suppression.
Commit migrated from https://github.com/dotnet/coreclr/commit/
c128dbacaac207364b01c2d16890031e5aab47a4
Stephen Toub [Fri, 25 Oct 2019 17:13:27 +0000 (13:13 -0400)]
Share completed Task between Task and AsyncTaskMethodBuilder (dotnet/coreclr#27437)
Commit migrated from https://github.com/dotnet/coreclr/commit/
ed525baf3af93ccbd1fc564126eb404173600a90
Jan Vorlicek [Fri, 25 Oct 2019 16:11:10 +0000 (09:11 -0700)]
Fix race in SuperILC logger cleanup (dotnet/coreclr#27414)
The StandardOutputEventHandler and StandardErrorEventHandler can race
with the CleanupLogWriter, resulting in an exception due to an attempt
to write to a disposed TextWriter.
This change fixes it.
Commit migrated from https://github.com/dotnet/coreclr/commit/
8ef3510dc8de2c45afd48f8ba55b606d8e6d0c0a
Ilia [Fri, 25 Oct 2019 14:49:14 +0000 (17:49 +0300)]
Fix macro-redefined warnings caused by limits.h & float.h (dotnet/coreclr#23522)
* Do not use ULONG_MAX in favor of UINT32_MAX
* Do not use LONG_MAX in favor of INT32_MAX
Fixed size 32-bit LONG_MAX conflicts with standard macros
in limits.h on LP64 systems.
* Do not use FLT_MAX, and DBL_MAX macros when STDCPP_COMPAT is defined
* Do not define LONG_MIN, LONG_MAX, ULONG_MAX in pal/inc/pal.h
* Remove duplicated *_MAX macros in pal/inc/rt/intsafe.h
Fixes dotnet/coreclr#20784
Commit migrated from https://github.com/dotnet/coreclr/commit/
fa4a86b1dc5aa021981df70ffd628d68e100beb5
Ilia [Fri, 25 Oct 2019 14:41:20 +0000 (17:41 +0300)]
Remove LOCK_WRITE enum value (in pal/inc/rt/objidl.h) because it conflicts with fcntl.h on Linux (dotnet/coreclr#27426)
It also completely removes LOCKTYPE enum.
Fixes dotnet/coreclr#27386
Commit migrated from https://github.com/dotnet/coreclr/commit/
1cb29bdd266a8624601003fb8ea2ebd2534aab8f
Austin Wise [Fri, 25 Oct 2019 14:40:55 +0000 (07:40 -0700)]
Cleanup some code and comments leftover from BlockCopy refactor (dotnet/coreclr#27432)
* Remove orphaned FCall GetRawArrayData.
* Update some comments relating to arrays.
Commit migrated from https://github.com/dotnet/coreclr/commit/
797dbc65d8fa30a95523f0e355538d9b7dcd8a32
Vladimir Sadov [Fri, 25 Oct 2019 02:39:23 +0000 (19:39 -0700)]
Switch to VS2019 BuildPool (dotnet/coreclr#27427)
Commit migrated from https://github.com/dotnet/coreclr/commit/
cea2bba3c295c5280d01900f7ae5492951ad8995
Vladimir Sadov [Fri, 25 Oct 2019 00:55:33 +0000 (17:55 -0700)]
Update Corelib to include Stopwatch (dotnet/coreclr#27417)
* Update Corelib to include Stopwatch
* Delete HighPerformanceCounter
Commit migrated from https://github.com/dotnet/coreclr/commit/
168a79e33fbe4ee16b87e297bd02fa8fb5c47104
Aaron Robinson [Thu, 24 Oct 2019 23:43:34 +0000 (16:43 -0700)]
Retarget SuppressGCTransitionAttribute to System.Runtime instead of SPCL. (dotnet/coreclr#27419)
Commit migrated from https://github.com/dotnet/coreclr/commit/
5c88b29d1bf3b33359ff5f7248e02a8109cbaba3
Jan Kotas [Thu, 24 Oct 2019 15:32:23 +0000 (08:32 -0700)]
Fix build break
Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
Commit migrated from https://github.com/dotnet/coreclr/commit/
cbe4a98371c29a4245418af70dfef5e4e6bd636c
Michal Strehovský [Thu, 24 Oct 2019 19:33:34 +0000 (21:33 +0200)]
Add test coverage for unsupported marshal scenarios (dotnet/coreclr#27393)
* Pointers to non-blittable structs are not supported
* SizeParamIndex could be bogus
Commit migrated from https://github.com/dotnet/coreclr/commit/
f1a900df6554a682b2816b64958f80055407e955
Jeremy Koritzinsky [Thu, 24 Oct 2019 18:29:38 +0000 (11:29 -0700)]
Implement struct marshalling via IL Stubs instead of via Field… (dotnet/coreclr#26340)
* First pass on adding support for byref field homes to il marshalers.
Remove dead code for calculating managed field size.
Add field IL marshal infra up to MarshalInfo::GenerateFieldIL.
Add preliminary changes for MarshalInfo ctor to have the logic handle field marshalling logic. Still need to handle WinRT struct field logic correctly.
First shot at handling fields of WinRT structs.
Cleanup
Clean up entrypoints
Fix cleanup marshal emit.
Disable specific paths on struct marshal stubs.
Implement emitting full struct marshalling stub.
Add StructMarshalInteropStub method name.
Add NDirect::CreateMarshalILStub
Get byvalue StructMarshalling/PInvoke tests passing excluding missing ILMarshalers (ByValArray and ByValTStr).
Correctly classify struct marshal stubs as struct marshal stubs instead of PInvoke stubs.
Implement UnmanagedType.ByValArray IL marshaler.
Implement ILMarshaler equivalent for ansi-char fixed arrays.
Fix parameter mismatch in Native->CLR direction for struct marshalling.
Implement ByValTStr marshalling. Support unaligned fields in IL stubs.
Load CleanupWorkList from param list if in a struct marshalling stub
Implement SafeHandle and CriticalHandle field marshalling in IL struct stubs
Fix handle field marshalers. Add error reporting in struct field IL marshalers consistent with old FieldMarshaler error reporting.
Convert Array-of-nonblittable-struct marshalling to use IL stubs.
Convert LayoutClass marshalling to use IL stubs.
Fix marshalling of LayoutClass fields in structs.
Add non-blittable fixed buffer assert in the struct IL stub path.
Implement Marshal APIs via the IL stubs.
Fix default char marshaler selection.
Move hidden-length-array marshalling over to struct marshalling stubs.
Convert struct marshal IL stub users to use helper that will automatically cleanup on failure to marshal.
Match MarshalInfo::MarshalInfo behavior to ParseNativeType for fields.
Remove old FieldMarshaler-based marshalling.
Fix signed/unsigned mismatch.
Fix IsFieldScenario on non-COMINTEROP plaforms
Fix off-Windows build.
Handle automatic partial cleanup of struct marshaling entirely within the struct stub.
Remove now-unused ValueClassMarshaler. Move DateMarshaler to managed since it doesn't need to be an FCall.
Error out on recursive struct definitions in the IL stub generation as we did in the field marshalling.
Remove FieldMarshalers and replace with a significantly simpler structure (NativeFieldDescriptor) that stores only the needed info for determining validity in WinRT, blittability, and calling convention classification.
This will save 4/8 bytes for every field in a non-auto-layout structure or class loaded into the runtime.
Add explicit test for recursive native layout.
Allow marshalling as UnmanagedType.Error on all platforms (on non-Windows the behavior matches UnmanagedType.I4).
Collapse common primitive marshalling cases together.
Disable WinRT parameter/retval-only marshalers in field scenarios.
Revert "Collapse common primitive marshalling cases together."
This reverts commit dotnet/coreclr@
e73b78a5bca80009fb541f5119301329599a16ad.
Fix error marshalling off Windows for uint.
Disable LPStruct marshalling in structs.
Disable copy-constructor marshaler in the field scenario.
Match error messages between MarshalInfo::MarshalInfo and ParseNativeType in the field scenario.
Refactor managed-sequential check out of ParseNativeType.
Remove invalid MARSHAL_TYPE_GENERIC_U8 references.
Add override specifier.
Change ParseNativeType to use MarshalInfo::MarshalInfo to calculate field marshalling info instead of maintaining two native field classification functions.
Clean up native field categories. Remove nsenums.h since it is now unused.
Move CheckIfDisqualifiedFromManagedSequential to class.cpp.
Encapsulate stub flags for struct stubs. Read the BestFitAttribute once for the type instead of per field.
Fix perf regression in by-val arrays of non-blittable structures by caching the MethodDesc* to the struct stub in the "managed marshaler" structure. Now we have a perf improvement!
Fix memory leak in sig creation.
Keep compile-time information for struct stubs around as long as the owning loader allocator (instead of leaking).
Allocate the signature on the same heap as the IL stubs so it shares the same lifetime.
Fix build with fragile NGen support enabled so as to not break partners.
Add missing native field descriptors.
Fix clang build.
Only assert if we're emitting IL (so we don't assert during type-load).
Determine desciptor for pointer-sized fields based on target not host pointer size.
Don't emit IL stubs that call struct stubs into R2R images since there's not a good way for us to emit the token.
Fix tracing test failures.
Force field marshaling to not stackalloc.
Cache Sytem.RuntimeMethodInfoStub instances created in the VM in the MethodDesc's owning LoaderAllocator.
Struct marshal stubs don't have an MethodDesc context arg.
Copy FieldDesc on NFD assignment.
Fix initialization of stubMethodInfoCache lock owner.
Fix alignment calculation of decimal fields and decimal array fields in NFDs.
Fix Crst leveling.
Enable handling decimal-as-currency fields accurately off-Windows.
Fix deadlock where two threads are both trying to generate an IL stub for the same P/Invoke and one of the parameters needs a struct stub generated.
Fix incorrect check for if we need a struct marshal stub in some of the variant/array cases.
We never need to promote a field value to 8 bytes.
Fix issue with recursive pointer fields.
Shortcut blittable types in stubhelpers.
Use LDFTN + PREPARE_NONVIRUTAL_CALLSITE_USING_CODE instead of LDTOKEN + GetInternalToken.
Revert "Fix Crst leveling."
This reverts commit dotnet/coreclr@
1d8e56e077bc9863b71fe5f9e948308849aa3a14.
Revert "Fix initialization of stubMethodInfoCache lock owner."
This reverts commit dotnet/coreclr@
a095390646d234fdd13f97f620c0af03ffb71d6a.
Revert "Cache Sytem.RuntimeMethodInfoStub instances created in the VM in the MethodDesc's owning LoaderAllocator."
This reverts commit dotnet/coreclr@
726653835b6ee0e3ce03d70600732021f3ea2a53.
Fix case where struct marshal stub is unused in native-only mashalling paths.
PR Feedback.
Clean up terenary statement in dispatchinfo.cpp
Cleanup ILStubResolver::AllocGeneratedIL a little bit.
* Cleanup LayoutClass test.
* Encapsulate getting the entrypoint of a struct marshal stub.
* VTHACK_NONBLITTABLERECORD is only used for hidden-length array marshalling, and VT_RECORD is not used in hidden-length array marshalling.
* Align new entries in mtypes.h
* Whitespace and field ordering changes.
Commit migrated from https://github.com/dotnet/coreclr/commit/
549d53289620fdd19fd71b4fb18f9889d1fbbb0d
Mike McLaughlin [Thu, 24 Oct 2019 17:44:59 +0000 (10:44 -0700)]
Fix minidumps not loading in VS issue (dotnet/coreclr#27406)
Fix a function that was ifdef'ed needed for the metadata locator callbacks to work.
Fix some not properly DAC'ized code in the type desc and server GC code. Caused an exception during dump generation.
Commit migrated from https://github.com/dotnet/coreclr/commit/
0a048b8e88764abb9056ae1e0d2a5c946b120b45
Adam Sitnik [Thu, 24 Oct 2019 16:45:57 +0000 (18:45 +0200)]
Optimize GC.AllocateUninitializedArray and use it in StringBuilder (dotnet/coreclr#27364)
* use GC.AllocateUninitializedArray for allocating internal char buffers
* force inlining of AllocateUninitializedArray to have no perf hit on the small buffers hot path
* insrease the threshold from 256 to 2048 bytes
* use Unsafe.As instead of a cast
* remove the size precondition from AllocateNewArray method, the called AllocateSzArray is responsible for handling negative size
Commit migrated from https://github.com/dotnet/coreclr/commit/
c382edf50b2aadfc4f39d16fc53ea65ed35331e3
Michal Strehovský [Thu, 24 Oct 2019 16:11:01 +0000 (18:11 +0200)]
Add doc on p/invoke marshalling pregeneration in ReadyToRun (dotnet/coreclr#27413)
Commit migrated from https://github.com/dotnet/coreclr/commit/
7bc2158ff0a26ca639503b327ba79bd21183fd58
Tanner Gooding [Thu, 24 Oct 2019 16:01:00 +0000 (09:01 -0700)]
Move down S.N.Vector APIs and expose new conversion support (dotnet/coreclr#27401)
* Updating S.P.Corelib to start building Vector2/3/4 and supporting types
* Removing HAS_INTRINSICS usages from Matrix4x4
Commit migrated from https://github.com/dotnet/coreclr/commit/
72338012f64849a996bf171c9c1b66cc20c64728
Vladimir Sadov [Thu, 24 Oct 2019 12:23:17 +0000 (05:23 -0700)]
Moving StopWatch to `src\Common\src\Corelib` (dotnet/corefxdotnet/coreclr#42072)
Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
Commit migrated from https://github.com/dotnet/coreclr/commit/
b6195fac6c93af4db8caf0cc66b57a90bb82676a
Egor Chesakov [Thu, 24 Oct 2019 05:07:37 +0000 (22:07 -0700)]
Add AdvSimd (LeadingZeroCount, LeadingSignCount, PopCount) (dotnet/coreclr#27382)
* AdvSimd.LeadingSignCount
* AdvSimd.LeadingZeroCount
* AdvSimd.PopCount
Commit migrated from https://github.com/dotnet/coreclr/commit/
310f71592b1373297a98ae268f795ca6dedd62e6
Jan Kotas [Thu, 24 Oct 2019 03:01:34 +0000 (20:01 -0700)]
Delete FEATURE_LAZY_COW_PAGES (dotnet/coreclr#27359)
Commit migrated from https://github.com/dotnet/coreclr/commit/
c86a446744f533998cb1e2f81971837a46d20184
Stephen Toub [Thu, 24 Oct 2019 00:39:19 +0000 (20:39 -0400)]
Enable pooling for `async ValueTask/ValueTask<T>` methods (dotnet/coreclr#26310)
Today `async ValueTask/ValueTask<T>` methods use builders that special-case the synchronously completing case (to just return a `default(ValueTask)` or `new ValueTask<T>(result))` but defer to the equivalent of `async Task/Task<T>` for when the operation completes asynchronously. This, however, doesn't take advantage of the fact that value tasks can wrap arbitrary `IValueTaskSource/IValueTaskSource<T>` implementations.
This commit gives `AsyncValueTaskMethodBuilder` and `AsyncValueTaskMethodBuilder<T>` the ability to use pooled `IValueTaskSource/IValueTaskSource<T>` instances, such that calls to an `async ValueTask/ValueTask<T>` method incur 0 allocations (ammortized) as long as there's a cached object available.
Currently the pooling is behind a feature flag, requiring opt-in via the DOTNET_SYSTEM_THREADING_POOLASYNCVALUETASKS environment variable (setting it to "true" or "1"). This is done for a few reasons:
- There's a breaking change here, in that while we say/document that `ValueTask/ValueTask<T>`s are more limited in what they can be used for, nothing in the implementation actually stops a `ValueTask` that was wrapping a `Task` from being used as permissively as `Task`, e.g. if you were to `await` such a `ValueTask` multiple times, it would happen to work, even though we say "never do that". This change means that anyone who was relying on such undocumented behaviors will now be broken. I think this is a reasonable thing to do in a major release, but I also want feedback and a lot of runway on it.
- Policy around pooling. Pooling is always a difficult thing to tune. Right now I've chosen a policy that limits the number of pooled objects per state machine type to an arbitrary multiple of the processor count, and that tries to strike a balance between contention and garbage by using a spin lock and if there's any contention while trying to get or return a pooled object, the cache is ignored. We will need to think hard about what policy to use here. It's also possible it could be tuned per state machine, e.g. by having an attribute that's looked up via reflection when creating the cache for a state machine, but that'll add a lot of first-access overhead to any `async ValueTask/ValueTask<T>` method. For now, it's tunable via the `DOTNET_SYSTEM_THREADING_POOLASYNCVALUETASKSLIMIT` environment variable, which may be set to the maximum number of pooled objects desired per state machine.
- Performance validation. Preliminary numbers show that this accomplishes its goal, having on-par throughput with the current implementation but with significantly less allocation. That needs to be validated at scale and across a variety of workloads.
- Diagnostics. There are several diagnostics-related abilities available for `async Task/Task<T>` methods that are not included here when using `async ValueTask/ValueTask<T>` when pooling. We need to evaluate these (e.g. tracing) and determine which pieces need to be enabled and which we're fine omitting.
Before shipping .NET 5, we could choose to flip the polarity of the switch (making it opt-out rather than opt-in), remove the fallback altogether and just have it be always on, or revert this change, all based on experimentation and data we receive between now and then.
Commit migrated from https://github.com/dotnet/coreclr/commit/
bbbcb8b19a7a8338d87b8f097a4a4143eb3e2427
Drew Scoggins [Wed, 23 Oct 2019 23:52:09 +0000 (16:52 -0700)]
Update build pools for perf runs (dotnet/coreclr#27378)
Commit migrated from https://github.com/dotnet/coreclr/commit/
30711d1631d2c283a64ab636df8cc0114ce228d8
Tom Deseyn [Wed, 23 Oct 2019 13:50:26 +0000 (15:50 +0200)]
Remove Socket.InnerSafeCloseSocket (dotnet/corefxdotnet/coreclr#41888)
* Remove Socket.InnerSafeCloseSocket
* Move IsInvalid checks in SetHandle function
* PR feedback
* Remove unnecessary 'SocketPal.'
* Remove SafeSocketHandle.SetHandle
Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
Commit migrated from https://github.com/dotnet/coreclr/commit/
5cf947c106756a5bbc078e36a7195b79cee459af
Tanner Gooding [Wed, 23 Oct 2019 12:44:26 +0000 (05:44 -0700)]
Move Matrix3x2/4x4, Plan, and Quaternion to the shared CoreLib partition (dotnet/coreclr#42021)
Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
Commit migrated from https://github.com/dotnet/coreclr/commit/
9d6d53f10fbc76f8a82c0649403b982f9a8333d3
Stephen Toub [Wed, 23 Oct 2019 21:54:40 +0000 (17:54 -0400)]
Remove stale entries from corefx.issues.rsp (dotnet/coreclr#27391)
I believe these have all been fixed and just not removed from the .rsp file. It's possible some of the fixes haven't flown back to coreclr; using CI to see.
Commit migrated from https://github.com/dotnet/coreclr/commit/
6091321b2e05961023a81c03736aea600bae91a1
Tanner Gooding [Wed, 23 Oct 2019 20:11:21 +0000 (13:11 -0700)]
Ensure that `GenTreeIndir load` is used in a scope where it can't be optimized away. (dotnet/coreclr#27390)
Commit migrated from https://github.com/dotnet/coreclr/commit/
03710d0733755bcc121c7a2f1ea7e323a9442848
Sergey Andreenko [Wed, 23 Oct 2019 19:23:08 +0000 (12:23 -0700)]
Expression 'sigType == TYP_STRUCT' is always false. importer.cpp 18806 (dotnet/coreclr#27292)
`sigType` could be only `TYP_BYREF` or `TYP_REF`, so delete the other cases.
Commit migrated from https://github.com/dotnet/coreclr/commit/
a35ac8b2feec4865ee3c05fbcdfbcaeb56cc558c
Tanner Gooding [Wed, 23 Oct 2019 13:51:59 +0000 (06:51 -0700)]
Ensure that `GenTreeIndir load` is declared in a scope where it can't be optimized away.
Commit migrated from https://github.com/dotnet/coreclr/commit/
0c5829369f5dccd76825b42d89a846f6bf54463f
Marek Safar [Wed, 23 Oct 2019 18:15:37 +0000 (14:15 -0400)]
Remove unused methods (dotnet/coreclr#27370)
Commit migrated from https://github.com/dotnet/coreclr/commit/
e835c93e8647cff436221c9e0aaa91e33f45e496
Jan Kotas [Wed, 23 Oct 2019 12:30:23 +0000 (05:30 -0700)]
Delete stale test exclusion files (dotnet/coreclr#27375)
Commit migrated from https://github.com/dotnet/coreclr/commit/
233be1b28b1bdfffa52cbedc1fc172a91dbe5860
Peter Sollich [Wed, 23 Oct 2019 11:56:43 +0000 (13:56 +0200)]
Card mark steal (dotnet/coreclr#25986)
Implement card marking stealing for better work balance in Server GC.
One of the last stages in the mark_phase is to mark objects referenced from older generations. This stage is often slow compared to the other stages, and it is also often somewhat unbalanced, i.e. some GC threads finish their work significantly sooner than others. The change also applies to the relocate_phase, but that phase usually takes significantly less time.
This change implements thread-safe enumeration of older generations by dividing them into chunks (2 MB in 64-bits, 1 MB in 32-bits), and arranges it so threads finishing work early will help on other heaps. Each thread grabs a chunk and then looks through the card table section corresponding to this chunk. When it's done with a chunk, it grabs the next one and so on.
There are changes at multiple levels:
- at the top level, mark_phase and relocate_phase contain changes to check for work already done for both the heap associated with the thread and other heaps.
- these routines call mark_through_cards_for_segments and mark_through_cards_for_large_objects which contain code to walk through the older generations in chunks.
- ultimately card_marking_enumerator::move_next implements the thread safe enumeration, supplying chunks, and gc_heap::find_next_chunk supplies a chunk where all card bits are set.
Commit migrated from https://github.com/dotnet/coreclr/commit/
5ca444ce55137d60f2fb033d8a110ce8b3e70df3
Aaron Robinson [Wed, 23 Oct 2019 05:37:24 +0000 (22:37 -0700)]
Apply SuppressGCAttribute to some SPCL functions. (dotnet/coreclr#27369)
Apply SuppressGCAttribute to some SPCL functions.
Only insert GC_POLL in first morph call.
Commit migrated from https://github.com/dotnet/coreclr/commit/
8bc7fab14d78030914e98b33c70b370d513021f6
Tanner Gooding [Wed, 23 Oct 2019 03:23:12 +0000 (20:23 -0700)]
Adding SkipInit to Internal.Runtime.CompilerServices.Unsafe (dotnet/coreclr#27377)
* Adding SkipInit to Internal.Runtime.CompilerServices.Unsafe
* Updating the runtime to handle Unsafe.SkipInit
* Updating Decimal.DecCalc to use Unsafe.SkipInit
* Removing 'workaround for CS0165' comments
Commit migrated from https://github.com/dotnet/coreclr/commit/
9bc350f2e7a0b21f1c7d71ffda5ae1797fb5caff
Tanner Gooding [Tue, 22 Oct 2019 22:53:10 +0000 (15:53 -0700)]
Move Vector2/3/4 to the shared CoreLib partition (dotnet/corefxdotnet/coreclr#42005)
Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
Commit migrated from https://github.com/dotnet/coreclr/commit/
8f936bc087359c94fb187971e024d7c39176ebda