platform/upstream/coreclr.git
5 years agoCopy all win32 resources (#24308)
David Wrighton [Wed, 1 May 2019 22:29:34 +0000 (15:29 -0700)]
Copy all win32 resources (#24308)

- Add crossgen test to verify file version is preserved
- Add support for general win32 resource copying to ReadyToRun
  - Copy all resources

5 years agoMove the new ConfigureAwait/WithCancellation extension methods to a new type (#24331)
Stephen Toub [Wed, 1 May 2019 20:54:40 +0000 (16:54 -0400)]
Move the new ConfigureAwait/WithCancellation extension methods to a new type (#24331)

We decided after all to put these on a different type, TaskAsyncEnumerableExtensions.  This commit adds the new type.  We can delete the methods in the old location once corefx consumes an updated build and switches over to using the new ones.

5 years agoUpdate SDK to 2.1.504
Russ Keldorph [Wed, 1 May 2019 17:52:10 +0000 (10:52 -0700)]
Update SDK to 2.1.504

(Hopefully) Fixes #24083

5 years agoDisable CallbackStressTest everywhere.
Russ Keldorph [Wed, 1 May 2019 12:41:00 +0000 (05:41 -0700)]
Disable CallbackStressTest everywhere.

5 years agoUpdating lookupNamedIntrinsic to no longer assert for an unexpected hwintrinsic metho...
Tanner Gooding [Wed, 1 May 2019 02:00:44 +0000 (19:00 -0700)]
Updating lookupNamedIntrinsic to no longer assert for an unexpected hwintrinsic method. (#24327)

5 years agoMerge pull request #24258 from dotnet/NullableFeature
Santiago Fernandez Madero [Tue, 30 Apr 2019 22:01:45 +0000 (15:01 -0700)]
Merge pull request #24258 from dotnet/NullableFeature

Merge nullable feature into master

5 years agoChanging comments/names that refers to file switching to flushing instead
Andrew Au [Tue, 30 Apr 2019 18:31:29 +0000 (11:31 -0700)]
Changing comments/names that refers to file switching to flushing instead

5 years agoSupport for larger version bubbles in R2RDump (#24277)
Tomáš Rylek [Tue, 30 Apr 2019 21:16:46 +0000 (23:16 +0200)]
Support for larger version bubbles in R2RDump (#24277)

After JanV fixed basically all test failures related to larger
version bubbles originally implemented by Andon, it's high time
to fix R2RDump for its support as a prerequisite to enabling
larger version bubbles in CPAOT. This change implements this
support via the following particular changes:

1) In DumpOptions, I added a list of explicit assembly references,
another list of reference paths that are used for resolving
assembly references, a cache for repeated assembly lookups and
a new method FindAssembly for file resolution of a given simple
assembly name.

2) I have moved ECMA metadata-related logic from R2RReader to
its new base class EcmaMetadataReader. This class can represent
both R2R and MSIL binaries and adds the logic for reference
assembly lookup.

3) Large version bubble R2R PE exe's contain a special R2R header
table READYTORUN_SECTION_MANIFEST_METADATA that contains ECMA
metadata with a list of extra AssemblyRef's on top of those stored
in the original MSIL. I have added support for parsing this table
to the R2RReader constructor.

4) I have modified R2RSignature to be based off the new
EcmaMetadataReader instead of R2RReader which cannot represent
arbitrary reference assemblies. I have patched the two places
dealing with module overrides to use the new logic to temporarily
switch to a "remote module" SignatureDecoder for the purpose
of parsing an external entity.

5) I have removed temporary hacks Andon put in place to keep
R2RDump alive in some cases with larger version bubbles without
proper support for parsing module overrides.

6) I have added logic for dumping the contents of the manifest
metadata along with the standard AssemblyRef table to the
header dump as I fought with recalculation of the indices
when debugging larger version bubble code for quite some time.

7) As an extra half-forgotten bit from the past I added dumping
of unboxing and instantiation stubs.

