platform/upstream/dotnet/runtime.git
4 years ago5.0 yamls and edits for 3.1.200
vivmishra [Fri, 20 Mar 2020 19:41:06 +0000 (12:41 -0700)]
5.0 yamls and  edits for 3.1.200

4 years agoMerge pull request #33497 from dotnet/vivpatch
Vivek Mishra [Thu, 12 Mar 2020 19:22:50 +0000 (12:22 -0700)]
Merge pull request #33497 from dotnet/vivpatch

Adding separate 2.1 SDK yaml

4 years agoCleanup stale ApiCompatBaseline files (#33519)
Eric StJohn [Thu, 12 Mar 2020 19:04:56 +0000 (12:04 -0700)]
Cleanup stale ApiCompatBaseline files (#33519)

4 years ago[metadata] Disable three icalls on netcore monodroid (#33513)
monojenkins [Thu, 12 Mar 2020 18:18:04 +0000 (14:18 -0400)]
[metadata] Disable three icalls on netcore monodroid (#33513)

They aren't used there.

Co-authored-by: akoeplinger <akoeplinger@users.noreply.github.com>
4 years agoRemove the copy of core_root by using core_root as the corelation dir (#33498)
Jarret Shook [Thu, 12 Mar 2020 17:56:24 +0000 (10:56 -0700)]
Remove the copy of core_root by using core_root as the corelation dir (#33498)

* Remove the copy of core_root by using core_root as the corelation dir

* Change to remove core_root, it is the workitem_payload

* Fix core_root location

4 years agoMerge pull request #33494 from maryamariyan/fromoldmaster-bringmissingfiles-1
Maryam Ariyan [Thu, 12 Mar 2020 15:28:23 +0000 (08:28 -0700)]
Merge pull request #33494 from maryamariyan/fromoldmaster-bringmissingfiles-1

Bring commit history for more files from Extensions repo

4 years agoFix type layout whan Cross OS compiling (#33487)
Steve MacLean [Thu, 12 Mar 2020 15:22:14 +0000 (11:22 -0400)]
Fix type layout whan Cross OS compiling (#33487)

* Fix cache line size to be a TARGET property

* Fix CCompRC cross OS DAC layout

* Fix cross OS InlineSArray packing

* Add DAC_ALIGNAS()

Align first member of various classes which have shown
inconsistent layout during cross compilation.

* Fix RegMeta cross os layout

* Fix typo

* Remove dead code

* Remove FunctionSigBuilder et. al from DAC

Remove FunctionSigBuilder and classes which depend on its
definition from the DAC.

Remove the FunctionSigBuilder layout correction to make it
cross platform stable.

* Remove more stubgen classes from DAC

* Improve comment

4 years ago[merp] Remove unnecessary call to msync in mono_state_free_mem (#33395)
monojenkins [Thu, 12 Mar 2020 15:13:18 +0000 (11:13 -0400)]
[merp] Remove unnecessary call to msync in mono_state_free_mem (#33395)

Closes https://github.com/mono/mono/issues/19136

Co-authored-by: alexischr <alexischr@users.noreply.github.com>
4 years agoRun APICompat against the previous release of NETCoreApp (#33300)
Eric StJohn [Thu, 12 Mar 2020 14:47:09 +0000 (07:47 -0700)]
Run APICompat against the previous release of NETCoreApp (#33300)

* Run APICompat against the previous release of NETCoreApp

* Remove redundant source build condition

* Add APICompat specific attribute exclusion list.

* Update to latest ApiCompat

4 years agoBring back GenAPI subscription, update to latest and workaround roslyn issue (#33499)
Santiago Fernandez Madero [Thu, 12 Mar 2020 11:50:55 +0000 (04:50 -0700)]
Bring back GenAPI subscription, update to latest and workaround roslyn issue (#33499)

4 years agoShare managed EventSource/EventPipe implementation between CoreCLR and Mono. (#33425)
Johan Lorensson [Thu, 12 Mar 2020 11:35:50 +0000 (12:35 +0100)]
Share managed EventSource/EventPipe implementation between CoreCLR and Mono. (#33425)

First changes needed in order to start sharing managed EventSource/EventPipe
code between CoreCLR and Mono runtime. Sharable code has been moved into
S.P.C library project and split into runtime specific source files when
needed, kept within each runtime specific S.P.C project files.

Mono runtime has been extended with a set of icalls needed by
EventPipeInternal, just to make sure EventPipe can be initialized,
current Mono runtime implementation returns dummy values.

Current change also enables ETW provider support on Mono Windows runtime.

NOTE, this is just initial changes needed in order to share managed
EventSource/EventPipe code between runtimes. Future changes will incrementally
add EventPipe native code into Mono runtime.

4 years ago[mono] Improve how EnumBuilder handles type attributes (#33389)
Alexis Christoforides [Thu, 12 Mar 2020 10:53:47 +0000 (06:53 -0400)]
[mono] Improve how EnumBuilder handles type attributes (#33389)

Literally copy set of attributes from https://github.com/dotnet/runtime/blob/dc62dd61071c239401ef6397a4d7ae29161d10a7/src/coreclr/src/System.Private.CoreLib/src/System/Reflection/Emit/EnumBuilder.cs#L330

4 years agoFix assertion failure when running some composite CoreCLR tests (#33503)
Tomáš Rylek [Thu, 12 Mar 2020 09:37:22 +0000 (10:37 +0100)]
Fix assertion failure when running some composite CoreCLR tests (#33503)

In composite testing, ReadyToRunInfo::GetImage() returns the
composite image layout (NativeImageLayout) for which
PEDecoder::GetReadyToRunHeader doesn't work (we decided we don't
want to modify the general PEDecoder logic). A simple fix is not
to go through GetImage() and expose the header on the R2R info
directly instead.

Thanks

Tomas

4 years agoImplement Bundler version 2 (#33413)
Swaroop Sridhar [Thu, 12 Mar 2020 03:58:21 +0000 (20:58 -0700)]
Implement Bundler version 2 (#33413)

* Implement Bundler version 2

Implement support for single-file version 2 layout as described in https://github.com/dotnet/designs/blob/master/accepted/2020/single-file/bundler.md

The supporting changes are:
* Implement new HostModel interfaces to communicate additional information from the SDK to the HostModel
   * The SDK changes will be done in an upcoming PR.
   * Some depricated APIs are maintained so that SDK build doesn't break in the meantime]
* Handle various bundling options described in https://github.com/dotnet/designs/blob/master/accepted/2020/single-file/design.md#optional-settings
   * This requires ability to recognize native binaries for various architectures.
   * Added ability to minimaly parse ELF binaries. PE/MachO support already exists.
   * Refactored out PE processing from BinaryUtils, so that PE-ELF-MachO parsers have similar abstractions.
* Create bundles with the appropriate layout (`v1` for `netcoreapp3.0`, `v2` for `net5`)
* Consume the new layout from the host bundle process/extraction code.
* Test cases
* Some of the AppHost rewriter files imported from the SDK repo had the license banner in a differnt format; make them consistent with rest of the files in the installer partition.

4 years agoAdd iOS build configurations (#33292)
Alexander Köplinger [Wed, 11 Mar 2020 23:55:38 +0000 (00:55 +0100)]
Add iOS build configurations (#33292)

This adds support for iOS using the Mono runtime to the build system.

4 years ago[master] Update dependencies from 4 repositories (#33230)
Santiago Fernandez Madero [Wed, 11 Mar 2020 23:19:42 +0000 (16:19 -0700)]
[master] Update dependencies from 4 repositories (#33230)

* Update dependencies from https://github.com/dotnet/arcade build 20200304.1

- Microsoft.DotNet.XUnitExtensions - 5.0.0-beta.20154.1
- Microsoft.DotNet.VersionTools.Tasks - 5.0.0-beta.20154.1
- Microsoft.DotNet.ApiCompat - 5.0.0-beta.20154.1
- Microsoft.DotNet.Arcade.Sdk - 5.0.0-beta.20154.1
- Microsoft.DotNet.Build.Tasks.Feed - 5.0.0-beta.20154.1
- Microsoft.DotNet.Build.Tasks.Packaging - 5.0.0-beta.20154.1
- Microsoft.DotNet.Build.Tasks.SharedFramework.Sdk - 5.0.0-beta.20154.1
- Microsoft.DotNet.Build.Tasks.TargetFramework.Sdk - 5.0.0-beta.20154.1
- Microsoft.DotNet.CodeAnalysis - 5.0.0-beta.20154.1
- Microsoft.DotNet.GenAPI - 5.0.0-beta.20154.1
- Microsoft.DotNet.GenFacades - 5.0.0-beta.20154.1
- Microsoft.DotNet.Helix.Sdk - 5.0.0-beta.20154.1
- Microsoft.DotNet.RemoteExecutor - 5.0.0-beta.20154.1
- Microsoft.DotNet.XUnitConsoleRunner - 2.5.1-beta.20154.1

* Update dependencies from https://github.com/microsoft/vstest build 20200305-01

- Microsoft.NET.Test.Sdk - 16.6.0-preview-20200305-01

* Update dependencies from https://github.com/dotnet/arcade build 20200305.4

- Microsoft.DotNet.XUnitExtensions - 5.0.0-beta.20155.4
- Microsoft.DotNet.VersionTools.Tasks - 5.0.0-beta.20155.4
- Microsoft.DotNet.ApiCompat - 5.0.0-beta.20155.4
- Microsoft.DotNet.Arcade.Sdk - 5.0.0-beta.20155.4
- Microsoft.DotNet.Build.Tasks.Feed - 5.0.0-beta.20155.4
- Microsoft.DotNet.Build.Tasks.Packaging - 5.0.0-beta.20155.4
- Microsoft.DotNet.Build.Tasks.SharedFramework.Sdk - 5.0.0-beta.20155.4
- Microsoft.DotNet.Build.Tasks.TargetFramework.Sdk - 5.0.0-beta.20155.4
- Microsoft.DotNet.CodeAnalysis - 5.0.0-beta.20155.4
- Microsoft.DotNet.GenAPI - 5.0.0-beta.20155.4
- Microsoft.DotNet.GenFacades - 5.0.0-beta.20155.4
- Microsoft.DotNet.Helix.Sdk - 5.0.0-beta.20155.4
- Microsoft.DotNet.RemoteExecutor - 5.0.0-beta.20155.4
- Microsoft.DotNet.XUnitConsoleRunner - 2.5.1-beta.20155.4

* Update dependencies from https://github.com/dotnet/arcade build 20200306.4

- Microsoft.DotNet.XUnitExtensions - 5.0.0-beta.20156.4
- Microsoft.DotNet.VersionTools.Tasks - 5.0.0-beta.20156.4
- Microsoft.DotNet.ApiCompat - 5.0.0-beta.20156.4
- Microsoft.DotNet.Arcade.Sdk - 5.0.0-beta.20156.4
- Microsoft.DotNet.Build.Tasks.Feed - 5.0.0-beta.20156.4
- Microsoft.DotNet.Build.Tasks.Packaging - 5.0.0-beta.20156.4
- Microsoft.DotNet.Build.Tasks.SharedFramework.Sdk - 5.0.0-beta.20156.4
- Microsoft.DotNet.Build.Tasks.TargetFramework.Sdk - 5.0.0-beta.20156.4
- Microsoft.DotNet.CodeAnalysis - 5.0.0-beta.20156.4
- Microsoft.DotNet.GenAPI - 5.0.0-beta.20156.4
- Microsoft.DotNet.GenFacades - 5.0.0-beta.20156.4
- Microsoft.DotNet.Helix.Sdk - 5.0.0-beta.20156.4
- Microsoft.DotNet.RemoteExecutor - 5.0.0-beta.20156.4
- Microsoft.DotNet.XUnitConsoleRunner - 2.5.1-beta.20156.4

* Update dependencies from https://github.com/mono/linker build 20200307.1

- ILLink.Tasks - 0.1.6-prerelease.20157.1

* Update dependencies from https://github.com/dotnet/arcade build 20200307.1

- Microsoft.DotNet.XUnitExtensions - 5.0.0-beta.20157.1
- Microsoft.DotNet.VersionTools.Tasks - 5.0.0-beta.20157.1
- Microsoft.DotNet.ApiCompat - 5.0.0-beta.20157.1
- Microsoft.DotNet.Arcade.Sdk - 5.0.0-beta.20157.1
- Microsoft.DotNet.Build.Tasks.Feed - 5.0.0-beta.20157.1
- Microsoft.DotNet.Build.Tasks.Packaging - 5.0.0-beta.20157.1
- Microsoft.DotNet.Build.Tasks.SharedFramework.Sdk - 5.0.0-beta.20157.1
- Microsoft.DotNet.Build.Tasks.TargetFramework.Sdk - 5.0.0-beta.20157.1
- Microsoft.DotNet.CodeAnalysis - 5.0.0-beta.20157.1
- Microsoft.DotNet.GenAPI - 5.0.0-beta.20157.1
- Microsoft.DotNet.GenFacades - 5.0.0-beta.20157.1
- Microsoft.DotNet.Helix.Sdk - 5.0.0-beta.20157.1
- Microsoft.DotNet.RemoteExecutor - 5.0.0-beta.20157.1
- Microsoft.DotNet.XUnitConsoleRunner - 2.5.1-beta.20157.1

* Update dependencies from https://github.com/mono/linker build 20200308.2

- ILLink.Tasks - 0.1.6-prerelease.20158.2

* Update dependencies from https://github.com/dotnet/llvm-project build 20200302.1

- runtime.win-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools - 6.0.1-alpha.1.20152.1
- runtime.win-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk - 6.0.1-alpha.1.20152.1
- runtime.osx.10.12-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools - 6.0.1-alpha.1.20152.1
- runtime.osx.10.12-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk - 6.0.1-alpha.1.20152.1
- runtime.linux-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools - 6.0.1-alpha.1.20152.1
- runtime.linux-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk - 6.0.1-alpha.1.20152.1

* Update dependencies from https://github.com/dotnet/arcade build 20200308.2

- Microsoft.DotNet.XUnitExtensions - 5.0.0-beta.20158.2
- Microsoft.DotNet.VersionTools.Tasks - 5.0.0-beta.20158.2
- Microsoft.DotNet.ApiCompat - 5.0.0-beta.20158.2
- Microsoft.DotNet.Arcade.Sdk - 5.0.0-beta.20158.2
- Microsoft.DotNet.Build.Tasks.Feed - 5.0.0-beta.20158.2
- Microsoft.DotNet.Build.Tasks.Packaging - 5.0.0-beta.20158.2
- Microsoft.DotNet.Build.Tasks.SharedFramework.Sdk - 5.0.0-beta.20158.2
- Microsoft.DotNet.Build.Tasks.TargetFramework.Sdk - 5.0.0-beta.20158.2
- Microsoft.DotNet.CodeAnalysis - 5.0.0-beta.20158.2
- Microsoft.DotNet.GenAPI - 5.0.0-beta.20158.2
- Microsoft.DotNet.GenFacades - 5.0.0-beta.20158.2
- Microsoft.DotNet.Helix.Sdk - 5.0.0-beta.20158.2
- Microsoft.DotNet.RemoteExecutor - 5.0.0-beta.20158.2
- Microsoft.DotNet.XUnitConsoleRunner - 2.5.1-beta.20158.2

* Update dependencies from https://github.com/dotnet/arcade build 20200309.2

- Microsoft.DotNet.XUnitExtensions - 5.0.0-beta.20159.2
- Microsoft.DotNet.VersionTools.Tasks - 5.0.0-beta.20159.2
- Microsoft.DotNet.ApiCompat - 5.0.0-beta.20159.2
- Microsoft.DotNet.Arcade.Sdk - 5.0.0-beta.20159.2
- Microsoft.DotNet.Build.Tasks.Feed - 5.0.0-beta.20159.2
- Microsoft.DotNet.Build.Tasks.Packaging - 5.0.0-beta.20159.2
- Microsoft.DotNet.Build.Tasks.SharedFramework.Sdk - 5.0.0-beta.20159.2
- Microsoft.DotNet.Build.Tasks.TargetFramework.Sdk - 5.0.0-beta.20159.2
- Microsoft.DotNet.CodeAnalysis - 5.0.0-beta.20159.2
- Microsoft.DotNet.GenAPI - 5.0.0-beta.20159.2
- Microsoft.DotNet.GenFacades - 5.0.0-beta.20159.2
- Microsoft.DotNet.Helix.Sdk - 5.0.0-beta.20159.2
- Microsoft.DotNet.RemoteExecutor - 5.0.0-beta.20159.2
- Microsoft.DotNet.XUnitConsoleRunner - 2.5.1-beta.20159.2

* Update dependencies from https://github.com/mono/linker build 20200309.1

- ILLink.Tasks - 0.1.6-prerelease.20159.1

* Update dependencies from https://github.com/dotnet/arcade build 20200310.4

- Microsoft.DotNet.XUnitExtensions - 5.0.0-beta.20160.4
- Microsoft.DotNet.VersionTools.Tasks - 5.0.0-beta.20160.4
- Microsoft.DotNet.ApiCompat - 5.0.0-beta.20160.4
- Microsoft.DotNet.Arcade.Sdk - 5.0.0-beta.20160.4
- Microsoft.DotNet.Build.Tasks.Feed - 5.0.0-beta.20160.4
- Microsoft.DotNet.Build.Tasks.Packaging - 5.0.0-beta.20160.4
- Microsoft.DotNet.Build.Tasks.SharedFramework.Sdk - 5.0.0-beta.20160.4
- Microsoft.DotNet.Build.Tasks.TargetFramework.Sdk - 5.0.0-beta.20160.4
- Microsoft.DotNet.CodeAnalysis - 5.0.0-beta.20160.4
- Microsoft.DotNet.GenAPI - 5.0.0-beta.20160.4
- Microsoft.DotNet.GenFacades - 5.0.0-beta.20160.4
- Microsoft.DotNet.Helix.Sdk - 5.0.0-beta.20160.4
- Microsoft.DotNet.RemoteExecutor - 5.0.0-beta.20160.4
- Microsoft.DotNet.XUnitConsoleRunner - 2.5.1-beta.20160.4

* Update dependencies from https://github.com/mono/linker build 20200310.1

- ILLink.Tasks - 0.1.6-prerelease.20160.1

* Remove GenAPI from darc updates for now until we figure out what's causing compiler to fail

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: Santiago Fernandez Madero <safern@microsoft.com>
4 years agoFix JIT crash caused by GetType() == typeof(SealedClass) optimization (#33337)
Egor Bogatov [Wed, 11 Mar 2020 23:19:00 +0000 (02:19 +0300)]
Fix JIT crash caused by GetType() == typeof(SealedClass) optimization (#33337)

Downstream phases can't handle commas under JTRUE, so do more thorough cleanup in `fgFoldConditional` for JTRUE (and SWITCH).

Fixes #33333.

4 years agoFix SuperIlc to work on Linux / OSX in composite mode (#33358)
Tomáš Rylek [Wed, 11 Mar 2020 23:15:55 +0000 (00:15 +0100)]
Fix SuperIlc to work on Linux / OSX in composite mode (#33358)

1) I have generalized the concept of framework exclusions so that
the CPAOT runner can consume it - without it we were picking up
"CommandLine.dll" in the Core_Root folder as a Crossgen2 compilation
input and R2RDump was subsequently failing to dump the file as
CommandLine.dll is one of the stupid assemblies where the assembly
name differs from the PE file name (the assembly name is
'commandline' causing a mismatch on case-sensitive file systems).

2) On Linux / OSX, we need to copy around a bunch of native libraries
to the output, e.g. libSystem.Globalization.Native.so.

Thanks

Tomas

4 years agoUpdate src/libraries/Directory.Build.props
Maryam Ariyan [Wed, 11 Mar 2020 23:04:19 +0000 (16:04 -0700)]
Update src/libraries/Directory.Build.props

Co-Authored-By: Eric StJohn <ericstj@microsoft.com>
4 years agoExclude from building Microsoft.AspNetCore.Testing
Maryam Ariyan [Wed, 11 Mar 2020 22:11:34 +0000 (15:11 -0700)]
Exclude from building Microsoft.AspNetCore.Testing

4 years agoAdding separate 2.1 SDK yaml
vivmishra [Wed, 11 Mar 2020 22:17:37 +0000 (15:17 -0700)]
Adding separate 2.1 SDK yaml

4 years agoInclude all System.Native packages in PackageOverrides (#33493)
Eric StJohn [Wed, 11 Mar 2020 22:15:51 +0000 (15:15 -0700)]
Include all System.Native packages in PackageOverrides (#33493)

4 years ago[interp] Add more Math intrinsics (#33431)
monojenkins [Wed, 11 Mar 2020 22:14:59 +0000 (18:14 -0400)]
[interp] Add more Math intrinsics (#33431)

Fixes https://github.com/dotnet/runtime/issues/33233

Co-authored-by: BrzVlad <BrzVlad@users.noreply.github.com>
4 years agoSupport table driven importation for scalar hardware intrinsics (#33350)
Kunal Pathak [Wed, 11 Mar 2020 21:48:46 +0000 (14:48 -0700)]
Support table driven importation for scalar hardware intrinsics (#33350)

* Deleted `mustExpand` parameter that we were passing to methods that never used it.
* Below xarch instructions are now imported with table driven logic:
  * NI_BMI1_AndNot
  * NI_BMI1_X64_AndNot
  * NI_BMI2_ParallelBitDeposit
  * NI_BMI2_ParallelBitExtract
  * NI_BMI2_X64_ParallelBitDeposit
  * NI_BMI2_X64_ParallelBitExtract
  * NI_BMI1_ExtractLowestSetBit
  * NI_BMI1_GetMaskUpToLowestSetBit
  * NI_BMI1_ResetLowestSetBit
  * NI_BMI1_TrailingZeroCount
  * NI_BMI1_X64_ExtractLowestSetBit
  * NI_BMI1_X64_GetMaskUpToLowestSetBit
  * NI_BMI1_X64_ResetLowestSetBit
  * NI_BMI1_X64_TrailingZeroCount
  * NI_BMI2_MultiplyNoFlags
  * NI_BMI2_X64_MultiplyNoFlags
  * InstructionSet_LZCNT
  * InstructionSet_LZCNT_X64
  * InstructionSet_POPCNT
  * InstructionSet_POPCNT_X64
  * NI_SSE42_Crc32
  * NI_SSE42_X64_Crc32
* Below ARM instructions are now imported with table driven logic:
  * NI_ArmBase_LeadingZeroCount
  * NI_ArmBase_ReverseElementBits
  * NI_ArmBase_Arm64_LeadingSignCount
  * NI_ArmBase_Arm64_LeadingZeroCount
  * NI_ArmBase_Arm64_ReverseElementBits
  * NI_Sha1_FixedRotate
  * NI_Crc32_ComputeCrc32
  * NI_Crc32_ComputeCrc32C
  * NI_Crc32_Arm64_ComputeCrc32
  * NI_Crc32_Arm64_ComputeCrc32C

* Updated the impIsTableDrivenHWIntrinsic() method to not check for `HW_Category_Scalar` anymore because almost all scalar intrinsic will be handled by table-driven. For scalar intrinsic which needs special handling I have tagged them with `HW_Flag_SpecialImport` to make sure they don't get imported using table-driven logic.
* In `hwintrinsiccodegenarm64.cpp`, I have removed a condition of `HW_Category_Special` because no instruction of arm64 were tagged with this category.
* I have created `getBaseTypeFromArgIfNeeded()` method that contains logic to extract `baesType` from args if the argument was flagged as one of `BaseTypeFromFirstArg` or `BaseTypeFromSecondArg`. This method is reused inside special handling of intrinsic for arm.

4 years agoAdd more regex tests (and fix one atomicity bug) (#33458)
Stephen Toub [Wed, 11 Mar 2020 21:28:02 +0000 (17:28 -0400)]
Add more regex tests (and fix one atomicity bug) (#33458)

* Avoid automatically making Regex loops followed by a lookbehind atomic

We allow a positive lookahead to be used to determine whether a loop can be upgraded to be atomic, but we're currently missing the RTL check that distinguishes between positive lookaheads and positive lookbehinds, so we're currently erroneously making some loops followed by positive lookbehinds atomic when we shouldn't.  Fix that just by ensuring we only traverse Require nodes when they're lookahead rather than behind.

Also, just for additional safety, change a subsequent check to ensure that the two nodes being compared have identical options.  Today we're just checking for case-sensitivity, but it's more robust (and doesn't hurt) to just check all options.

* Add more tests to boost code coverage

Plus lookaround tests for min length computation

4 years agoMerge branch 'fromoldmaster-missingfiles' of Extensions on commit:
Maryam Ariyan [Wed, 11 Mar 2020 20:58:54 +0000 (13:58 -0700)]
Merge branch 'fromoldmaster-missingfiles' of Extensions on commit:
https://github.com/dotnet/Extensions/commit/f4066026ca06984b07e90e61a6390ac38152ba93 into fromoldmaster-bringmissingfiles-1

4 years agoImplement building the repo for multiple configurations and architectures with a...
Jeremy Koritzinsky [Wed, 11 Mar 2020 20:36:56 +0000 (13:36 -0700)]
Implement building the repo for multiple configurations and architectures with a single command on Windows. (#33295)

* Implement building the repo for multiple configurations and architectures with a single command on Windows.

* Use -Command instead of -File to invoke pwsh build script.

* Run all builds and output which builds failed at the end (if any)

* Update help output.

* Prepend argument list with architecture args instead of appending so as to allow scripts to override them with MSBuild arguments.

* Fix typo.

4 years agoRemove GenAPI from darc updates for now until we figure out what's causing compiler...
Santiago Fernandez Madero [Wed, 11 Mar 2020 20:29:57 +0000 (13:29 -0700)]
Remove GenAPI from darc updates for now until we figure out what's causing compiler to fail

4 years agoJIT: enable tail calls and copy omission for implicit byref structs (#33004)
Andy Ayers [Wed, 11 Mar 2020 20:16:23 +0000 (13:16 -0700)]
JIT: enable tail calls and copy omission for implicit byref structs (#33004)

Handle cases where a caller passes an implicit byref argument struct to
a callee in tail position. There is no need to create a local copy or
to block tail calling.

To prove this is safe we must show that we're not introducing aliasing by
not copying the arguments. We do a simplistic and limited form of alias
analysis.

This pattern comes up increasingly often as we write more layered code
operating on spans and similar structs.

4 years agoMerge pull request #33484 from NikolaMilosavljevic/stop.netstandard
Nikola Milosavljevic [Wed, 11 Mar 2020 19:24:59 +0000 (12:24 -0700)]
Merge pull request #33484 from NikolaMilosavljevic/stop.netstandard

Stop building NETStandard 2.1 packages

4 years agoDisable the IL verifier for now, it can't handle code compiled without /features...
monojenkins [Wed, 11 Mar 2020 18:45:02 +0000 (14:45 -0400)]
Disable the IL verifier for now, it can't handle code compiled without /features:peverify-compat (#33478)

See https://github.com/mono/mono/issues/18572#issuecomment-595924767.

Fixes https://github.com/mono/mono/issues/18572.

Co-authored-by: vargaz <vargaz@users.noreply.github.com>
4 years agoUpdate eng/Versions.props
Nikola Milosavljevic [Wed, 11 Mar 2020 18:42:04 +0000 (11:42 -0700)]
Update eng/Versions.props

Co-Authored-By: Davis Goodin <dagood@users.noreply.github.com>
4 years agocross-crossgen job, reduce workitem size (#33436)
Jarret Shook [Wed, 11 Mar 2020 18:11:44 +0000 (11:11 -0700)]
cross-crossgen job, reduce workitem size (#33436)

* cross-crossgen job, reduce workitem size

* Fix yml authoring error

* Fix typo and add validation to corelib location

* Print run time

4 years ago[interp] Optimize delegate invokes (#33099)
monojenkins [Wed, 11 Mar 2020 18:10:09 +0000 (14:10 -0400)]
[interp] Optimize delegate invokes (#33099)

Co-authored-by: BrzVlad <BrzVlad@users.noreply.github.com>
4 years ago[mono] Optimize boxing in Pattern Matching idioms (#32194)
Egor Bogatov [Wed, 11 Mar 2020 16:45:42 +0000 (19:45 +0300)]
[mono] Optimize boxing in Pattern Matching idioms (#32194)

* Optimize boxing in Pattern Matching

4 years agoUnconditionally upgrade installed Brew packages on OSX (#33481)
Jo Shields [Wed, 11 Mar 2020 16:42:11 +0000 (12:42 -0400)]
Unconditionally upgrade installed Brew packages on OSX (#33481)

With Apt, if you have X 1.0 installed, 1.1 exists in the package manifest, and say "install X", X is upgraded to 1.1. With Brew, a fatal error is thrown.

Blindly upgrading all previously installed packages is not ideal, and not a perfect mirror for the Apt behaviour, but it should mean that if X is previously installed it gets upgraded (causing a warning during install, when it's asked to be installed again with the same version), and if it's not already installed then it gets installed later.

Closes: https://github.com/dotnet/runtime/issues/33471

4 years agoStop building NETStandard 2.1 packages
Nikola Milosavljevic (CLR) [Wed, 11 Mar 2020 16:14:20 +0000 (09:14 -0700)]
Stop building NETStandard 2.1 packages

4 years agoImprove ProcessManager.Win (#32010)
Next Turn [Wed, 11 Mar 2020 15:48:50 +0000 (23:48 +0800)]
Improve ProcessManager.Win (#32010)

* ---- Style changes start here ----

* Remove unnecessary using directives

* Remove unnecessary assignments

* Use IntPtr.Zero

* Replace magic numbers

* Remove unused parameters

* Replace constructor with initializer

* Simplify delegate interop

* Inline temporary variables

* Remove unnecessary checked keyword

* Remove unnecessary cast

* Introduce using statement

* ---- Style changes end here ----

* Remove magic sleep

* Prealloc list

* Reduce copying

* Use ArrayPool

* Support long path

* Improve P/Invoke signatures

* Optimize modules enumeration

* Rename and move HandleLastWin32Error

* while (true)

* Move comments near codes

* Revert "Support long path"

This reverts commit 1f06435144925668e7273ec458e78b869aad6055.

* Revert "Introduce using statement"

This reverts commit e3d383a229c13b096dbdef9aa9c857ee6cf986e1.

* Revert "Remove magic sleep"

This reverts commit d8bc0017131a9d9d6c1f66569a87699f9f7faea6.

* Add braces

* Simplify initialization

* Fix last Win32 error

* Avoid reallocation if modules count decreased

* Nits

* Simplify codes

4 years agoRe-use StringBuilder inside iteration (#32759)
Alaa Masoud [Wed, 11 Mar 2020 14:59:59 +0000 (17:59 +0300)]
Re-use StringBuilder inside iteration (#32759)

* Re-use StringBuilder inside iteration

* another one

* Reuse StringBuilder in tools

* Revert accidental formatting

* pr feedback

* formatting

* 1 more

4 years agoMerge pull request #33455 from NikolaMilosavljevic/libicu65
Nikola Milosavljevic [Wed, 11 Mar 2020 14:22:00 +0000 (07:22 -0700)]
Merge pull request #33455 from NikolaMilosavljevic/libicu65

Add libicu65 to DEB deps package

4 years ago[arm] Fix branch island disassembly for arm64 and thumb. (#33469)
monojenkins [Wed, 11 Mar 2020 12:43:53 +0000 (08:43 -0400)]
[arm] Fix branch island disassembly for arm64 and thumb. (#33469)

Followup to https://github.com/mono/mono/pull/19126 and
https://github.com/mono/mono/pull/19169.

Bring arm64 `mono_arch_get_call_target` in line with other platforms by
returning NULL on failure instead of asserting. Bits 30-26 in an arm64
unconditional branch are exactly 0b00101, so 0x1f (0b11111) is used as a
mask to determine if the branch uses an immediate target--0x7 (0b111)
would incorrectly match against branches using register targets. The
extracted immediate is now sign extended in a branch-free way.

Avoid following blx entries in the method address table; ld64 can emit 4
different instruction sequences for islands involving thumb, and I'd
rather not implement support for them all now because 32-bit iOS is old
and large unlinked assemblies seem rare.

Co-authored-by: imhameed <imhameed@users.noreply.github.com>
4 years agoUpdate unwind.c to minimize usage of 'while (TRUE)' (#33107)
pi1024e [Wed, 11 Mar 2020 12:41:03 +0000 (08:41 -0400)]
Update unwind.c to minimize usage of 'while (TRUE)' (#33107)

There is no need to have a "while (TRUE)" statement if we can check at the end of the loop or at the beginning.

4 years agoUpdate dependencies from https://github.com/mono/linker build 20200310.1
dotnet-maestro[bot] [Wed, 11 Mar 2020 12:18:01 +0000 (12:18 +0000)]
Update dependencies from https://github.com/mono/linker build 20200310.1

- ILLink.Tasks - 0.1.6-prerelease.20160.1

4 years agoUpdate dependencies from https://github.com/dotnet/arcade build 20200310.4
dotnet-maestro[bot] [Wed, 11 Mar 2020 12:17:24 +0000 (12:17 +0000)]
Update dependencies from https://github.com/dotnet/arcade build 20200310.4

- Microsoft.DotNet.XUnitExtensions - 5.0.0-beta.20160.4
- Microsoft.DotNet.VersionTools.Tasks - 5.0.0-beta.20160.4
- Microsoft.DotNet.ApiCompat - 5.0.0-beta.20160.4
- Microsoft.DotNet.Arcade.Sdk - 5.0.0-beta.20160.4
- Microsoft.DotNet.Build.Tasks.Feed - 5.0.0-beta.20160.4
- Microsoft.DotNet.Build.Tasks.Packaging - 5.0.0-beta.20160.4
- Microsoft.DotNet.Build.Tasks.SharedFramework.Sdk - 5.0.0-beta.20160.4
- Microsoft.DotNet.Build.Tasks.TargetFramework.Sdk - 5.0.0-beta.20160.4
- Microsoft.DotNet.CodeAnalysis - 5.0.0-beta.20160.4
- Microsoft.DotNet.GenAPI - 5.0.0-beta.20160.4
- Microsoft.DotNet.GenFacades - 5.0.0-beta.20160.4
- Microsoft.DotNet.Helix.Sdk - 5.0.0-beta.20160.4
- Microsoft.DotNet.RemoteExecutor - 5.0.0-beta.20160.4
- Microsoft.DotNet.XUnitConsoleRunner - 2.5.1-beta.20160.4

4 years ago[interp][32bit] Fix warning about precedence/parentheses. (#33468)
monojenkins [Wed, 11 Mar 2020 11:43:21 +0000 (07:43 -0400)]
[interp][32bit] Fix warning about precedence/parentheses. (#33468)

/s/mono2/mono/mini/interp/transform.c:3166:25: note: place parentheses around
      the '&&' expression to silence this warning
        if (mt >= MINT_TYPE_I1 && mt <= MINT_TYPE_I4
            ~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~

Co-authored-by: jaykrell <jaykrell@users.noreply.github.com>
4 years ago[mini] Fix warning about unused variables. (#33453)
monojenkins [Wed, 11 Mar 2020 09:18:02 +0000 (05:18 -0400)]
[mini] Fix warning about unused variables. (#33453)

/s/mono2/mono/mini/mini-generic-sharing.c:1415:9: warning: unused variable
      'param_names' [-Wunused-variable]
        char **param_names;

Co-authored-by: jaykrell <jaykrell@users.noreply.github.com>
4 years ago[wasm] Fix warnings about unused variables. (#33451)
monojenkins [Wed, 11 Mar 2020 09:14:21 +0000 (05:14 -0400)]
[wasm] Fix warnings about unused variables. (#33451)

/s/mono2/mono/metadata/sgen-mono.c:2883:16: warning: unused variable
      'last_major_gc_warned' [-Wunused-variable]
        static gint32 last_major_gc_warned = -1;
                      ^
/s/mono2/mono/metadata/sgen-mono.c:2884:16: warning: unused variable
      'num_degraded' [-Wunused-variable]
        static gint32 num_degraded = 0;
                      ^
/s/mono2/mono/metadata/sgen-mono.c:2886:9: warning: unused variable
      'major_gc_count' [-Wunused-variable]
        gint32 major_gc_count = mono_atomic_load_i32 (&mono_gc_stats.maj...
               ^

Co-authored-by: jaykrell <jaykrell@users.noreply.github.com>
4 years agoFix warnings about misleading indentation. (#33456)
monojenkins [Wed, 11 Mar 2020 09:12:18 +0000 (05:12 -0400)]
Fix warnings about misleading indentation. (#33456)

This is subtle and not actually misleading,
because it tends to be space tab or space tab, not wrong
number of tabs or significant wrong number of spaces.

/s/mono2/mono/metadata/class.c:4010:6: warning: misleading indentation;
      statement is not part of the previous 'if' [-Wmisleading-indentation]
                                 if (mono_class_implement_interface_slo...

/s/mono2/mono/metadata/class.c:4039:3: warning: misleading indentation;
      statement is not part of the previous 'if' [-Wmisleading-indentation]
        if (m_class_is_delegate (target) && mono_class_has_variant_gener...

/s/mono2/mono/mini/driver.c:1780:4: warning: misleading indentation; statement
      is not part of the previous 'if' [-Wmisleading-indentation]
                if (strncmp (argv [i], "--debugger-agent=", 17) == 0) {

Co-authored-by: jaykrell <jaykrell@users.noreply.github.com>
4 years ago[wasm] Fix warnings about unused variables. (#33452)
monojenkins [Wed, 11 Mar 2020 09:09:08 +0000 (05:09 -0400)]
[wasm] Fix warnings about unused variables. (#33452)

/s/mono2/mono/mini/mini-runtime.c:2284:15: warning: unused variable 'ji'
      [-Wunused-variable]
        MonoJitInfo *ji;

Co-authored-by: jaykrell <jaykrell@users.noreply.github.com>
4 years agoImplement CBOR array support
Eirik Tsarpalis [Wed, 11 Mar 2020 05:39:51 +0000 (05:39 +0000)]
Implement CBOR array support

* Implement array support for CborWriter

* convert CborReader to class

* add CborReaderState enum

* Implement CborReader array support

* refactor reader tests

* add peek state assertions in happy path tests

* remove redundant assertion

* Update src/libraries/System.Security.Cryptography.Encoding/tests/Cbor.Tests/CborReaderTests.Array.cs

Co-Authored-By: Jeremy Barton <jbarton@microsoft.com>
* Update src/libraries/System.Security.Cryptography.Encoding/tests/Cbor.Tests/CborWriterTests.Array.cs

Co-Authored-By: Jeremy Barton <jbarton@microsoft.com>
* address feedback

* styling

* BeginWriteArray -> WriteStartArray

* rename CborReaderState.EOF to CborReaderState.EndOfData

* add BytesRead and BytesWritten properties

* add an `Unknown` enum case for zero values

Co-authored-by: Jeremy Barton <jbarton@microsoft.com>
4 years agoDon't probe for A/W variants of entry points on non-Windows. (#33250)
Jeremy Koritzinsky [Wed, 11 Mar 2020 04:16:07 +0000 (21:16 -0700)]
Don't probe for A/W variants of entry points on non-Windows. (#33250)

* Don't probe for A/W variants of entry points on non-Windows.

* Cal PAL_GetProcAddressDirect directly on Unix.

* Remove dependence on A/W probing on non-Windows.

4 years agoRemove `AllocLHeap`. (#33402)
Vladimir Sadov [Wed, 11 Mar 2020 01:09:32 +0000 (18:09 -0700)]
Remove `AllocLHeap`. (#33402)

* The main difference of `AllocLHeap` is that it uses per-heap acontext instead of per-thread. There is no advantage in that and results in allocations under-reported in `GetAllocatedBytesForCurrentThread`

This change unifies to one allocation entry point - `Alloc` (and its `AllocAlign8` variety)

* Removed AllocAlign8

* PR feedback - some refactoring to merge duplicate calls to `Alloc`

* Splited an `ifdef/else`  in two to not cross code blocks.

* No need to update `GC_INTERFACE_MAJOR_VERSION` more than once per release. And we already did for this one.

4 years agoSave stack arguments size in InlinedCallFrame.m_Datum on x86 to handle callee's poppi...
Fadi Hanna [Tue, 10 Mar 2020 23:47:52 +0000 (16:47 -0700)]
Save stack arguments size in InlinedCallFrame.m_Datum on x86 to handle callee's popping of arguments (#33249)

* Save stack arguments size in InlinedCallFrame.m_Datum on x86 to handle callee's popping of arguments

4 years agoAdd libicu65 to DEB deps
Nikola Milosavljevic [Tue, 10 Mar 2020 22:32:07 +0000 (22:32 +0000)]
Add libicu65 to DEB deps

4 years agoRevert "Enable restore for ref and src projects in libraries (#33242)" (#33437)
Viktor Hofer [Tue, 10 Mar 2020 20:33:27 +0000 (21:33 +0100)]
Revert "Enable restore for ref and src projects in libraries (#33242)" (#33437)

This reverts commit 981cc64bc42eeed5c5634ad8f3680398039603cc.

4 years agoImplement Marshal.GetIDispatchForObject on platforms with COM support (#33403)
Elinor Fung [Tue, 10 Mar 2020 19:24:48 +0000 (12:24 -0700)]
Implement Marshal.GetIDispatchForObject on platforms with COM support (#33403)

4 years agoAdd XML doc comments for Get/SetRawSocketOption (#33390)
Stephen Toub [Tue, 10 Mar 2020 18:07:28 +0000 (14:07 -0400)]
Add XML doc comments for Get/SetRawSocketOption (#33390)

* Add XML doc comments for Get/SetRawSocketOption

I neglected to add XML doc comments for these new APIs in previous PR.  Fixing that.

* Update src/libraries/System.Net.Sockets/src/System/Net/Sockets/Socket.cs

Co-Authored-By: Günther Foidl <gue@korporal.at>
Co-authored-by: Günther Foidl <gue@korporal.at>
4 years agoFix getting time zone names with Invariant Culture (#33318)
Tarek Mahmoud Sayed [Tue, 10 Mar 2020 16:38:34 +0000 (09:38 -0700)]
Fix getting time zone names with Invariant Culture (#33318)

* Fix getting time zone names with Invariant Culture

* Address the feedback

* Restrict the test to English languages only.

* Fix misspelling

* Remove un-needed line

4 years agoMove JIT documentation to new docs/design/coreclr/jit directory (#33321)
Bruce Forstall [Tue, 10 Mar 2020 15:53:57 +0000 (08:53 -0700)]
Move JIT documentation to new docs/design/coreclr/jit directory (#33321)

Reduce clutter in the shared directory, and make it easier to find
all the JIT-related documentation.

4 years agoFix very minor typo (#33423)
tub5 [Tue, 10 Mar 2020 15:11:02 +0000 (15:11 +0000)]
Fix very minor typo (#33423)

Co-authored-by: Ben Rothermel <ben.rothermel@tocabot.io>
4 years ago[mono] Include filename in Invalid image error messages (#33117)
Mitchell Hwang [Tue, 10 Mar 2020 14:48:36 +0000 (10:48 -0400)]
[mono] Include filename in Invalid image error messages (#33117)

* [mono] Include filename in Invalid Image message

* [mono] Rename Invalid Image to File Not Found where applicable

* [Mono] Remove ActiveIssue attributes 31649 and 31650

* Touch up callers of mono_error_set_simple_file_not_found in appdomain.c

* Specify file name in mono_error_set_simple_file_not_found reflection_only message

* Touch up mono_error_set_file_not_found callers in icall.c

* Include image name in mono_error_set_bad_image_by_name calls in metadata.c

* Include aot name in mono_error_set_bad_image_by_name calls in aot-runtime.c

Co-authored-by: Mitchell Hwang <mihw@microsoft.com>
Co-authored-by: Mitchell Hwang <mitchell.hwang@microsoft.com>
4 years ago[mono] Disable SIMD support for Windows target (#33421)
Egor Bogatov [Tue, 10 Mar 2020 13:45:23 +0000 (16:45 +0300)]
[mono] Disable SIMD support for Windows target (#33421)

A temp fix for #1933.

4 years agoEnable restore for ref and src projects in libraries (#33242)
Viktor Hofer [Tue, 10 Mar 2020 12:48:20 +0000 (13:48 +0100)]
Enable restore for ref and src projects in libraries (#33242)

* Enable restore for projects in libraries

Enabling project restore for ref and src projects

* Remove winrt.depproj

* Remove tools.depproj

* Enable upfront restore

* Fix casing of PInvokeAnalyzerException file

* Remove harvestPackages.depproj and refactoring

Removing havestPackages.depproj in favor of a target that is hooked
into Arcade's repo restore phase in Tools.props.

Additionally moving common properties that are used both in Arcade and
the repo inside Configurations.props. Before they were scattered around
multiple places (Versions.props, Subsets.props).

* Set ilasm/ildasm RID for restore

* Sequence restore into steps out of upfront restore

* Fix docker entrypoints by using build.cmd/sh

4 years agoUpdate dependencies from https://github.com/mono/linker build 20200309.1
dotnet-maestro[bot] [Tue, 10 Mar 2020 12:17:44 +0000 (12:17 +0000)]
Update dependencies from https://github.com/mono/linker build 20200309.1

- ILLink.Tasks - 0.1.6-prerelease.20159.1

4 years agoUpdate dependencies from https://github.com/dotnet/arcade build 20200309.2
dotnet-maestro[bot] [Tue, 10 Mar 2020 12:17:11 +0000 (12:17 +0000)]
Update dependencies from https://github.com/dotnet/arcade build 20200309.2

- Microsoft.DotNet.XUnitExtensions - 5.0.0-beta.20159.2
- Microsoft.DotNet.VersionTools.Tasks - 5.0.0-beta.20159.2
- Microsoft.DotNet.ApiCompat - 5.0.0-beta.20159.2
- Microsoft.DotNet.Arcade.Sdk - 5.0.0-beta.20159.2
- Microsoft.DotNet.Build.Tasks.Feed - 5.0.0-beta.20159.2
- Microsoft.DotNet.Build.Tasks.Packaging - 5.0.0-beta.20159.2
- Microsoft.DotNet.Build.Tasks.SharedFramework.Sdk - 5.0.0-beta.20159.2
- Microsoft.DotNet.Build.Tasks.TargetFramework.Sdk - 5.0.0-beta.20159.2
- Microsoft.DotNet.CodeAnalysis - 5.0.0-beta.20159.2
- Microsoft.DotNet.GenAPI - 5.0.0-beta.20159.2
- Microsoft.DotNet.GenFacades - 5.0.0-beta.20159.2
- Microsoft.DotNet.Helix.Sdk - 5.0.0-beta.20159.2
- Microsoft.DotNet.RemoteExecutor - 5.0.0-beta.20159.2
- Microsoft.DotNet.XUnitConsoleRunner - 2.5.1-beta.20159.2

4 years ago[interp] Add EXCEPTION_CHECKPOINT to MINT_JMP consistent with other method tranform...
monojenkins [Tue, 10 Mar 2020 12:00:53 +0000 (08:00 -0400)]
[interp] Add EXCEPTION_CHECKPOINT to MINT_JMP consistent with other method tranform paths. (#33359)

Co-authored-by: jaykrell <jaykrell@users.noreply.github.com>
4 years agoConvert PLT table and call site to execute only on AMD64. (#33120)
monojenkins [Tue, 10 Mar 2020 11:20:11 +0000 (07:20 -0400)]
Convert PLT table and call site to execute only on AMD64. (#33120)

Current implementation embedded critical runtime information directly into PLT slot. It also depends on finding call site in generic trampoline reading call target from instruction stream in order to locate PLT slot in use and then read GOT offset as well as PLT info offset from PLT slot instruction stream.

This is problematic on platforms where code is execute only. Fix changes how the metadata needed in order to correctly patch PLT is discovered. Instead of depending on reading instruction stream, it is loaded into RAX (free to be used when calling through PLT on AMD64) in PLT slot before jmp takes place that moves control over to generic trampoline.

The PLT slot is the only place where we have access to both GOT index (used in jmp), PLT info offset (currently embedded after jmp instruction) and emitted PLT slot index. Since PLT slot index can be used to recover GOT offset used by PLT slot as well as PLT info offset at runtime, PLT slot index will be emitted into instruction stream and loaded into RAX (prepared to be configurable to other reg if needed) before doing the jump over to generic trampoline. Size of emitted imm constant is optimized based on number of total PLT slots used in image, meaning that 1, 2, or 4 bytes could be used to store PLT slot index as an imm constant in instruction stream. The additional jmp should have minimal to no performance overhead since it should complete within 1 cycle, reading imm constant from instruction stream that shouldn’t incur additional cache misses and sine there is no data dependency between mov and jmp, there should be options to pipeline both instructions.  Since mov has smaller latency than indirect jmp, mov should be complete once control gets into the generic tramp (if pipelined).

In order to resolve plt info offset at runtime, needed information is now emitted as part of got_info_offsets, increase table with 4 bytes/plt slot, same size currently emitted into the PLT slot instruction stream.

Code size of PLT slot is currently 10 bytes (6 bytes jmp and 4 byte PLT info offset). Since PLT info offset has been moved into got_info_offset table, size of PLT slot will be 2, 4, 5 byte mov (depending on needed imm size) and 6 bytes jmp instruction. As an example, mscorlib can emit all its PLT slots using 2 byte imm constant, meaning that the PLT slot will still be 10 bytes, but since PLT info offset of 4 bytes is moved into got_info_offset, total image increase will be 4 bytes/PLT slot. This is however still cheaper than alternatives that would burn 1 trampoline/PLT slot (at least 10 additional bytes/slot) or setup lookup tables in image or calculate more info at runtime, all-consuming more memory in total.

Note, using this approach is optional and runtime needs to be built using MONO_ARCH_CODE_EXEC_ONLY in order to enable it since it’s only an opt in features on platforms that can't read from instructions stream.

Current implementation is AMD64 only, but same pattern could be applied to other architectures when needed.

Co-authored-by: lateralusX <lateralusX@users.noreply.github.com>
4 years agoFix overaggressive CanBeMadeAtomic check for Set + Notone (#33405)
Stephen Toub [Tue, 10 Mar 2020 10:51:07 +0000 (06:51 -0400)]
Fix overaggressive CanBeMadeAtomic check for Set + Notone (#33405)

We're erroneously converting a set loop to be atomic when it's followed by a notone where the notone's character is in the set.  But if we for example have `[ab]*[^a]`, we can't make the loop atomic, because the `[ab]*` can actually give back something (a `b`) that the `[^a]` will match.  The fix is simply to delete the erroneous, overaggressive checks.

4 years ago[Mono] Intrinsify Interlocked.And and Interlocked.Or using LLVM (#33253)
Egor Bogatov [Tue, 10 Mar 2020 08:49:05 +0000 (11:49 +0300)]
[Mono] Intrinsify Interlocked.And and Interlocked.Or using LLVM (#33253)

* Intrinsify Interlocked.And and Interlocked.Or

4 years agoFix misleading-indentation compilation error under clang 10 (#33406)
Omair Majid [Tue, 10 Mar 2020 07:13:14 +0000 (03:13 -0400)]
Fix misleading-indentation compilation error under clang 10 (#33406)

The error looks like this (seen in dotnet/coreclr repo):

    In file included from /root/coreclr/src/ildasm/dasm_mi.cpp:7:
    /root/coreclr/src/ildasm/exe/../../tools/metainfo/mdinfo.cpp:1951:9: error: misleading indentation; statement is not part of the previous 'if' [-Werror,-Wmisleading-indentation]
        if (!wcscmp(W("__DecoratedName"), rcName))
        ^
    /root/coreclr/src/ildasm/exe/../../tools/metainfo/mdinfo.cpp:1947:5: note: previous statement is here
if (pSig && pMethName)
^
    1 error generated.

4 years agoMark PerformanceCounter_PerformanceData is a stress test. (#33410)
Tarek Mahmoud Sayed [Tue, 10 Mar 2020 07:12:09 +0000 (00:12 -0700)]
Mark PerformanceCounter_PerformanceData is a stress test. (#33410)

This is done to avoid running this test by default which can cause a timeout in CI.

4 years agoDelete porting_guide (#33411)
Jan Kotas [Tue, 10 Mar 2020 05:48:46 +0000 (22:48 -0700)]
Delete porting_guide (#33411)

The live version of the porting guide with a lot more details lives at https://docs.microsoft.com/en-us/dotnet/standard/serialization/system-text-json-migrate-from-newtonsoft-how-to

4 years agoAdd License Header to Installer Test Assets (#33408)
Swaroop Sridhar [Tue, 10 Mar 2020 01:48:00 +0000 (18:48 -0700)]
Add License Header to Installer Test Assets (#33408)

D:\git\_runtime\src\installer\test\Assets\TestProjects\... files were missing licence headers.
This change adds them.

4 years agoConsolidate objcopy detection (#33342)
Adeel Mujahid [Tue, 10 Mar 2020 00:08:21 +0000 (02:08 +0200)]
Consolidate objcopy detection (#33342)

4 years ago[jit] Implement support for all Sse1 intrinsics for netcore. (#33356)
Zoltan Varga [Mon, 9 Mar 2020 22:37:37 +0000 (18:37 -0400)]
[jit] Implement support for all Sse1 intrinsics for netcore. (#33356)

* [jit] Implement support for all Sse1 intrinsics for netcore.

* Add generic OP_XOP opcodes for opcodes which the JIT doesn't care about.
  Add a SimdOp enum to list the operations performed by these opcodes.
* Add a SimdIntrinsic struct so the mapping between the .net methods
  and the JIT opcodes can be specified declaratively.
* Add all intrinsics from the Sse class.

* Fix UnpackHigh/UnpackLow.

* Implement missing load/store intrinsics.

* Implement missing opcodes.

* Fix nontemporal metadata.

* Fix MOVNTPS alignment..

* Fix OP_XOP_X_X.

4 years agoDisable IBCMerge on OSX builds (#33393)
Jeremy Koritzinsky [Mon, 9 Mar 2020 22:37:24 +0000 (15:37 -0700)]
Disable IBCMerge on OSX builds (#33393)

* Disable System.Private.CoreLib IBCMerge on MacOS.

* Disable IBCMerge on mac across the board.

* Update comment to include link to issue.

4 years agoCalculate log path after build type is set (#33196)
Juan Hoyos [Mon, 9 Mar 2020 22:24:01 +0000 (15:24 -0700)]
Calculate log path after build type is set (#33196)

4 years agoAnnotate System.Net.NetworkInformation for nullable (#32990)
buyaa-n [Mon, 9 Mar 2020 22:02:21 +0000 (15:02 -0700)]
Annotate System.Net.NetworkInformation for nullable (#32990)

* Annotate System.Net.NetworkInformation for nullable

4 years agoSimplify codeman (#33380)
pi1024e [Mon, 9 Mar 2020 21:30:26 +0000 (17:30 -0400)]
Simplify codeman (#33380)

4 years agoRemove duplicated entries (#33371)
pi1024e [Mon, 9 Mar 2020 21:14:27 +0000 (17:14 -0400)]
Remove duplicated entries (#33371)

4 years agoUpdate SDK to 5.0.100-preview.2.20157.1 (#33396)
Viktor Hofer [Mon, 9 Mar 2020 20:51:07 +0000 (21:51 +0100)]
Update SDK to 5.0.100-preview.2.20157.1 (#33396)

This contains the Microsoft.Build.NuGetSdkResolver change with the commit 64f2febf7d1de8b0228eca5afed97a96c5a30bba. This fixes the flaky nuget restore issues.

4 years ago[arm][ios] Follow branch islands when determining method entry addresses. (#33182)
monojenkins [Mon, 9 Mar 2020 19:31:17 +0000 (15:31 -0400)]
[arm][ios] Follow branch islands when determining method entry addresses. (#33182)

Fixes https://github.com/mono/mono/issues/18612; `aot_code_low_addr` and
`aot_code_high_addr` were set to a range that included only first-level
branch islands, so `find_aot_module` would fail early when passed a
genuine function address.

This change only affects monotouch for now.

Why not use relative offsets stored in a read-only section? One reason
is that llvm-as cannot handle a `.long` directive containing a
subtraction expression involving externally-defined symbols. The AOT
method address table and AOT LLVM-generated code are currently emitted
in separate object files, so the method address table would include
expressions with undefined symbols.

Related: https://xamarin.github.io/bugzilla-archives/70/707/bug.html

Co-authored-by: imhameed <imhameed@users.noreply.github.com>
4 years agoNo need to force to bool, when C does that automatically in the if statement. (#33045)
pi1024e [Mon, 9 Mar 2020 19:28:57 +0000 (15:28 -0400)]
No need to force to bool, when C does that automatically in the if statement. (#33045)

In C, the if statement checks if the value is 0 or not 0. !!, or forcing to 1 or 0, is unnecessary here.

4 years agoRevert "Revert "Dynamic generic dictionary expansion feature (#32270) (#33343)
Jan Kotas [Mon, 9 Mar 2020 17:34:36 +0000 (10:34 -0700)]
Revert "Revert "Dynamic generic dictionary expansion feature (#32270) (#33343)

* Revert "Revert "Dynamic generic dictionary expansion feature (#32270)" (#33310)"

This reverts commit dca34293ad3741dfa4a4f7b81ac821d28460801e.

* Fix race condition in dynamic dictionary resizing

4 years agoRemove redundant mono_gc_collect during domain unload (#33229)
monojenkins [Mon, 9 Mar 2020 15:49:12 +0000 (11:49 -0400)]
Remove redundant mono_gc_collect during domain unload (#33229)

During unload_thread_main, **mono_gc_collect** is called 3 times.

First: https://github.com/mono/mono/blob/280e9d2423549d86686716f0818bcdbac9702ea1/mono/metadata/gc.c#L455

Second: https://github.com/mono/mono/blob/b4c506c3045516349d03ce8f3fe9fa5b79a7271c/mono/metadata/appdomain.c#L3305

Third: https://github.com/mono/mono/blob/b4c506c3045516349d03ce8f3fe9fa5b79a7271c/mono/metadata/appdomain.c#L3324

This PR #ifdefs the Second GC Collect for Boehm as it does not use remsets, and removes the third one completely.

The comment for the second gc_collect existence mentions that:

> We need to make sure that we don't have any remsets pointing into static data...(cont)
> However, Unity uses Boehm so it can be defined out.

There seems to be no good reason for the third GC collect, as it is already called before in mono_domain_finalize, It seems like it doesn't do anything using Visual Studio Profiler to check the heap size before and after the gc_collect. **mono_get_heap_size** also remains the same before and after as well (for the second and third at least).

Co-authored-by: Rares95 <Rares95@users.noreply.github.com>
4 years agoRespect -runtimeconfiguration with -vs switch (#33355)
Viktor Hofer [Mon, 9 Mar 2020 14:15:58 +0000 (15:15 +0100)]
Respect -runtimeconfiguration with -vs switch (#33355)

When using the -vs switch, the -runtimeconfiguration value will now be
respected so that building with mixed configurations between libraries
and the runtime inside VS is possible.

4 years agoms-vscode.csharp to ms-dotnettools.csharp (#33354)
Mattias Karlsson [Mon, 9 Mar 2020 13:00:22 +0000 (14:00 +0100)]
ms-vscode.csharp to ms-dotnettools.csharp (#33354)

C# extension has changed its name from "ms-vscode.csharp" to "ms-dotnettools.csharp".

4 years agoUpdate dependencies from https://github.com/dotnet/arcade build 20200308.2
dotnet-maestro[bot] [Mon, 9 Mar 2020 12:33:51 +0000 (12:33 +0000)]
Update dependencies from https://github.com/dotnet/arcade build 20200308.2

- Microsoft.DotNet.XUnitExtensions - 5.0.0-beta.20158.2
- Microsoft.DotNet.VersionTools.Tasks - 5.0.0-beta.20158.2
- Microsoft.DotNet.ApiCompat - 5.0.0-beta.20158.2
- Microsoft.DotNet.Arcade.Sdk - 5.0.0-beta.20158.2
- Microsoft.DotNet.Build.Tasks.Feed - 5.0.0-beta.20158.2
- Microsoft.DotNet.Build.Tasks.Packaging - 5.0.0-beta.20158.2
- Microsoft.DotNet.Build.Tasks.SharedFramework.Sdk - 5.0.0-beta.20158.2
- Microsoft.DotNet.Build.Tasks.TargetFramework.Sdk - 5.0.0-beta.20158.2
- Microsoft.DotNet.CodeAnalysis - 5.0.0-beta.20158.2
- Microsoft.DotNet.GenAPI - 5.0.0-beta.20158.2
- Microsoft.DotNet.GenFacades - 5.0.0-beta.20158.2
- Microsoft.DotNet.Helix.Sdk - 5.0.0-beta.20158.2
- Microsoft.DotNet.RemoteExecutor - 5.0.0-beta.20158.2
- Microsoft.DotNet.XUnitConsoleRunner - 2.5.1-beta.20158.2

4 years agoUpdate dependencies from https://github.com/dotnet/llvm-project build 20200302.1
dotnet-maestro[bot] [Mon, 9 Mar 2020 12:10:21 +0000 (12:10 +0000)]
Update dependencies from https://github.com/dotnet/llvm-project build 20200302.1

- runtime.win-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools - 6.0.1-alpha.1.20152.1
- runtime.win-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk - 6.0.1-alpha.1.20152.1
- runtime.osx.10.12-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools - 6.0.1-alpha.1.20152.1
- runtime.osx.10.12-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk - 6.0.1-alpha.1.20152.1
- runtime.linux-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools - 6.0.1-alpha.1.20152.1
- runtime.linux-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk - 6.0.1-alpha.1.20152.1

4 years agoFix ARM64 intrinsic namespace in crossgen and crossgen2 (#32942)
Anton Lapounov [Mon, 9 Mar 2020 10:15:04 +0000 (03:15 -0700)]
Fix ARM64 intrinsic namespace in crossgen and crossgen2 (#32942)

We did not update the hard-coded intrinsic namespace in crossgen and crossgen2 when moved ARM64 intrinsics to a different namespace.

4 years agoWorkaround inefficient codegen for thread statics in latest MSVC (#33347)
Jan Kotas [Mon, 9 Mar 2020 06:50:05 +0000 (23:50 -0700)]
Workaround inefficient codegen for thread statics in latest MSVC (#33347)

GetThread() is no longer getting in latest MSVC and includes unnecessary call
to __dyn_tls_on_demand_init. Removing the extern "C" and applying a __declspec(selectany)
makes the compiler to generate same code as before.

Fixes for #33341

4 years agoGCC compilation fixes (#33345)
Sinan Kaya [Mon, 9 Mar 2020 04:37:23 +0000 (00:37 -0400)]
GCC compilation fixes (#33345)

* Multiply defined

* Cast to size_t

* operator precedence

4 years agoDelete .NET Framework-specific hosting flags (#33353)
Jan Kotas [Mon, 9 Mar 2020 03:56:18 +0000 (20:56 -0700)]
Delete .NET Framework-specific hosting flags (#33353)

There is only one way to host CoreCLR. These hosting flags always ended up being set the same way in CoreCLR.

4 years agoDelete dead code (#33348)
Jan Kotas [Mon, 9 Mar 2020 03:55:20 +0000 (20:55 -0700)]
Delete dead code (#33348)

* Delete remoting left-overs

* Delete StressOn

* Delete API thread stress

* Delete unused variables

* Delete REGUTIL::s_fUseRegistry

4 years agoMerge pull request #33306 from NikolaMilosavljevic/osx.version
Nikola Milosavljevic [Sun, 8 Mar 2020 21:41:33 +0000 (14:41 -0700)]
Merge pull request #33306 from NikolaMilosavljevic/osx.version

Change minimum required OSX version to 10.13

4 years agoUpdate dependencies from https://github.com/mono/linker build 20200308.2
dotnet-maestro[bot] [Sun, 8 Mar 2020 12:17:54 +0000 (12:17 +0000)]
Update dependencies from https://github.com/mono/linker build 20200308.2

- ILLink.Tasks - 0.1.6-prerelease.20158.2

4 years agoUpdate dependencies from https://github.com/dotnet/arcade build 20200307.1
dotnet-maestro[bot] [Sun, 8 Mar 2020 12:17:18 +0000 (12:17 +0000)]
Update dependencies from https://github.com/dotnet/arcade build 20200307.1

- Microsoft.DotNet.XUnitExtensions - 5.0.0-beta.20157.1
- Microsoft.DotNet.VersionTools.Tasks - 5.0.0-beta.20157.1
- Microsoft.DotNet.ApiCompat - 5.0.0-beta.20157.1
- Microsoft.DotNet.Arcade.Sdk - 5.0.0-beta.20157.1
- Microsoft.DotNet.Build.Tasks.Feed - 5.0.0-beta.20157.1
- Microsoft.DotNet.Build.Tasks.Packaging - 5.0.0-beta.20157.1
- Microsoft.DotNet.Build.Tasks.SharedFramework.Sdk - 5.0.0-beta.20157.1
- Microsoft.DotNet.Build.Tasks.TargetFramework.Sdk - 5.0.0-beta.20157.1
- Microsoft.DotNet.CodeAnalysis - 5.0.0-beta.20157.1
- Microsoft.DotNet.GenAPI - 5.0.0-beta.20157.1
- Microsoft.DotNet.GenFacades - 5.0.0-beta.20157.1
- Microsoft.DotNet.Helix.Sdk - 5.0.0-beta.20157.1
- Microsoft.DotNet.RemoteExecutor - 5.0.0-beta.20157.1
- Microsoft.DotNet.XUnitConsoleRunner - 2.5.1-beta.20157.1

4 years agoFix the guid for the transaction (#32573)
Saurabh Singh [Sun, 8 Mar 2020 07:03:34 +0000 (23:03 -0800)]
Fix the guid for the transaction (#32573)

* Fix the guid for the transaction

* Remove unused using

* Remove duplicate interfaces

* Release the com objects after we are done using them

4 years agoRemove my ownership of System.Reflection.Metadata (#33340)
Nick Guerrera [Sat, 7 Mar 2020 20:56:06 +0000 (12:56 -0800)]
Remove my ownership of System.Reflection.Metadata (#33340)

4 years agoDelete unnecessary CLSCompliant attributes (#33326)
Jan Kotas [Sat, 7 Mar 2020 20:55:36 +0000 (12:55 -0800)]
Delete unnecessary CLSCompliant attributes (#33326)

All members of non-CLSCompliant types are non-CLSCompliant