platform/upstream/dotnet/runtime.git
22 months agoDecrease backlog cleanup inactivity threshold (#77288)
Eirik Tsarpalis [Wed, 26 Oct 2022 16:56:52 +0000 (17:56 +0100)]
Decrease backlog cleanup inactivity threshold (#77288)

Decreases the inactivity threshold for `backlog-cleanup-candidate` automation from 5 years to 4.5 years. This change will directly impact [approximately 100 inactive issues in our backlog](https://issuesof.net/?q=repo%3Aruntime%20is%3Aopen%20is%3Aissue%20updated%3A%3C2018-04-20).

22 months agoDisable DisasmChecks if DOTNET_JitForceControlFlowGuard is set (#77467)
Will Smith [Wed, 26 Oct 2022 16:50:16 +0000 (09:50 -0700)]
Disable DisasmChecks if DOTNET_JitForceControlFlowGuard is set (#77467)

* Disable DisasmChecks if DOTNET_JitForceControlFlowGuard is set

* Update src/tests/Common/CLRTest.Jit.targets

Co-authored-by: Jakob Botsch Nielsen <Jakob.botsch.nielsen@gmail.com>
Co-authored-by: Jakob Botsch Nielsen <Jakob.botsch.nielsen@gmail.com>
22 months agostatically link gc_pal on windows (#77468)
Manish Godse [Wed, 26 Oct 2022 15:25:35 +0000 (08:25 -0700)]
statically link gc_pal on windows (#77468)

* build coreclr using gc_pal on windows

Also removes NUMA related code from coreclr PAL

* CR feedback

22 months agoClean up converter initialization logic. (#77290)
Eirik Tsarpalis [Wed, 26 Oct 2022 14:49:42 +0000 (15:49 +0100)]
Clean up converter initialization logic. (#77290)

22 months agoDetect specifical character in EnumConverter.cs (#76873)
YongKang Chen [Wed, 26 Oct 2022 14:14:52 +0000 (22:14 +0800)]
Detect specifical character in EnumConverter.cs (#76873)

* add specifical char flag and fail earlier before invoke naming policy

* add unit test

* improve unit test and special char check

* fix format error

* fix unit test

* take comments and improve unit test

* use string.IndexOfAny

* throw exception in constructor and improve unit test

* add custome exception message

* take comments

* Update src/libraries/System.Text.Json/tests/System.Text.Json.FSharp.Tests/EnumTests.fs

* Update src/libraries/System.Text.Json/tests/System.Text.Json.FSharp.Tests/EnumTests.fs

* Update src/libraries/System.Text.Json/tests/System.Text.Json.FSharp.Tests/EnumTests.fs

* Update src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Value/EnumConverter.cs

Co-authored-by: Eirik Tsarpalis <eirik.tsarpalis@gmail.com>
22 months agoPGO: Add instrumented tiers (#70941)
Egor Bogatov [Wed, 26 Oct 2022 10:56:11 +0000 (12:56 +0200)]
PGO: Add instrumented tiers (#70941)

Co-authored-by: Koundinya Veluri <kouvel@users.noreply.github.com>
Co-authored-by: Andy Ayers <andya@microsoft.com>
22 months agoHandle GT_IND in optVNConstantPropCurStmt (#77105)
Egor Bogatov [Wed, 26 Oct 2022 10:49:07 +0000 (12:49 +0200)]
Handle GT_IND in optVNConstantPropCurStmt (#77105)

22 months agoAdd README.md to System.Text.Json (#77435)
Eirik Tsarpalis [Wed, 26 Oct 2022 09:46:01 +0000 (10:46 +0100)]
Add README.md to System.Text.Json (#77435)

22 months agoResolve tvOS/iOS FileSystem test failures (#74927)
Jo Shields [Wed, 26 Oct 2022 09:00:48 +0000 (05:00 -0400)]
Resolve tvOS/iOS FileSystem test failures (#74927)

* Use SetCurrentDirectory on tests which use an unrooted path on
non-Windows out of the app's working directory, which is readonly on
some platforms.

Closes: #67853

* Just blank out mkfifo tests

22 months agoAudit MemoryExtensions.IndexOf variants (#75754)
Rob Hague [Wed, 26 Oct 2022 08:49:17 +0000 (10:49 +0200)]
Audit MemoryExtensions.IndexOf variants (#75754)

* Add missing char specialisation to LastIndexOf(Span, ROS)

This method is updated to match LastIndexOf(ROS, ROS)

* Forward LastIndexOfAny(Span, ROS) to (ROS, ROS) version

This is consistent with IndexOfAny(Span, ROS)

* Add missing special cases for {Last}IndexOfAny<byte>(ROS, ROS)

22 months agoAdd {Last}IndexOfAny{Except}InRange (#76803)
Stephen Toub [Wed, 26 Oct 2022 07:25:48 +0000 (03:25 -0400)]
Add {Last}IndexOfAny{Except}InRange (#76803)

* Add {Last}IndexOfAny{Exception}InRange

* Address PR feedback

* Address PR feedback

22 months ago[tests] Skip NamedPipeTest_CurrentUserOnly on iOSlike and LinuxBionic (#77471)
Mitchell Hwang [Wed, 26 Oct 2022 07:11:30 +0000 (15:11 +0800)]
[tests] Skip NamedPipeTest_CurrentUserOnly on iOSlike and LinuxBionic (#77471)

* [tests] Disable NamedPipeTest_CurrentUserOnly on iOS/tvOS

* [tests] Disable NamedPipeTest_CurrentUserOnly on Linux Bionic

22 months agoRefactor Arm64 ConvertToXXX instrinsics for amd64 (#77211)
Matous Kozak [Wed, 26 Oct 2022 05:54:09 +0000 (07:54 +0200)]
Refactor Arm64 ConvertToXXX instrinsics for amd64 (#77211)

22 months agoRemove the invalid assert (#77462)
Tarek Mahmoud Sayed [Wed, 26 Oct 2022 02:40:44 +0000 (19:40 -0700)]
Remove the invalid assert (#77462)

22 months agoAdding EVEX encoding pathways for emitOutputRRR(). (#75934)
DeepakRajendrakumaran [Wed, 26 Oct 2022 00:31:33 +0000 (17:31 -0700)]
Adding EVEX encoding pathways for emitOutputRRR(). (#75934)

Adding flag to turn on EVEX encoding.

22 months agoImplement Array.Initialize in C# (#77336)
John Tur [Tue, 25 Oct 2022 22:16:52 +0000 (18:16 -0400)]
Implement Array.Initialize in C# (#77336)

* Implement Array.Initialize in C#

* Add Mono implementation of Initialize

* Fix test failure

* Implement for NativeAOT

Co-authored-by: Jan Kotas <jkotas@microsoft.com>
22 months agostatically linking GC PAL on linux (#76985)
Manish Godse [Tue, 25 Oct 2022 20:42:49 +0000 (13:42 -0700)]
statically linking GC PAL on linux (#76985)

* statically linking GC PAL

The GC PAL will be used for both coreclr and standalone GC on linux

* fixing arm64 and nativeaot build breaks

* macos build break and reducing renaming.

* trying to remove numa support from PAL

* one more rename to resolve MacOS break

* delete pal numa code.

* Adding missing madvise in GC PAL

* added missing MADV_DONTDUMP calls.

* CR feedback

* undo (long long) cast in GetMemoryStatus

* only invoke madvise on success.

22 months agoAdd runtime-coreclr pgostress YAML file (#77446)
Jakob Botsch Nielsen [Tue, 25 Oct 2022 20:39:26 +0000 (22:39 +0200)]
Add runtime-coreclr pgostress YAML file (#77446)

22 months agoAdd readme files to the globalization libraries (#77436)
Tarek Mahmoud Sayed [Tue, 25 Oct 2022 20:08:38 +0000 (13:08 -0700)]
Add readme files to the globalization libraries (#77436)

22 months agoJIT: implement tail merging (#77103)
Andy Ayers [Tue, 25 Oct 2022 19:09:53 +0000 (12:09 -0700)]
JIT: implement tail merging (#77103)

Add a phase that looks for common tail statements in a block's
predecessors and merges them.

Run it both before and after morph.

Also
* add range enable config and overall `JitEnableTailMerge` config
* add indir flag checking to `GenTree::Compare`
* remove an apparently unnecessary assert from loop recognition.

Closes #8795.
Closes #76872.

22 months agoREADME for extensions libraries (#77413)
Maryam Ariyan [Tue, 25 Oct 2022 18:09:11 +0000 (14:09 -0400)]
README for extensions libraries (#77413)

22 months agoMove usages of `COMPlus_` var to `DOTNET_` fallback (#77239)
Adeel Mujahid [Tue, 25 Oct 2022 17:34:05 +0000 (20:34 +0300)]
Move usages of `COMPlus_` var to `DOTNET_` fallback (#77239)

22 months agoFold static readonly struct X = <zero> to a jit-time const, e.g. Guid.Empty (#77354)
Egor Bogatov [Tue, 25 Oct 2022 17:28:43 +0000 (19:28 +0200)]
Fold static readonly struct X = <zero> to a jit-time const, e.g. Guid.Empty (#77354)

22 months agoDisable SIMD intrinsics for Vector128/64 on Arm64 (#77406)
Fan Yang [Tue, 25 Oct 2022 16:21:48 +0000 (12:21 -0400)]
Disable SIMD intrinsics for Vector128/64 on Arm64 (#77406)

22 months agoFix documentation for INumberBase IsComplex and IsImaginary (#77330)
Drew Kersnar [Tue, 25 Oct 2022 16:10:46 +0000 (11:10 -0500)]
Fix documentation for INumberBase IsComplex and IsImaginary (#77330)

* Fix documentation for INumberBase IsComplex and IsImaginary

* Update src/libraries/System.Private.CoreLib/src/System/Numerics/INumberBase.cs

22 months agoFix OCSP test responder to omit fractional seconds
Kevin Jones [Tue, 25 Oct 2022 14:34:53 +0000 (10:34 -0400)]
Fix OCSP test responder to omit fractional seconds

22 months ago[mono][tests] Fix FullAOT runtime generic methods test (#77079)
Milos Kotlar [Tue, 25 Oct 2022 14:13:26 +0000 (16:13 +0200)]
[mono][tests] Fix FullAOT runtime generic methods test  (#77079)

* get vtable method slot by using its declaring

22 months agoSPMI: Implement missing NAOT support (and fix garbage values passed to JIT in expandR...
Jakob Botsch Nielsen [Tue, 25 Oct 2022 13:30:53 +0000 (15:30 +0200)]
SPMI: Implement missing NAOT support (and fix garbage values passed to JIT in expandRawHandleIntrinsic) (#76996)

Implement expandRawHandleIntrinsic in SPMI

Also fix NAOT passing garbage back to JIT.

Fix #76925

22 months agoEnable multi-reg MUL_LONG/CALL nodes on 32 bit (#76263)
SingleAccretion [Tue, 25 Oct 2022 13:29:51 +0000 (16:29 +0300)]
Enable multi-reg MUL_LONG/CALL nodes on 32 bit (#76263)

22 months agoAdd startIndex argument to getStringLiteral JIT/EE interface method (#77423)
Jan Kotas [Tue, 25 Oct 2022 13:15:10 +0000 (06:15 -0700)]
Add startIndex argument to getStringLiteral JIT/EE interface method (#77423)

* Add startIndex argument to getStringLiteral JIT/EE interface method

Avoid copying up to 1kB string just to get a single char out of it.

* Format patch

22 months agoremoved duplicate conditional compilation (#77428)
JongHeonChoi [Tue, 25 Oct 2022 12:27:43 +0000 (21:27 +0900)]
removed duplicate conditional compilation (#77428)

22 months agoRemove custom Utf8 encoder implementation. (#77400)
Eirik Tsarpalis [Tue, 25 Oct 2022 11:03:03 +0000 (12:03 +0100)]
Remove custom Utf8 encoder implementation. (#77400)

Co-authored-by: kasperk81 <kasperk81 kasperk81 83082615+kasperk81@users.noreply.github.com>
22 months ago[mono] Avoid checking for exceptions after calls to Math icalls. (#77347)
Zoltan Varga [Tue, 25 Oct 2022 08:54:59 +0000 (04:54 -0400)]
[mono] Avoid checking for exceptions after calls to Math icalls. (#77347)

* [mono] Avoid checking for exceptions after calls to Math icalls.

Also add a way to turn off exception checking for arbitrary icalls.

* Fix wasm support.

22 months ago[wasm] Use latest stable version of chrome for testing (#77133)
Ankit Jain [Tue, 25 Oct 2022 08:17:52 +0000 (04:17 -0400)]
[wasm] Use latest stable version of chrome for testing (#77133)

* Use the latest `stable` chrome version by default
* Install these by default on codespaces

## Details

- Added a new task `GetChromeVersions` to get the latest version
- This is applicable to library tests, debugger tests, and Wasm.Build.Tests
- The channel used for getting the "latest" version is `$(ChromeChannel)=stable`
- And they are installed in `artifacts/bin/chrome`, and `artifacts/bin/chromedriver`
- A newer version is fetched only `$(ChromeVersionCheckThresholdDays)=3` days after the last version check
- This is enabled by default on containers
- And the behavior can be disabled with `$(InstallChromeForTests)=false`.

22 months agoAdd null check before calling Path.GetFullPath (#76696)
ws77.cho [Tue, 25 Oct 2022 02:56:59 +0000 (11:56 +0900)]
Add null check before calling Path.GetFullPath (#76696)

22 months agoConsolidate the `GUID` to string logic (#77394)
Aaron Robinson [Tue, 25 Oct 2022 00:41:20 +0000 (17:41 -0700)]
Consolidate the `GUID` to string logic (#77394)

* Consolidate the GUID to string logic

Replace obvious uses of GUID to string
logic with a new constant for buffer length.

22 months agoSPMI: More information on CI failures (#77361)
Jakob Botsch Nielsen [Mon, 24 Oct 2022 22:11:47 +0000 (00:11 +0200)]
SPMI: More information on CI failures (#77361)

This enhances parts of the SPMI process with more information on failures.

Also fixes a bug I introduced when I added tpdiffs: when asmdiffs fails, it was not marking the entire pipeline as failing.

22 months agoFix reported PriorityQueue issue. (#77229)
Eirik Tsarpalis [Mon, 24 Oct 2022 21:10:48 +0000 (22:10 +0100)]
Fix reported PriorityQueue issue. (#77229)

* Fix #77212.

* Remove unneeded using statement.

22 months agoDetriplicate internal SingleProducerSingleConsumerQueue (#76932)
Stephen Toub [Mon, 24 Oct 2022 19:39:25 +0000 (15:39 -0400)]
Detriplicate internal SingleProducerSingleConsumerQueue (#76932)

System.Private.CoreLib, System.Threading.Tasks.Dataflow, and System.Threading.Channels have all ended up with their own copy of SingleProducerSingleConsumerQueue and its associated helpers.  This consolidates them down to a single shared copy.

There's no functional change here, just deleting duplicates and moving things around.

22 months agoFix copy propagation dump (#77389)
SingleAccretion [Mon, 24 Oct 2022 19:37:24 +0000 (22:37 +0300)]
Fix copy propagation dump (#77389)

22 months agoFold primitive-typed access to promoted structs in local morph and forbid mismatched...
SingleAccretion [Mon, 24 Oct 2022 19:20:29 +0000 (22:20 +0300)]
Fold primitive-typed access to promoted structs in local morph and forbid mismatched struct assignments (#76766)

* GenTree::GetLayout field FIELDs

* Do not create invalid IR when replacing promoted fields

Instead, create constructions like "OBJ(ADDR(LCL_VAR))"
that block morphing can recognize on its own.

* Delete lvFieldHnd

* GenTree::GetLayout - CALL/COMMA

* GenTreeHWIntrinsic::GetLayout

* Add an assert that LHS and RHS match

* Fix assert violation

And simplify the code...

* Delete RetypedAsScalarFieldsMap

Without handle equality, the assert no longer holds, for example:
```cs
private StructWithInt Problem(StructWithInt b, StructWithInt a)
{
    a = ((StructWithStructWithInt*)&b)->StructWithInt;
    return a;
}
```

* Delete a bit of code

Dead / unncessary.

No diffs.

* Fold promoted locals in local morph

* Support GT_IND in MorphStructField

This is significantly simpler than moving the promotion logic
to post-order because we don't need to fiddle with the ref
counting process and complexities of intermediate states, e. g.
"IND<float>(ADDR(FIELD<int>(ADDR(LCL_VAR<struct>))))" can be
naturally turned into "BITCAST<float>(LCL_VAR<int>)" like this.

* More code removal

* Move "fgMorphStructField" to local morph

* TP tuning

With this, we have only a very small regression:

Base: 1297463478, Diff: 1297750893, +0.0222%
LocalAddressVisitor::MorphStructField : 345099  : NA       : 31.52% : +0.0266%
LocalAddressVisitor::PreOrderVisit    : 224684  : +3.53%   : 20.52% : +0.0173%
memset                                : 88591   : +0.99%   : 8.09%  : +0.0068%
Compiler::fgMorphSmpOp                : -19170  : -0.06%   : 1.75%  : -0.0015%
Compiler::fgMorphStructField          : -367474 : -100.00% : 33.56% : -0.0283%

(This is with a dummy field on LclVarDsc)

Losing the assert does not seem worrysome as we have an identical one in "fgMorphField".

22 months ago[wasm] Add `IMemoryView` as exported type (#77371)
Marek Fišera [Mon, 24 Oct 2022 19:13:48 +0000 (21:13 +0200)]
[wasm] Add `IMemoryView` as exported type (#77371)

- Add IMemoryView as exported type.
- IMemoryView extends IDisposable.

22 months agoFix comment (#77226)
Filip Navara [Mon, 24 Oct 2022 18:33:19 +0000 (11:33 -0700)]
Fix comment (#77226)

22 months agoUpdate def flags in gtCloneExpr (#77378)
SingleAccretion [Mon, 24 Oct 2022 18:30:45 +0000 (21:30 +0300)]
Update def flags in gtCloneExpr (#77378)

Limit to cases where are actually performing replacements to mitigate TP impact.

22 months agoRevert "Override ReadAsync and WriteAsync methods on ConsoleStream. (#71971)" (#77360)
Stephen Toub [Mon, 24 Oct 2022 14:09:58 +0000 (10:09 -0400)]
Revert "Override ReadAsync and WriteAsync methods on ConsoleStream. (#71971)" (#77360)

This reverts commit 8cb4e934757b959bc1b38aecaa764e21a47ec85e.

22 months agoSPMI: Fix repPrintObjectDescription and repGetStringLiteral (#77372)
Jakob Botsch Nielsen [Mon, 24 Oct 2022 13:34:15 +0000 (15:34 +0200)]
SPMI: Fix repPrintObjectDescription and repGetStringLiteral (#77372)

repPrintObjectDescription was not null-terminating when the map was
null. There is SPMI error trap on the JIT side so we can just make it
fail on missing data.

repGetStringLiteral should not succeed on missing data, it is used for
optimization purposes.

22 months agoSmtpClientTest Assertion Fail Fix (#76361)
Ahmet Ibrahim AKSOY [Mon, 24 Oct 2022 12:23:09 +0000 (14:23 +0200)]
SmtpClientTest Assertion Fail Fix (#76361)

* Eliminate temporary -1 on Socket.Unix.cs

22 months agoAdd ReadOnly{Observable}Collection/Dictionary.Empty (#76764)
Stephen Toub [Mon, 24 Oct 2022 11:57:45 +0000 (07:57 -0400)]
Add ReadOnly{Observable}Collection/Dictionary.Empty (#76764)

* Add ReadOnly{Observable}Collection/Dictionary.Empty

* Revert XamlLoadPermission.cs change to fix downlevel build

22 months agoTemporary instrumentation for #76280 (#77365)
Jan Kotas [Mon, 24 Oct 2022 09:01:44 +0000 (02:01 -0700)]
Temporary instrumentation for #76280 (#77365)

22 months ago[Android][tests] Replace hardcoded /tmp path (#77291)
Mitchell Hwang [Sun, 23 Oct 2022 13:14:54 +0000 (09:14 -0400)]
[Android][tests] Replace hardcoded /tmp path (#77291)

Akin to #73067

22 months ago[mono][interp] Small improvements to get span item (#77331)
Vlad Brezae [Sun, 23 Oct 2022 08:43:59 +0000 (11:43 +0300)]
[mono][interp] Small improvements to get span item (#77331)

* [mono][interp] Improve GETITEM_SPAN intrinsic

Field offsets are known at compile time, they don't need to be included in the code stream.

* [mono][interp] Add version of getitemspan that doesn't use indirection

* [mono][interp] Add general MonoSpanOfVoid struct and use it in interp opcodes

22 months agoSet DNER for all local fields (#77341)
SingleAccretion [Sat, 22 Oct 2022 23:54:51 +0000 (02:54 +0300)]
Set DNER for all local fields (#77341)

Not just the promoted ones.

22 months agoDelete removed tests from list (#77344)
Adeel Mujahid [Sat, 22 Oct 2022 23:12:28 +0000 (02:12 +0300)]
Delete removed tests from list (#77344)

22 months agoUpdate Value of TwoDigitYearMax to 2049 (#76848)
Connor Bullard [Sat, 22 Oct 2022 22:22:58 +0000 (18:22 -0400)]
Update Value of TwoDigitYearMax to 2049 (#76848)

Co-authored-by: Dan Moseley <danmose@microsoft.com>
22 months agoJIT: Use metadata names for SIMD intrinsic method recognition (#76786)
Jakob Botsch Nielsen [Sat, 22 Oct 2022 11:45:45 +0000 (13:45 +0200)]
JIT: Use metadata names for SIMD intrinsic method recognition (#76786)

* JIT: Use metadata names for SIMD intrinsic method recognition

eeGetMethodName is only expected to be used for diagnostics.

* Reorder checks in impSIMDIntrinsic

* Suggested refactoring

* Avoid unnecessary metadata lookups in getMethodNameFromMetadata

* Fix nested lookup

* Fix repGetMethodNameFromMetadata

22 months agoRemove some unnecessary path manipulation helpers (#77301)
Elinor Fung [Fri, 21 Oct 2022 22:18:15 +0000 (15:18 -0700)]
Remove some unnecessary path manipulation helpers (#77301)

22 months agoRename COMPlus_ to DOTNET_ (#77321)
Will Smith [Fri, 21 Oct 2022 21:59:47 +0000 (14:59 -0700)]
Rename COMPlus_ to DOTNET_ (#77321)

22 months agoFix `CacheEntryExtensions.SetValue()`'s signature to allow `null` values (#77305)
Maksym Koshovyi [Fri, 21 Oct 2022 21:57:43 +0000 (00:57 +0300)]
Fix `CacheEntryExtensions.SetValue()`'s signature to allow `null` values (#77305)

22 months agoSync shared code from aspnetcore (#77323)
github-actions[bot] [Fri, 21 Oct 2022 20:53:50 +0000 (13:53 -0700)]
Sync shared code from aspnetcore (#77323)

22 months ago[tests][Android] ReAdd Android library test jobs (#77280)
Mitchell Hwang [Fri, 21 Oct 2022 18:58:44 +0000 (14:58 -0400)]
[tests][Android] ReAdd Android library test jobs (#77280)

Android library tests were not running on CI in runtime-extra-platforms.
This PR brings back the jobs that ran library tests on Android device/simulator removed in #76328
They are updated to follow the similar changes made to branch out runtime-extra-platforms in the aforementioned PR.

22 months agoJIT: Clean up inliner substitution (#77176)
Jakob Botsch Nielsen [Fri, 21 Oct 2022 17:53:28 +0000 (19:53 +0200)]
JIT: Clean up inliner substitution (#77176)

* Stop using GenTree::ReplaceWith
* GenTreeRetExpr now directly contains its substitution members, which
  is a tree either from the inline candidate, a local (due to spill
  temps) or the call itself (due to inliner failure). In the former
  case, it also contains the BasicBlock the child tree comes from to
  ensure that its flags can be propagated once and for all during
  substitution.
* Make various members strongly typed, e.g.
  GenTreeRetExpr::gtInlineCandidate is now a GenTreeCall*,
  InlineCandidateInfo::retExpr is now a GenTreeRetExpr*. This is
  possible since we are no longer using GenTree::ReplaceWith.

Fix #75827

22 months ago[wasm] Misc fixes (#76942)
Ankit Jain [Fri, 21 Oct 2022 17:41:35 +0000 (13:41 -0400)]
[wasm] Misc fixes (#76942)

* [wasm] Fix Wasm.Build.Tests with stable 7.0.0

Set the manifest package version to use (`7.0.0` instead of `7.0.0-ci`)
early.

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

* Misc fixes based on review feedback

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

* Update WorkloadBuildTasksDir to remove 'publish' in the path

* workloads-testing.targets: ignore symbols.nupkgs when looking for runtime packs

* Fix WBT to have the correct version for WORKLOAD_PACKS_VER

* [wasm] Emit an error if PackageVersionForWorkloadManifests property is not set

* workloads-testing: Get the PackageVersion at build time

.. because it is not set at evaluation time. So, get it in a target, and
move the WorkloadIds to a target too.

* Ensure the version is set before generating the runscript for WBT

22 months agoSimplify DynamicMethod arg validation (#77277)
Jan Kotas [Fri, 21 Oct 2022 17:14:59 +0000 (10:14 -0700)]
Simplify DynamicMethod arg validation (#77277)

22 months agoFilter out addresses that are not in bookkeeping range during background promote...
Andrew Au [Fri, 21 Oct 2022 16:28:14 +0000 (09:28 -0700)]
Filter out addresses that are not in bookkeeping range during background promote (#77067)

22 months ago[ppc64le] Implementation of mono_arch_get_delegate_virtual_invoke_impl method for...
Alhad Deshpande [Fri, 21 Oct 2022 14:20:53 +0000 (19:50 +0530)]
[ppc64le] Implementation of mono_arch_get_delegate_virtual_invoke_impl method for ppc64le architecture (#77308)

* [ppc64le] Fixed thunk address 8 byte alignment issue

* Fixed FSharp crash issue

* [ppc64le] Implementation of mono_arch_get_delegate_virtual_invoke_impl method for ppc64le architecture

22 months agoFix GCShadow for regions (#77011)
Andrew Au [Fri, 21 Oct 2022 07:26:21 +0000 (00:26 -0700)]
Fix GCShadow for regions (#77011)

22 months agoRemove _fdopen from PAL (#77272)
Jan Vorlicek [Fri, 21 Oct 2022 05:06:53 +0000 (07:06 +0200)]
Remove _fdopen from PAL (#77272)

This function is never used.

22 months agoClearing all cards for free regions (#77224)
Andrew Au [Fri, 21 Oct 2022 03:39:11 +0000 (20:39 -0700)]
Clearing all cards for free regions (#77224)

22 months agoMigrate host.tests from Newtonsoft to STJ (#76901)
Adeel Mujahid [Fri, 21 Oct 2022 03:20:15 +0000 (06:20 +0300)]
Migrate host.tests from Newtonsoft to STJ (#76901)

22 months ago[mono][jit] Disable inlining for constrained calls on gshared parameters. (#77274)
Zoltan Varga [Fri, 21 Oct 2022 02:21:13 +0000 (22:21 -0400)]
[mono][jit] Disable inlining for constrained calls on gshared parameters. (#77274)

The concrete method cannot be looked up so 'cmethod' is still the interface method.

Related: https://github.com/dotnet/runtime/pull/76724.

22 months agoFix link (#77297)
Jan Kotas [Thu, 20 Oct 2022 23:55:54 +0000 (16:55 -0700)]
Fix link (#77297)

22 months agoFix the __int64 to be long long on macOS only (#77268)
Jan Vorlicek [Thu, 20 Oct 2022 22:19:58 +0000 (00:19 +0200)]
Fix the __int64 to be long long on macOS only (#77268)

It turned out that my recent change to redefine __int64 on Unix is
actually correct for macOS only. For other 64 bit Unixes, the __int64
should be defined as long.

This change fixes it.

22 months agoFix recurisve `Monitor.TryEnter` to not return false due to a condition (#77243)
Koundinya Veluri [Thu, 20 Oct 2022 21:59:12 +0000 (14:59 -0700)]
Fix recurisve `Monitor.TryEnter` to not return false due to a condition (#77243)

A race condition when the object header is transitioning to a sync block can cause a concurrent recursive `TryEnter` to return false.

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

22 months agoRemove uses of PAL's `swprintf_s` from mono. (#77284)
Aaron Robinson [Thu, 20 Oct 2022 21:53:49 +0000 (14:53 -0700)]
Remove uses of PAL's `swprintf_s` from mono. (#77284)

* Remove uses of PAL's swprintf_s from mono.

22 months agoAdd new version of the ContentionStart event (#72627)
Gregory LEOCADIE [Thu, 20 Oct 2022 21:49:33 +0000 (23:49 +0200)]
Add new version of the ContentionStart event (#72627)

* Add new version of the ContentionStart event and a LockCreated event

The new ContentionStart includes a lock ID, associated object ID, and the holding thread ID. The LockCreated event includes a lock ID and associated object ID.

Co-authored-by: Koundinya Veluri <kouvel@microsoft.com>
22 months agoDon't invoke EnsureInstructionSetFlagsAreValid all the time in JIT (#77237)
Egor Bogatov [Thu, 20 Oct 2022 21:14:34 +0000 (23:14 +0200)]
Don't invoke EnsureInstructionSetFlagsAreValid all the time in JIT (#77237)

22 months agoFix dotnet-pgo (#77259)
Jakob Botsch Nielsen [Thu, 20 Oct 2022 20:48:07 +0000 (22:48 +0200)]
Fix dotnet-pgo (#77259)

* Fix dotnet-pgo dump

* Fix merge compare-mibc and create-mibc too

* A couple more fixes

22 months agoAdds `ActivatorUtilities.CreateFactory<T>` API (#77185)
Maryam Ariyan [Thu, 20 Oct 2022 20:37:34 +0000 (16:37 -0400)]
Adds `ActivatorUtilities.CreateFactory<T>` API (#77185)

22 months agoModify ARM64 thunktemplates.S to make it work with GNU ld (#77275)
Jan Vorlicek [Thu, 20 Oct 2022 20:13:05 +0000 (22:13 +0200)]
Modify ARM64 thunktemplates.S to make it work with GNU ld (#77275)

Currently the ld linker links incorrectly the compiled thunktemplates.S
for ARM64 and puts wrong offsets into all the LDR instructions. Only
the LLVM lld linker works correctly.

I have looked into it and it turns out the assembler was putting in
relocations that the linker then replaced by fixed offsets. That's
where the GNU ld made the mistake.
I have figured out a slight modification of expressing the addresses
in the data page referenced by those LDR instructions so that the
assembler doesn't produce any relocs and so the linker cannot
cause any problems.

22 months agoFix a signed/unsigned comparison warning (#77230)
Andrew Au [Thu, 20 Oct 2022 18:57:06 +0000 (11:57 -0700)]
Fix a signed/unsigned comparison warning (#77230)

22 months agoTrim file type bits from mode header (#77151)
Adeel Mujahid [Thu, 20 Oct 2022 18:51:48 +0000 (21:51 +0300)]
Trim file type bits from mode header (#77151)

* Trim file type bits from mode header

* Define and use ValidUnixFileModes

* Rev System.Formats.Tar.TestData version

* Move ValidUnixFileModes to shared helpers

22 months agoPort stackoverflow fix from Roslyn to SourceGenerator PolyFill (#76955)
CyrusNajmabadi [Thu, 20 Oct 2022 18:48:17 +0000 (11:48 -0700)]
Port stackoverflow fix from Roslyn to SourceGenerator PolyFill (#76955)

22 months agoAdd [DebuggerStepThrough] to MulticastDelegate constructors. (#77132)
Chuck Ries [Thu, 20 Oct 2022 18:43:12 +0000 (11:43 -0700)]
Add [DebuggerStepThrough] to MulticastDelegate constructors. (#77132)

Adding [DebuggerStepThrough] to these constructors allows debuggers to
avoid stepping into them and stopping regardless of Just My Code
settings. This is desirable for debuggers as there is little benefit to
stopping in these constructors as they are primarily infrastructure
inserted by the compiler.

22 months agoFixes issue when monitoring a process launched via the same command line (#76965)
Daniel Ramos [Thu, 20 Oct 2022 17:31:53 +0000 (10:31 -0700)]
Fixes issue when monitoring a process launched via the same command line (#76965)

* Initial fix for null reference exception

* Took away lazy and put back private constructor

* Added parent property and made handler thread safe

22 months agoUpdate System.Speech to Eric/Jeff (#77142)
Jeff Handley [Thu, 20 Oct 2022 17:22:58 +0000 (10:22 -0700)]
Update System.Speech to Eric/Jeff (#77142)

22 months agoMake sure all heap segment fields are populated in the DAC (#77035)
Andrew Au [Thu, 20 Oct 2022 17:12:08 +0000 (10:12 -0700)]
Make sure all heap segment fields are populated in the DAC (#77035)

22 months agoUpdate .vsconfig file (#77189)
Jeff Handley [Thu, 20 Oct 2022 17:09:19 +0000 (10:09 -0700)]
Update .vsconfig file (#77189)

* Update .vsconfig; remove outdated and add new/missing components

* Update .vsconfig to sort the components

* Remove Blend component from .vsconfig

22 months agoRemove more swprintf_s uses (#77228)
Aaron Robinson [Thu, 20 Oct 2022 14:48:15 +0000 (07:48 -0700)]
Remove more swprintf_s uses (#77228)

* Remove the swprintf_s export

* Convert paths to UTF-8 for flow graph diagnostics in JIT.

22 months ago[wasm] IDBFS test
Pavel Savara [Thu, 20 Oct 2022 13:57:50 +0000 (15:57 +0200)]
[wasm] IDBFS test

22 months agoAdded snake and kebab naming policies to JSON serializer (#69613)
Yoh Deadfall [Thu, 20 Oct 2022 12:26:54 +0000 (15:26 +0300)]
Added snake and kebab naming policies to JSON serializer (#69613)

* Added snake and kebab naming policies to JSON serializer

* Code styling issues

* Explicit types

* Fixed range slicing issue

* Fixed tests

* Forgotten conversion in tests

* Fixed docs

Co-authored-by: Daniel Stockhammer <daniel@stockhammer.it>
* Used nameof instead of hardcoded names in source generator

* Updated public API

* Fixed kebab case lower policy

* Added tests for long inputs

* Performance improvements

* Made ConvertName sealed

Co-authored-by: Eirik Tsarpalis <eirik.tsarpalis@gmail.com>
* Explicit variable type

* Clear only a dirty part of the buffer

* Fixed exception on slicing more that exists

* Better variable name

* End-to-end serialization tests

Co-authored-by: Daniel Stockhammer <daniel@stockhammer.it>
Co-authored-by: Eirik Tsarpalis <eirik.tsarpalis@gmail.com>
22 months ago[wasm] Template nits 2 (#77205)
Marek Fišera [Thu, 20 Oct 2022 11:11:02 +0000 (13:11 +0200)]
[wasm] Template nits 2 (#77205)

* Drop duplicated description from json definition.
* Update readme in both templates.

22 months agoUpdate dependencies from https://github.com/dotnet/linker build 20221018.2 (#77214)
dotnet-maestro[bot] [Thu, 20 Oct 2022 09:48:54 +0000 (11:48 +0200)]
Update dependencies from https://github.com/dotnet/linker build 20221018.2 (#77214)

Microsoft.NET.ILLink.Tasks
 From Version 7.0.100-1.22514.1 -> To Version 7.0.100-1.22518.2

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
22 months agoJIT: Support delegate GDV guards in loop cloning (#75140)
Jakob Botsch Nielsen [Thu, 20 Oct 2022 09:20:40 +0000 (11:20 +0200)]
JIT: Support delegate GDV guards in loop cloning (#75140)

Add support for cloning loops based on delegate GDV guards. Mark delegate address loads as invariant to allow VN and CSE of them.

Remove exceptions on indirs in guards after loop cloning, which otherwise prevents RBO from optimizing them away if the loop is inside an EH handler (e.g. foreach loop).

22 months ago[mono][interp] Don't use mov.vt when storing into primitive type fields (#77221)
Vlad Brezae [Thu, 20 Oct 2022 08:04:25 +0000 (11:04 +0300)]
[mono][interp] Don't use mov.vt when storing into primitive type fields  (#77221)

* [mono][interp] Rename opcodes to better suggest that they are doing a conversion

* [mono][interp] Don't use mov.vt when storing into primitive type fields

Use the faster mov.x opcodes instead.

22 months ago[wasm][debugger] Remove non-deterministic signals from debugger tests. (#77038)
Ilona Tomkowicz [Thu, 20 Oct 2022 07:03:34 +0000 (09:03 +0200)]
[wasm][debugger] Remove non-deterministic signals from debugger tests. (#77038)

* Easy fix.

* Non wasm page loading detection.

* This is a good test, Sleep was redundant.

* This comment can be removed.

* Applied radical's idea to simplify the logic.

22 months ago[wasm] few JS interop tests (#77218)
Pavel Savara [Thu, 20 Oct 2022 06:39:02 +0000 (08:39 +0200)]
[wasm] few JS interop tests (#77218)

* new JS interop tests
Co-authored-by: Marek Fišera <mara@neptuo.com>
Co-authored-by: Ankit Jain <radical@gmail.com>
22 months agoAdd missing tests for NamedPipes (#72956)
David Cantú [Thu, 20 Oct 2022 04:34:57 +0000 (23:34 -0500)]
Add missing tests for NamedPipes (#72956)

* Add missing tests for NamedPipes

* Address feedback

* Move event wait to happen one line before Connect.

* Bring back previous version of test

* Reword SkipTestException message

* Move NamedPipeTest.CurrentUserOnly.cs to compile for all platforms

* Address feedback

* Remove IsRemoteExecutorSupportedAndOnUnixAndSuperUser

* Keep RemoteExecutor.IsSupported

22 months ago[JIT] X64 - Three instruction replacement sequence for multiply in certain cases...
Will Smith [Thu, 20 Oct 2022 01:16:10 +0000 (18:16 -0700)]
[JIT] X64 - Three instruction replacement sequence for multiply in certain cases (#76981)

* Using 3 instruction sequence for x64 multiply

* Do not do this in morph. Do it in codegen now.

* Fixing codegen

* Only allow values under 127 and do not skip mov - correctness testing

* Try to fix tests

* cleanup

* Moving to Lowering

* Quick fix

* Fully works in lowering now

* Account for all ints

* Take into account codegen opts

* Minor cleanup

* Minor cleanup

* Fixed test

* Added int multiply disasm checks. Fixed SuperFileCheck namespace bug. Made SuperFileCheck anchors more likely to match.

* Update comments

* Update comments

* Update comments

* Update comments

* Formatting

* Fixing build

* Fixing build again

* minor rename

* Feedback. Removed use of FULL-LINE as it is more readable not strictly necessary. Forgot to add an additional instruction to a disasm test.

* Formatting

22 months agoAdd IR support for modeling multiple SSA definitions as one store (#76139)
SingleAccretion [Wed, 19 Oct 2022 22:29:50 +0000 (01:29 +0300)]
Add IR support for modeling multiple SSA definitions as one store (#76139)

* Change how we track use SSA numbers for partial defs

Store them in the SSA descriptor instead of a map.

Memory (x64): +0.18%
PIN    (x64): -0.04%

The memory regression is not small...

* SsaNumInfo support

* Support in SSA, VN and CopyProp

For now, just the "CanBeReplacedWithItsField" case.
This enables some nice simplifications, even as the
general case gets more complex.

Two quirks have been added to attain zero diffs.

* Support in dumping

* TP tuning

Gets us back 0.05% on the PIN counter. Hard to believe but true.

* More TP tuning

Another 0.025%.

22 months agoFold 'static readonly single-field-struct' to constants (#77102)
Egor Bogatov [Wed, 19 Oct 2022 22:09:43 +0000 (00:09 +0200)]
Fold 'static readonly single-field-struct' to constants (#77102)

Co-authored-by: Andy Ayers <andya@microsoft.com>