I have noticed that the MSIL AssemblyRef count was off by one.
I have also found out that XML output has bitrotten over time.
This additional delta fixes both issues. [That forced me to
add a bunch of empty ctors even though in practice we don't
actually serialize anything into the dumper, we only use
the XML serializer to emit the XML output file.

Thanks

Tomas

5 years agoCompute sizeof array instead of pointer (#24288)
Adeel Mujahid [Tue, 30 Apr 2019 19:35:34 +0000 (22:35 +0300)]
Compute sizeof array instead of pointer (#24288)

* Compute sizeof array instead of pointer

* Consolidate element count in dumpStack

5 years agoMake block optimized ClearWithoutReferences fully shared (#24312)
Marek Safar [Tue, 30 Apr 2019 18:45:50 +0000 (20:45 +0200)]
Make block optimized ClearWithoutReferences fully shared (#24312)

5 years agoUpdate dependencies from https://github.com/dotnet/arcade build 20190429.8 (#24313)
dotnet-maestro[bot] [Tue, 30 Apr 2019 18:39:25 +0000 (11:39 -0700)]
Update dependencies from https://github.com/dotnet/arcade build 20190429.8 (#24313)

- Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19229.8
- Microsoft.DotNet.Helix.Sdk - 2.0.0-beta.19229.8

5 years agoUpdate BuildTools, CoreClr to preview4-03930-01, preview6-27630-77, respectively...
dotnet-maestro-bot [Tue, 30 Apr 2019 18:39:13 +0000 (11:39 -0700)]
Update BuildTools, CoreClr to preview4-03930-01, preview6-27630-77, respectively (#24316)

5 years agoRemove FreeLibrary call to unload CoreCLR (#24317)
Next Turn [Tue, 30 Apr 2019 18:38:18 +0000 (02:38 +0800)]
Remove FreeLibrary call to unload CoreCLR (#24317)

5 years agoMerge master into NullableFeature
Buyaa Namnan [Tue, 30 Apr 2019 17:37:21 +0000 (10:37 -0700)]
Merge master into NullableFeature

5 years agoFix test failures
Buyaa Namnan [Mon, 29 Apr 2019 04:43:09 +0000 (21:43 -0700)]
Fix test failures

5 years agofix build errors after merge
Krzysztof Wicher [Thu, 25 Apr 2019 23:50:53 +0000 (16:50 -0700)]
fix build errors after merge

5 years agoDisable CallbackStressTest against #24305
Russ Keldorph [Mon, 29 Apr 2019 23:33:48 +0000 (16:33 -0700)]
Disable CallbackStressTest against #24305

5 years agoAdd more asserts for the EventPipeBufferManager consumers
Andrew Au [Tue, 30 Apr 2019 06:23:22 +0000 (23:23 -0700)]
Add more asserts for the EventPipeBufferManager consumers

5 years ago[master] Update dependencies from dnceng/internal/dotnet-optimization (#24245)
dotnet-maestro[bot] [Tue, 30 Apr 2019 12:45:44 +0000 (05:45 -0700)]
[master] Update dependencies from dnceng/internal/dotnet-optimization (#24245)

- optimization.IBC.CoreCLR - 99.99.99-master-20190429.1
- optimization.PGO.CoreCLR - 99.99.99-master-20190429.1

5 years agoUpdating System.Numerics.Vector<T> to use the readonly members feature. (#23827)
Tanner Gooding [Tue, 30 Apr 2019 10:42:07 +0000 (03:42 -0700)]
Updating System.Numerics.Vector<T> to use the readonly members feature. (#23827)

5 years ago[master] Update dependencies from dotnet/arcade (#24244)
dotnet-maestro[bot] [Tue, 30 Apr 2019 06:16:09 +0000 (23:16 -0700)]
[master] Update dependencies from dotnet/arcade (#24244)

- Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19226.3
- Microsoft.DotNet.Helix.Sdk - 2.0.0-beta.19226.3

5 years agoAdd more span-based Vector<T> ctors and CopyTo methods (#23333)
Levi Broderick [Tue, 30 Apr 2019 04:37:58 +0000 (21:37 -0700)]
Add more span-based Vector<T> ctors and CopyTo methods (#23333)

5 years ago[master] Update dependencies from dotnet/corefx (#24292)
dotnet-maestro[bot] [Tue, 30 Apr 2019 03:03:38 +0000 (20:03 -0700)]
[master] Update dependencies from dotnet/corefx (#24292)

- Microsoft.NETCore.Platforms - 3.0.0-preview6.19229.1
- Microsoft.Private.CoreFx.NETCoreApp - 4.6.0-preview6.19229.1

5 years agoMove DefaultBinder.CanConvert.cs to shared (#23931)
Egor Bogatov [Tue, 30 Apr 2019 02:21:04 +0000 (05:21 +0300)]
Move DefaultBinder.CanConvert.cs to shared (#23931)

5 years agoMove NativeLibrary to the shared partition (#24143)
Michal Strehovský [Tue, 30 Apr 2019 02:16:10 +0000 (04:16 +0200)]
Move NativeLibrary to the shared partition (#24143)

I'm taking the LibraryNameVariation helper from System.Runtime.Loader for the ride as well because it's a general purpose probing logic that is useful in a managed implementation of NativeLibrary.

5 years agoUpdate CoreClr to preview6-27629-72
dotnet-maestro-bot [Mon, 29 Apr 2019 21:37:20 +0000 (14:37 -0700)]
Update CoreClr to preview6-27629-72

5 years agoFix GetObjectReferences API when caller doesn't zero the param (#24299)
Mukul Sabharwal [Tue, 30 Apr 2019 00:42:13 +0000 (17:42 -0700)]
Fix GetObjectReferences API when caller doesn't zero the param (#24299)

5 years agoImprove pref of `Array.IndexOf()` for certain `T`. (#24293)
dschinde [Tue, 30 Apr 2019 00:38:49 +0000 (19:38 -0500)]
Improve pref of `Array.IndexOf()` for certain `T`. (#24293)

Applies changes to `Array.IndexOf()` and `Array.LastIndexOf()` similar
to the changes made in #20855, so that types other than `byte` and
`char` can use use the fast vectorized path.

Also allows 32-bit and 64-bit types for which
`RuntimeHelpers.IsBitwiseEquatable<T>()` returns `true` to use the
faster implementation of `IndexOf` and `LastIndexOf` from
`MemoryExtensions`.

5 years agoWorkaround memset alignment sensitivity (#24302)
Jan Kotas [Tue, 30 Apr 2019 00:38:04 +0000 (17:38 -0700)]
Workaround memset alignment sensitivity (#24302)

* Workaround memset alignment sensitivity

memset is up to 2x slower on misaligned block on some types of hardware. The problem is uneven performance of "rep stosb"
used to implement the memset in some cases. The exact matrix on when it is slower and by how much is very complex.

This change workarounds the issue by aligning the memory block before it is passed to memset and filling in the potential misaligned
part manually. This workaround will regress performance by a few percent (<10%) in some cases, but we will gain up to 2x improvement
in other cases.

Fixes #24300

5 years agoResolves an assert around Sse41.ConvertToVector128Int* and Avx2.ConvertToVector256Int...
Tanner Gooding [Mon, 29 Apr 2019 21:39:19 +0000 (14:39 -0700)]
Resolves an assert around Sse41.ConvertToVector128Int* and Avx2.ConvertToVector256Int* (#24289)

* Adding tests for the overloads of Sse41.ConvertToVector128Int* and Avx2.ConvertToVector256Int* that take a pointer

* Fixing the handling of Sse41.ConvertToVector128* and Avx2.ConvertToVector256*

5 years agoMerge pull request #24283 from briansull/ibc-linux-new
Brian Sullivan [Mon, 29 Apr 2019 21:15:31 +0000 (14:15 -0700)]
Merge pull request #24283 from briansull/ibc-linux-new

Updated fixes for IBC profile data on Linux

5 years agoImprove Precision to 10 microseconds in timespan (#24279)
Anirudh Agnihotry [Mon, 29 Apr 2019 20:56:48 +0000 (13:56 -0700)]
Improve Precision to 10 microseconds in timespan (#24279)

* Increasing precision properly and leaving the rounding of to casting operator

* disabling corefx tests in coreclr and addressing feedback

* correcting test project name

* Fix json

5 years agoFix Satellite Assembly loading (#24191)
Steve MacLean [Mon, 29 Apr 2019 19:37:28 +0000 (15:37 -0400)]
Fix Satellite Assembly loading (#24191)

* Fix Satellite Assembly loading

When loading satellite assemblies, we should probe next to the parent
assembly and load into the same AssemblyLoadContext as the parent
assembly.

Disable fallback probing for satellite assemblies.

Add AssemblyLoadContext.Resolving handler to probe for satellite
assemblies next to parent

Fixes #20979

* Call ResolveSatelliteAssembly from native

Only call ResolveSatelliteAssembly from native when
resolving a satellite assembly

* PR Feedback

Minimize string creation
Remove unnecessary if null checks
Eliminate corner cases by only allowing one case insensitive matching directory.

* ResolveSatelliteAssembly should ...

ResolveSatelliteAssembly should always be called on the ALC which loaded parentAssembly

Simplify code.
Add Debug.Assert

* Remove case insensitive culture search

* PR Feedback

* Fix parentAssembly logic

* Fixes from initial testing

* Add probe for lower case culture name

* PR feedback

5 years agoMerge pull request #24282 from erozenfeld/Fix24253
Eugene Rozenfeld [Mon, 29 Apr 2019 19:09:07 +0000 (12:09 -0700)]
Merge pull request #24282 from erozenfeld/Fix24253

 Fix for a jit liveness bug.

5 years agoRemoved method ReleaseManagedCommandLine()
Brian Sullivan [Mon, 29 Apr 2019 16:43:03 +0000 (09:43 -0700)]
Removed method ReleaseManagedCommandLine()
jkotas - We are intentionally not doing any cleanup that is just releasing memory.
We depend on the OS to take care of releasing the memory.

5 years agoRestore IBCMerge using an authenticated service connection (#24284)
Jeremy Koritzinsky [Mon, 29 Apr 2019 16:27:10 +0000 (09:27 -0700)]
Restore IBCMerge using an authenticated service connection (#24284)

* Add separate build steps to do the IBCMerge restore.

* Attempt 1 to get config picked up.

* Attempt 2 getting ibcmerge restore working.

* Fix invalid MSBuild syntax.

* Fix getting IBC package version.

5 years agoFix running JitBench on Linux (#24248)
Ludovic Henry [Mon, 29 Apr 2019 14:45:43 +0000 (07:45 -0700)]
Fix running JitBench on Linux (#24248)

* Fix running JitBench on Linux

* Bump to head of aspnet/JitBench:rel/2.0.0

5 years agoAdd missing check for UTF-16 low surrogate char at start of buffer (#24286)
Levi Broderick [Sat, 27 Apr 2019 21:21:08 +0000 (14:21 -0700)]
Add missing check for UTF-16 low surrogate char at start of buffer (#24286)

5 years agoMerge pull request #24261 from sandreenko/fixRegressionCoreFXx86
Sergey Andreenko [Sat, 27 Apr 2019 20:01:09 +0000 (13:01 -0700)]
Merge pull request #24261 from sandreenko/fixRegressionCoreFXx86

Fix optAssertionProp_Update.

5 years agoNullable: Comparers, Dictionary and Friends (#23971)
Santiago Fernandez Madero [Thu, 25 Apr 2019 23:12:35 +0000 (16:12 -0700)]
Nullable: Comparers, Dictionary and Friends (#23971)

* Nullable: Comparers, Dictionary and Friends

* Add object constraint to Dictionary

* Fix warning from new compiler and annotating dictionary

* PR Feedback

5 years agoNullable for Type class (#23489)
buyaa-n [Thu, 25 Apr 2019 23:08:26 +0000 (16:08 -0700)]
Nullable for Type class (#23489)

System.Type, System.Reflection nullability

5 years agoNullable: System.Diagnostics.Tracing (#24070)
Krzysztof Wicher [Fri, 19 Apr 2019 13:15:52 +0000 (06:15 -0700)]
Nullable: System.Diagnostics.Tracing (#24070)

* Nullable: System.Diagnostics.Tracing

* apply feedback

* fix one more comment

5 years agoUpdate dependencies from https://github.com/dotnet/corefx build 20190426.9
dotnet-maestro [Sat, 27 Apr 2019 12:29:31 +0000 (12:29 +0000)]
Update dependencies from https://github.com/dotnet/corefx build 20190426.9

- Microsoft.NETCore.Platforms - 3.0.0-preview6.19226.9
- Microsoft.Private.CoreFx.NETCoreApp - 4.6.0-preview6.19226.9

5 years agoUpdate dependencies from https://github.com/dotnet/corefx build 20190425.8
dotnet-maestro [Fri, 26 Apr 2019 12:38:07 +0000 (12:38 +0000)]
Update dependencies from https://github.com/dotnet/corefx build 20190425.8

- Microsoft.NETCore.Platforms - 3.0.0-preview6.19225.8
- Microsoft.Private.CoreFx.NETCoreApp - 4.6.0-preview6.19225.8

5 years agoUpdate dependencies from https://github.com/dotnet/corefx build 20190425.1
dotnet-maestro [Thu, 25 Apr 2019 12:38:03 +0000 (12:38 +0000)]
Update dependencies from https://github.com/dotnet/corefx build 20190425.1

- Microsoft.NETCore.Platforms - 3.0.0-preview6.19225.1
- Microsoft.Private.CoreFx.NETCoreApp - 4.6.0-preview6.19225.1

5 years agoUpdate dependencies from https://github.com/dotnet/corefx build 20190423.9
dotnet-maestro [Wed, 24 Apr 2019 12:37:24 +0000 (12:37 +0000)]
Update dependencies from https://github.com/dotnet/corefx build 20190423.9

- Microsoft.NETCore.Platforms - 3.0.0-preview6.19223.9
- Microsoft.Private.CoreFx.NETCoreApp - 4.6.0-preview6.19223.9

5 years agoFix CoreLib build breaks
Jan Kotas [Sat, 27 Apr 2019 03:52:48 +0000 (20:52 -0700)]
Fix CoreLib build breaks

5 years agoAdd System.Resources.Extensions (dotnet/corefx#36906)
Eric StJohn [Fri, 26 Apr 2019 05:05:19 +0000 (22:05 -0700)]
Add System.Resources.Extensions (dotnet/corefx#36906)

* Add System.Resources.Binary.Reader|Writer

* Fix ResourceWriter tests

* Test fixes and PR feedback

* More test fixes

* Add packages for System.Resources.Binary.*

* Suppress duplicate types in System.Resources.Binary.*

* Test refactoring and adding RuntimeResourceSet

It turns out me must have our own ResourceSet since the CoreLib resource set doesn't
expose a constructor that takes an IResourceReader.

I've shared the code since it does a bit of non-trivial caching.

* Don't use auto-property initializers for platfrom sensitive test data

For some reason I thought these lazy-initialized the properties but they don't.

As a result we were hitting the platform sensitive code even when we never
called the getter.  Switch to an expression instead.

* Only use Drawing converters on Windows

* Fix test failures

* Don't leak System.Private.CoreLib into resources

* Make sure RuntimeResourceSet doesn't call ResourceReader(IResourceReader)

* WIP

* Rename types in System.Resources.Extensions

Leave RuntimeResourceSet internal as it doesn't need to be public.

* Update packages

* Respond to API review feedback

Remove abstraction for ResourceReader/Writer: just reuse the source.

Remove non-essential members.

* Clean up

* Further cleanup

* Further cleanup

* Review feedback

* Ensure we have stable type names in Resources.Extensions

We don't want to use the runtime type identity when doing type checks or writing
types as this may change.  Instead, check-in hard-coded strings that match the
type identity.

Add a test case to ensure the resources we generate match what we
test the reader against in the resource manager case (also to track any
change to the binary format).

Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
5 years agoSwitch to non-Int Azure pool providers
Russ Keldorph [Fri, 26 Apr 2019 13:36:31 +0000 (06:36 -0700)]
Switch to non-Int Azure pool providers

5 years agoTypos (#24280)
John Doe [Sat, 27 Apr 2019 02:45:22 +0000 (19:45 -0700)]
Typos (#24280)

* thier -> their

* exeption -> exception

* Estbalisher -> Establisher

* neeed -> need

* neeed -> need

* neeeded -> needed

* neeeded -> needed

* facilitiate -> facilitate

* extremly -> extremely

* extry -> extra

5 years agoImprove LOH heap balancing (#24081)
Andy Hanson [Sat, 27 Apr 2019 02:33:26 +0000 (19:33 -0700)]
Improve LOH heap balancing (#24081)

* Improve LOH heap balancing

Previously in `balance_heaps_loh`, we would default to `org_hp` being
`acontext->get_alloc_heap()`.

Since `alloc_large_object` is an instance method, that ultimately came
from the heap instance this was called on. In `GCHeap::Alloc` that came
from `acontext->get_alloc_heap()` (this is a different acontext). That
variable is set when we allocate a small object. So the heap we were
allocating large objects on was affected by the heap we were allocating
small objects on. This isn't necessary as small object heap and large
object heaps have separate areas. In scenarios with limited memory, we
can unnecessarily run out of memory by refusing to move away from that
hea. However, we do want to ensure that the large object heap accessed
is not on a different numa node than the small object heap.

I experimented with adding a `get_loh_alloc_heap()` to acontext similar
to the SOH alloc heap, but performance tests showed that it was usually
better to just start from the home heap. The chosen policy was:

* Start searching from the home heap -- this is the one corresponding to
our processor.

* Have a low (but non-zero) preference for that heap (dd_min_size(dd) /
2), as long as we stay within the same numa node.

* Have a higher cost of switching to a different numa node. However,
this is still much less than before; it was dd_min_size(dd) * 4, now
dd_min_size(dd) * 3 / 2.

This showed big performance improvements (over 30% less time) in a
scenario with lots of LOH allocation where there were fewer allocating
threads than GC heaps. The changes were more pronounced the more we
allocated large objects vs small objects. There was usually slight
improvement (1-2%) when there were 48 constantly allocating threads and
48 heaps. The one place we did see a slight regression was in an 800MB
container and 4 allocating threads on a 48 processor machine; however,
similar tests with less memory or more threads were prone to running out
of memory or running very slow on the master branch, so we've improved
stability. Previously the gc could get lucky by having the SOH choice
happen to be a good choice for LOH, but we shouldn't be relying on it as
it failed in some container scenarios.

One more change is in joined_generation_to_condemn: If there is a memory
limit and we are about to OOM, we should always do a compacting GC. This
helps avoid the OOM and feeds into the next change.

This PR also adds a *second* balance_heaps_loh function for when there
is a memory limit and we previously failed to allocate into the chosen
heap. `balance_heaps_loh` works based on allocation budgets, whereas
`balance_heaps_loh_hard_limit_retry` works on the actual space available
at the end of the segment. Thanks to the change to
joined_generation_to_condemn the heaps should be compact, so not looking
at free space here.

* Fix uninitialized variable

* In a container, use space available instead of budget

* Fix duplicate semicolon

5 years agoMerge pull request #24270 from janvorli/fix-gc-numa-to-heap-map-creation
Jan Vorlicek [Sat, 27 Apr 2019 00:38:37 +0000 (02:38 +0200)]
Merge pull request #24270 from janvorli/fix-gc-numa-to-heap-map-creation

Fix creation of the NUMA node to heap number map

5 years agoClean up fgRemoveDeadStore.
Eugene Rozenfeld [Fri, 26 Apr 2019 23:16:05 +0000 (16:16 -0700)]
Clean up fgRemoveDeadStore.

Remove duplication and a couple of goto's from `fgRemoveDeadStore`.

This part was very confusing:

`
                /* If this is GT_CATCH_ARG saved to a local var don't bother */

                JITDUMP("removing stmt with no side effects\n");

                if (asgNode->gtFlags & GTF_ORDER_SIDEEFF)
                {
                    if (rhsNode->gtOper == GT_CATCH_ARG)
                    {
                        goto EXTRACT_SIDE_EFFECTS;
                    }
                }
`

The `goto` was to the preceding `if` and was useless since the call
to `gtExtractSideEffList(rhsNode, &sideEffList);` couldn't possibly find
side effects because we already checked that
`rhsNode->gtFlags & GTF_SIDE_EFFECT == 0`.

5 years agoAdded check for GetManagedCommandLine() returning a nullptr in ProfileDataAllocateSce...
Brian Sullivan [Fri, 26 Apr 2019 23:59:03 +0000 (16:59 -0700)]
Added check for GetManagedCommandLine() returning a nullptr in ProfileDataAllocateScenarioInfo

Moved call to ReleaseManagedCommandLine() to EEShutDownHelper

5 years agoCommits from #24229 - Fixes for IBC profile data on Linux
Brian Sullivan [Fri, 26 Apr 2019 23:21:51 +0000 (16:21 -0700)]
Commits from #24229 - Fixes for IBC profile data on Linux

Added public static function GetManagedCommandLine() and SaveManagedCommandLine()

Moved GetManagedCommandLine and SaveManagedCommandLine to ceeload to link

Disabled the setup for BBSweep on Linux as the PAL doesn’t support process named objects

5 years agoMerge pull request #24281 from BruceForstall/CleanCorefxRuns
Bruce Forstall [Fri, 26 Apr 2019 23:09:15 +0000 (16:09 -0700)]
Merge pull request #24281 from BruceForstall/CleanCorefxRuns

Disable failing corefx tests

5 years agoDisable failing corefx tests
Bruce Forstall [Fri, 26 Apr 2019 23:02:26 +0000 (16:02 -0700)]
Disable failing corefx tests

5 years agoMerge pull request #24276 from briansull/revert-24229
Brian Sullivan [Fri, 26 Apr 2019 22:58:31 +0000 (15:58 -0700)]
Merge pull request #24276 from briansull/revert-24229

Revert 24229

5 years agoFix the case when we replace `stmt->gtStmtExpr`.
Sergey Andreenko [Fri, 26 Apr 2019 22:50:37 +0000 (15:50 -0700)]
Fix the case when we replace `stmt->gtStmtExpr`.

5 years agoFix for a jit liveness bug.
Eugene Rozenfeld [Fri, 26 Apr 2019 22:22:53 +0000 (15:22 -0700)]
Fix for a jit liveness bug.

`fgRemoveDeadStore` has special logic for removing dead assignments
whose rhs was of type `TYP_STRUCT`:

https://github.com/dotnet/coreclr/blob/311b5e2fe413c6c74a2a3680ab54d8a978651472/src/jit/liveness.cpp#L2264-L2274

That logic was applied to "normal"
assignments (i.e., direct children of `GT_STMT`) but not to "internal"
assignments (e.g., children of `GT_COMMA`).
The test case has an internal assignment and, because this logic wasn't
applied, we ended up with a standalone `GT_IND` of type `TYP_STRUCT`
that the register allocator can't handle.

This change apples the missing logic to "internal" assignments.

Fixes #24253.

5 years agoRevert "Fix for IBC profile data on Linux - Build the full command line for FEATURE_PAL"
Brian Sullivan [Fri, 26 Apr 2019 21:08:01 +0000 (14:08 -0700)]
Revert "Fix for IBC profile data on Linux - Build the full command line for FEATURE_PAL"

This reverts commit 08422af33fa2026953c2e720cecf000ed4345a32.

5 years agoRevert "Added method ReleaseManagedCommandLine to release memory"
Brian Sullivan [Fri, 26 Apr 2019 21:07:29 +0000 (14:07 -0700)]
Revert "Added method ReleaseManagedCommandLine to release memory"

This reverts commit 1f2435763926f6068fc88a36a2b8dc49c263f271.

5 years agoUse `ReplaceOperand`.
Sergey Andreenko [Fri, 26 Apr 2019 20:53:26 +0000 (13:53 -0700)]
Use `ReplaceOperand`.

5 years agoUndo a change where we ignore the specified EventPipe sessionType.
José Rivero [Fri, 26 Apr 2019 00:37:59 +0000 (17:37 -0700)]
Undo a change where we ignore the specified EventPipe sessionType.

5 years agoRefactored the duplicated code into a template method pattern
Andrew Au [Thu, 25 Apr 2019 21:03:01 +0000 (14:03 -0700)]
Refactored the duplicated code into a template method pattern

5 years agoAdd config value for jit host slab cache maximum size (#24254)
Gleb Balykov [Fri, 26 Apr 2019 14:04:38 +0000 (17:04 +0300)]
Add config value for jit host slab cache maximum size (#24254)

5 years agoFix creation of the NUMA node to heap number map
Jan Vorlicek [Fri, 26 Apr 2019 09:53:41 +0000 (11:53 +0200)]
Fix creation of the NUMA node to heap number map

The current implementation assumes that the NUMA nodes of CPUs
used for GC threads form a zero based continous range. However that
doesn't have to be true for cases when user selects only a subset of the
available CPUs for the GC heap threads using the
COMPlus_GCHeapAffinitizeMask or COMPlus_GCHeapAffinitizeRanges. The
selected CPUs may belong only to a subset of NUMA nodes that don't
necessarily start at node 0 or form a continuous range.

This change fixes the algorithm that initializes the
numa_node_to_heap_map lookup array so that it works correctly even in
such cases.

5 years agoMerge pull request #24229 from briansull/ibc-linux
Brian Sullivan [Fri, 26 Apr 2019 05:51:14 +0000 (22:51 -0700)]
Merge pull request #24229 from briansull/ibc-linux

Fixes for IBC profile data on Linux

5 years agoAdd a repro test.
Sergey Andreenko [Thu, 25 Apr 2019 17:42:54 +0000 (10:42 -0700)]
Add a repro test.

5 years agoFix parent's links in fgArgInfo in optAssertionProp_Update.
Sergey Andreenko [Thu, 25 Apr 2019 23:07:37 +0000 (16:07 -0700)]
Fix parent's links in fgArgInfo in optAssertionProp_Update.

5 years agoChange gtFindLink to return parent as well.
Sergey Andreenko [Thu, 25 Apr 2019 23:05:51 +0000 (16:05 -0700)]
Change gtFindLink to return parent as well.

5 years agoAdd comments and format `gtGetThisArg`.
Sergey Andreenko [Thu, 25 Apr 2019 21:59:33 +0000 (14:59 -0700)]
Add comments and format `gtGetThisArg`.

5 years agoHelix telemetry fixes
Russ Keldorph [Sat, 20 Apr 2019 00:02:16 +0000 (17:02 -0700)]
Helix telemetry fixes

- Enable telemetry unconditionally
- Set the `_BuildConfig` variable in `xplat-job.yml` so it is available to
  both product and test builds.
- Set the Helix `Type` parameter explicitly to distinguish product and test builds
- Set the Helix `Source` parameter for builds as well as test jobs

This includes a fix to job.yml from dotnet/arcade#2620.

5 years ago[System.Globalization.Native] Fix small issues in CloneCollatorWithOptions and GetCol...
Filip Navara [Thu, 25 Apr 2019 23:42:30 +0000 (01:42 +0200)]
[System.Globalization.Native] Fix small issues in CloneCollatorWithOptions and GetCollatorFromSortHandle (#24100)

* Fix allocation size calculation when resizing array
Allocate initial array using malloc to avoid needlessly zeroing it
Reinstate optimization for empty array returned from GetCustomRules lost in #22378

* Avoid resizing arrays in GetCustomRules by preallocating the maximum size we can consume (5648 bytes)

* Avoid creating a binary search tree for something that could be easily stored as 32-entry lookup table

* Remove obsolete comment

5 years agoNull-terminate buffers that strncpy writes to (#24095)
Omair Majid [Thu, 25 Apr 2019 23:40:19 +0000 (19:40 -0400)]
Null-terminate buffers that strncpy writes to (#24095)

It is possible that the string being copied is so large that strncpy
fills up the destination array and does not write any null characters to
it. That will lead to buffer overflows. Work around that by always
writing a null character at the end of the destination array.

5 years agoRemove redundant tests (#24255)
Russ Keldorph [Thu, 25 Apr 2019 23:34:57 +0000 (16:34 -0700)]
Remove redundant tests (#24255)

Tests are technically flaky and have been determined largely redundant with CoreFx.

Fixes #24212

5 years agoAdded method ReleaseManagedCommandLine to release memory
Brian Sullivan [Thu, 25 Apr 2019 22:56:32 +0000 (15:56 -0700)]
Added method ReleaseManagedCommandLine to release memory

5 years agoAdd IsFrozenObject Profiler API (#24239)
Mukul Sabharwal [Thu, 25 Apr 2019 22:34:19 +0000 (15:34 -0700)]
Add IsFrozenObject Profiler API (#24239)

5 years agoRemoving EventPipe file polling (EventPipeController+Timer) (#24225)
José Rivero [Thu, 25 Apr 2019 22:13:03 +0000 (15:13 -0700)]
Removing EventPipe file polling (EventPipeController+Timer) (#24225)

* Remove file polling only, and leave the COMPlus_* functionality.
* Fix bug/typo introduced with https://github.com/dotnet/coreclr/pull/21718

5 years agoFix for IBC profile data on Linux - Build the full command line for FEATURE_PAL
Brian Sullivan [Tue, 23 Apr 2019 21:52:04 +0000 (14:52 -0700)]
Fix for IBC profile data on Linux - Build the full command line for FEATURE_PAL

Added public static function GetManagedCommandLine() andSaveManagedCommandLine()
Add helper method Append_Next_Item
Moved GetManagedCommandLine and SaveManagedCommandLine to ceeload to link crossgen
Cleanup, codereview feedback

5 years agoMerge pull request #24242 from janvorli/fix-numa-node-for-disabled-numa
Jan Vorlicek [Thu, 25 Apr 2019 21:49:48 +0000 (23:49 +0200)]
Merge pull request #24242 from janvorli/fix-numa-node-for-disabled-numa

Fix NUMA node for heap when NUMA is not available

5 years agoUsing SList<SListElem<T>> to store the EventPipeProviderCallbackData
Andrew Au [Thu, 25 Apr 2019 17:20:30 +0000 (10:20 -0700)]
Using SList<SListElem<T>> to store the EventPipeProviderCallbackData

5 years agoAdd IBCMerge restore source to the restore command. (#24250)
Jeremy Koritzinsky [Thu, 25 Apr 2019 20:16:35 +0000 (13:16 -0700)]
Add IBCMerge restore source to the restore command. (#24250)

5 years agoNullable System.Collections.EmptyReadOnlyDictionaryInternal, System.Collections.Objec...
Anirudh Agnihotry [Thu, 25 Apr 2019 18:47:22 +0000 (11:47 -0700)]
Nullable System.Collections.EmptyReadOnlyDictionaryInternal, System.Collections.ObjectModel.* (#24221)

* annotating collections

* annotated collection.cs and readonlycollection.cs

* adding tkey constraint and comments

5 years agoMerge pull request #24232 from janvorli/fix-large-version-bubble-2
Jan Vorlicek [Thu, 25 Apr 2019 18:19:50 +0000 (20:19 +0200)]
Merge pull request #24232 from janvorli/fix-large-version-bubble-2

Fix crossgen with large version bubble enabled

5 years agoImprove the performance of the type loader (#24177)
David Wrighton [Thu, 25 Apr 2019 17:57:09 +0000 (10:57 -0700)]
Improve the performance of the type loader (#24177)

Improve the performance of the type loader
- Disable interface ambiguity checks in Corelib
- Improve StackingAllocator perf
  - Increase size of allocation blocks
  - Cleanup allocation blocks comletely on gc suspension
- Check for presence of generic parameters to methods in a more efficient manner
  - Querying the count of GenericParameter records requires a binary search in the GenericParams table
  - Checking the generic flag on the method signature is effectively free
- Skip unnecessary checks in EnumerateClassMethods for corelib
- Use Sanity check flag where appropriate
- Use slightly faster hashtable functions in StringLiteralMap
  - Remove pointless string literal entry hash table search
- Change stacking allocator to not be allocated for the lifetime of a thread, but instead its allocated/destroyed around the first frame on the thread that needs the allocator.
  - Allocate at most 1 stacking allocator per thread
  - The allocation is on the stack via _alloca (as managed by the ACQUIRE_STACKING_ALLOCATOR macro
  - This will put an 8KB buffer on the stack, and if there is need for a larger buffer it will allocate off of the heap.
  - Stacking allocator initial block is always present, so the allocation routine for the allocator can be somewhat simpler
  - More logic has been move the the cpp file, to reduce header bloat, and improve iteration when modifying StackingAllocator code
  - Avoid use of alloca for StackingAllocator when less than 512KB of stack is available

5 years agoFix verification of 3-byte UTF-8 sequence followed by non-ASCII byte (#24235)
Levi Broderick [Thu, 25 Apr 2019 15:22:39 +0000 (08:22 -0700)]
Fix verification of 3-byte UTF-8 sequence followed by non-ASCII byte (#24235)

5 years agoReturn null for unexpected HW intrinsic (#24219)
Carol Eidt [Thu, 25 Apr 2019 14:26:21 +0000 (07:26 -0700)]
Return null for unexpected HW intrinsic (#24219)

Fix #17815

5 years agoFixing 23941 (#24199)
Fadi Hanna [Thu, 25 Apr 2019 14:17:19 +0000 (07:17 -0700)]
Fixing 23941 (#24199)

* Fixing 23941

The issue here is that in R2R code, unlike jitted IL code, the pinvoke calls are wrapped by a pair of calls to the JIT_PInvokeBegin and JIT_PInvokeEnd helpers, which link and unlink the InlinedCallFrame to the current thread. We do not initialize and link the ICF in the method prolog, and unlink it in the epilog, like jitted code does. We do this in the JIT helpers, right before/after the pinvoke call.
When an exception is thrown, the JIT_PInvokeEnd helper will be skipped since execution will resume at the nearest valid catch block, and the ICF will remain linked to the thread, which poses a problem if the method attempts another pinvoke operation (it will try to link the ICF which is already the top frame, and we'll end up in an infinite loop). Therefore, for the R2R case, we need to pop the ICF from the chain during exception unwinding.

5 years agoNullable: Contract.cs and more interop (#24193)
Stephen Toub [Thu, 25 Apr 2019 14:06:02 +0000 (10:06 -0400)]
Nullable: Contract.cs and more interop (#24193)

* Nullable: Contract.cs and more interop

* Address PR feedback

5 years agoFix NUMA node for heap when NUMA is not available
Jan Vorlicek [Thu, 25 Apr 2019 09:32:31 +0000 (11:32 +0200)]
Fix NUMA node for heap when NUMA is not available

The recent refactoring of the GCToOSInterface::GetProcessorForHeap has
accidentally changed the NUMA node returned in case NUMA is disabled
(either via the COMPlus_GCNumaAware or due to the fact that there is
just a single NUMA node on the system) and the CPU groups are disabled.
Before that refactoring, the code was incorrectly returning 0 as the
NUMA node when CPU groups were disabled no matter whether NUMA was
enabled or disabled. The refactoring fixed that by returning the
current CPU group number for the case when NUMA was enabled, however
it still returned incorrect value, this time GroupProcNo::NoGroup as
the NUMA node number in case NUMA was disabled.

This change fixes it by returning the current group number in this case.

5 years agoPostponing the managed callback so that they are called after the lock acquistion
Andrew Au [Fri, 29 Mar 2019 00:07:16 +0000 (17:07 -0700)]
Postponing the managed callback so that they are called after the lock acquistion

5 years agoSwitch to workstation GC in case of constrained CPU resources (#24194)
Ludovic Henry [Thu, 25 Apr 2019 04:38:57 +0000 (21:38 -0700)]
Switch to workstation GC in case of constrained CPU resources (#24194)

* Switch to workstation GC in case of constrained CPU resources

Right now, if the user sets the configuration so that the server GC is
used, the server GC will be loaded even in conditions where we know the
workstation GC would fare better. An example of such conditions is
constrained environment where there is only 1 or less CPU or with very
low memory.

This can be harmful if users deploy the same projects on different kind
of platforms: deploying to a 20+ cores server and to Azure Functions
will require largely different configurations for the runtime.

There are already multiple ways for the user to specify to use the
server GC or not:
 - setting `COMPlus_gcServer` as an environment variable
 - setting `gcServer` in the configuration file
 - setting `System.GC.Server` passed to `coreclr_initialize`

Fix https://github.com/dotnet/coreclr/issues/23949

* Address review

* Address review

Remove GCToOSInterface::GetCurrentProcessCpuLimit in favor of
GCToOSInterface::GetCurrentProcessCpuCount because the CpuLimit is taken
into account in the CpuCount again.

* Address review

Do the work in src/vm/ceemain.cpp otherwise there will be a disparity
between what the VM and the GC are running. Before, only the GC would be
aware of the switch from server to workstation GC, but not the VM.

5 years agoAdded optional/default parameters for StreamWriter/StreamReader (#24056)
Jim [Thu, 25 Apr 2019 02:50:47 +0000 (05:50 +0300)]
Added optional/default parameters for StreamWriter/StreamReader (#24056)

* Added optional/default parameters for StreamWriter/StreamReader

* Disabled outdated test

* Changed default encoding to UTF8NoBOM

* Made encoding parameter nullable

5 years agoUnify WIN32_FIND_DATA (dotnet/corefx#37158)
Jan Kotas [Thu, 25 Apr 2019 00:06:30 +0000 (17:06 -0700)]
Unify WIN32_FIND_DATA (dotnet/corefx#37158)

Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
5 years agoAdd Medium GC Profiling Mode & ICorProfilerInfo::GetObjectReferences (#24156)
Mukul Sabharwal [Thu, 25 Apr 2019 00:27:06 +0000 (17:27 -0700)]
Add Medium GC Profiling Mode & ICorProfilerInfo::GetObjectReferences (#24156)

5 years agoMore multi-appdomain support removal (#23921)
David Wrighton [Thu, 25 Apr 2019 00:01:31 +0000 (17:01 -0700)]
More multi-appdomain support removal (#23921)

More multi-appdomain support removal
- Remove DomainLocalBlock
- Remove DomainModule
- Remove FindDomain(File/Module/Assembly)
- Remove GetDomainModule
- Remove variants of GetDomain(File/Assembly) that take AppDomain parameter
- Adjust contracts to be less strict
  - GetDomainFile/Assembly no longer need a complex contract as multi-domain support does not exist
- Eliminiate uses of encoded ModuleID

5 years agoFix crossgen with large version bubble enabled
Jan Vorlicek [Wed, 24 Apr 2019 23:07:42 +0000 (01:07 +0200)]
Fix crossgen with large version bubble enabled

This change fixes about 1483 failing Pri-1 tests when they are
crossgen-ed with large version bubble enabled. Only one failing test
remains.

60% of the test cases were failing due to a failure to find generic
interface in an interface map due to the fact that the interface type
was being passed in canonical form.
The remaining 40% were tests using constrained calls. We were missing
the ENCODE_METHOD_SIG_Constrained in the method flags.

5 years agoMerge pull request #24226 from BruceForstall/Disable24224
Bruce Forstall [Wed, 24 Apr 2019 22:50:59 +0000 (15:50 -0700)]
Merge pull request #24226 from BruceForstall/Disable24224

Disable mandelbrot-7 against #24224

5 years agoMerge pull request #24227 from BruceForstall/Disable24173
Bruce Forstall [Wed, 24 Apr 2019 22:50:21 +0000 (15:50 -0700)]
Merge pull request #24227 from BruceForstall/Disable24173

Disable _il_dbgu_fld under GCStress against #24173