platform/upstream/dotnet/runtime.git
2 years agoImprove the performance of Equals* for Vector128 and Vector on Arm64 (#76944)
Fan Yang [Thu, 13 Oct 2022 18:14:54 +0000 (14:14 -0400)]
Improve the performance of Equals* for Vector128 and Vector on Arm64 (#76944)

2 years ago[PERF][MAUI] Update Maui build mac version (#76945)
Parker Bibus [Thu, 13 Oct 2022 17:34:08 +0000 (10:34 -0700)]
[PERF][MAUI] Update Maui build mac version (#76945)

* Update vmimage to macos-12

2 years agoInclude hostcommon sources in hostfxr static library (#75858)
Sean Hall [Thu, 13 Oct 2022 17:30:08 +0000 (12:30 -0500)]
Include hostcommon sources in hostfxr static library (#75858)

2 years agoReintroduce ICorDebug typo in Mono partition as well (#77002)
Jan Kotas [Thu, 13 Oct 2022 17:10:49 +0000 (10:10 -0700)]
Reintroduce ICorDebug typo in Mono partition as well (#77002)

Fixes build break

2 years agoMark the port as implicit for empty values in Cookie (#76143)
David Sisco [Thu, 13 Oct 2022 15:11:27 +0000 (08:11 -0700)]
Mark the port as implicit for empty values in Cookie (#76143)

* [Bug] Fix issue #70227

* Fix cookie tests cases to reflect correct behavior.

* Remove trailing semicolon in expected result of Cookie string tests.

2 years ago[tvOS] Disable crashing test (#76952)
Mitchell Hwang [Thu, 13 Oct 2022 13:52:29 +0000 (09:52 -0400)]
[tvOS] Disable crashing test (#76952)

* [tvOS] Disable crashing test

* [tests][tvOS] Disable Crc32C tests on tvOS

2 years agoJIT: Fix profiler tail call insertion logic for FIELD_LIST (#76883)
Jakob Botsch Nielsen [Thu, 13 Oct 2022 12:23:18 +0000 (14:23 +0200)]
JIT: Fix profiler tail call insertion logic for FIELD_LIST (#76883)

This logic was not handling FIELD_LIST and was also not handling linear
order appropriately.

The logic is still a bit odd, it would probably be better to use the
same kind of logic as CFG (moving PUTARG nodes ahead of the profiler
hook instead), but in practice this seems to be ok.

Fix #76879

2 years agoImprove HTTP/1 response header parsing (#74393)
Miha Zupan [Thu, 13 Oct 2022 11:53:21 +0000 (13:53 +0200)]
Improve HTTP/1 response header parsing (#74393)

* Improve HTTP/1 response header parsing

* Improve worst-case performance

* Account for line folds in FillForHeadersAsync

* PR feedback

* Extend header trickle test for line folds

* RIP goto

* Clarify the meaning of 'valueIter'

* Handle Scavenge zero-byte reads in test

2 years agoRemove unused code from RegexGenerator (#76951)
Miha Zupan [Thu, 13 Oct 2022 11:50:30 +0000 (13:50 +0200)]
Remove unused code from RegexGenerator (#76951)

2 years agoRevert "Revert "Reduce CoreCLR PAL"" (#76972)
Jan Vorlicek [Thu, 13 Oct 2022 11:37:03 +0000 (13:37 +0200)]
Revert "Revert "Reduce CoreCLR PAL"" (#76972)

* Revert "Revert "Reduce CoreCLR PAL (#76832)" (#76860)"

This reverts commit 744fc9b9971965e5cfbcd0c2892f090d850e7234.

* Put back the _putenv since it is used by Mono

2 years agoCleaner way of specifying environment variables for tests (#76458)
Mark Plesko [Thu, 13 Oct 2022 07:28:49 +0000 (00:28 -0700)]
Cleaner way of specifying environment variables for tests (#76458)

Existing ways of specifying environment variables:
- [3 times] CLRTestBashEnvironmentVariable is a list of `export var=value` strings
- [2 times] CLRTestBatchEnvironmentVariable is a list of `set var=value` strings
- [~100 times] BashCLRTestPreCommands and CLRTestBatchPreCommands are set to include `export`/`set` strings for the same variables

This changes CLRTestBashEnvironmentVariable and CLRTestBatchEnvironmentVariable to be a list of Identity/Value pairs and adds a new list CLRTestEnvironmentVariable in the same format.  These are automatically expanded to the necessary `export`/`set` strings as appropriate.

A few details of note:
- "Real" changes are in CLRTest.Execute.Bash/Batch.targets.  This moves the environment variables section of the generated cmd/sh files down to the precommands area.  This is only a change for the 5 existing uses, which look ok.
- If a test has a more complicated precommands list, it may not be appropriate to extract the variables.  For example, src\tests\readytorun\tests\mainv1.csproj includes them in setlocal/endlocal because they are for crossgen2 in the precommands, not the test itself.  This change only updates otherwise blank precommands lists.

2 years agoDisable JIT/opt/OSR/pinnedlocal on all Mono flavors (#76980)
Jan Kotas [Thu, 13 Oct 2022 07:25:54 +0000 (00:25 -0700)]
Disable JIT/opt/OSR/pinnedlocal on all Mono flavors (#76980)

The test has been disabled on Android, but it is timing out intermittently on other platforms as well.

2 years agoReintroduce typo in ICorDebug public API names (#76966)
Jan Kotas [Thu, 13 Oct 2022 06:03:38 +0000 (23:03 -0700)]
Reintroduce typo in ICorDebug public API names (#76966)

Fixes #76960

2 years agoAdd support for using sccache on Unix (#76889)
Andy Gocke [Thu, 13 Oct 2022 05:08:18 +0000 (22:08 -0700)]
Add support for using sccache on Unix (#76889)

* Add support for using sccache on Unix

sccache (https://github.com/mozilla/sccache) is a compiler
caching tool that supports local or remote storage. It's
useful in /runtime for caching the results of the C++ components of
the build.

This PR adds support for dotnet/runtime by recognizing a =true
environment variable, which then instructs CMake to look for a the
sccache binary in the PATH.

2 years agoRemove libstdc++ dependency from NativeAOT (#76705)
Adeel Mujahid [Thu, 13 Oct 2022 02:50:53 +0000 (05:50 +0300)]
Remove libstdc++ dependency from NativeAOT (#76705)

Fixes #76655

2 years agoAdd Vector128.IsHardwareAccelerated guard for ToBase64CharsLargeNoLineBreaks (#76970)
Stephen Toub [Thu, 13 Oct 2022 02:25:23 +0000 (22:25 -0400)]
Add Vector128.IsHardwareAccelerated guard for ToBase64CharsLargeNoLineBreaks (#76970)

2 years agoEnsure source generated metadata properties are read-only. (#76540)
Eirik Tsarpalis [Wed, 12 Oct 2022 19:36:52 +0000 (20:36 +0100)]
Ensure source generated metadata properties are read-only. (#76540)

* Ensure source generated metadata properties are read-only.

* Add JsonTypeInfo.IsReadOnly/MakeReadOnly() APIs.

2 years ago[wasm][debugger] Pass-through all `scriptParsed` events, including those with empty...
Ilona Tomkowicz [Wed, 12 Oct 2022 19:04:11 +0000 (21:04 +0200)]
[wasm][debugger] Pass-through all `scriptParsed` events, including those with empty URLs (#76187)

* Send log with empty url as well.

* Passing `scriptParsed` method without any action.

2 years agosource-build: support building runtime using non-portable runtime packages. (#75597)
Tom Deseyn [Wed, 12 Oct 2022 18:52:26 +0000 (20:52 +0200)]
source-build: support building runtime using non-portable runtime packages. (#75597)

* source-build: support building runtime using non-portable runtime packages.

Currently source-build performs a 'runtime-portable' build that produces
'linux-{arch}' packages that are used when building target runtime (non-portable).

With this change, we can use the non-portable packages that are produced by
a previous (non-portable) 'runtime' build. This helps eliminate the
'runtime-portable' build.

* Avoid references to Microsoft.AspNetCore.App.<rid>.

* crossgen2: set RuntimeIdentifier explicitly.

* PR feedback

* Revert "crossgen2: set RuntimeIdentifier explicitly."

This reverts commit 10be2744e624b833c43eecbf3f6f6896d415b7d7.

* PR feedback.

* Revert changes to ILCompiler.csproj.

* Update Directory.Build.targets

Co-authored-by: Viktor Hofer <viktor.hofer@microsoft.com>
2 years agoFix reading TestEnv.txt in BionicRunnerTemplate.sh (#76927)
Alexander Köplinger [Wed, 12 Oct 2022 18:25:56 +0000 (20:25 +0200)]
Fix reading TestEnv.txt in BionicRunnerTemplate.sh (#76927)

It was assuming the script is run from the same dir as the .txt file but that is not always the case.

2 years agoRemove container specification (#76943)
Drew Scoggins [Wed, 12 Oct 2022 18:10:46 +0000 (11:10 -0700)]
Remove container specification (#76943)

2 years agoadd Alacritty test data for console key parser tests (#76935)
Adam Sitnik [Wed, 12 Oct 2022 17:22:50 +0000 (19:22 +0200)]
add Alacritty test data for console key parser tests (#76935)

2 years agoDe-duplicate Unix Environment variables between Mono and native AOT (#76853)
Jan Kotas [Wed, 12 Oct 2022 15:24:31 +0000 (08:24 -0700)]
De-duplicate Unix Environment variables between Mono and native AOT (#76853)

* De-duplicate Unix Environment variables between Mono and native AOT

CoreCLR left on Win32 PAL

* Delete unused file

2 years ago[mono][jit] Devirtualize ldarg(s)+callvirt where possible. (#75748)
Jan Dupej [Wed, 12 Oct 2022 13:44:25 +0000 (15:44 +0200)]
[mono][jit] Devirtualize ldarg(s)+callvirt where possible. (#75748)

* [mono][jit] Devirtualizing ldarg(s)+callvirt where possible. #33015

* [mono][jit] Resolved compiler warnings. #33015

* [mono][jit] Fixed runtime crash when optimizing ldarg(a)+callvirt and vtable is unavailable. #33015

* [mono][jit] Checking mono_class_get_virtual_method assumptions now also fails when klass is abstract.

* [mono][jit] Cleaned up optimization of ldarg(a)+callvirt. GetHashCode is devirtualized in callvirt handler now.

* [mono][jit] ldarg(a)+callvirt optimization code style now conforms to guidelines.

* [mono][jit] Simplified conditions on ldarg(a)+callvirt optimization. Fixed code style issues.

* [mono][jit] Indentation fix. Vtable is now set up in check_get_virtual_method_assumptions.

2 years ago[mono][s390x] Fix wrong implementation of OP_CHECK_THIS (#76916)
Ulrich Weigand [Wed, 12 Oct 2022 11:17:15 +0000 (13:17 +0200)]
[mono][s390x] Fix wrong implementation of OP_CHECK_THIS (#76916)

* Only access a single byte in memory for OP_CHECK_THIS

* Remove unnecessary ltgr instruction

* Fixes https://github.com/dotnet/runtime/issues/76915

2 years agoIncrease distributed transaction test timeout for MSDTC communication failures (...
Shay Rojansky [Wed, 12 Oct 2022 01:08:53 +0000 (03:08 +0200)]
Increase distributed transaction test timeout for MSDTC communication failures (#76892)

Closes #76836

2 years agoBump intellisense to include latest docs for GA (#76846)
Carlos Sanchez [Tue, 11 Oct 2022 22:45:23 +0000 (15:45 -0700)]
Bump intellisense to include latest docs for GA (#76846)

Co-authored-by: carlossanlop <carlossanlop@users.noreply.github.com>
2 years agoFix gc hole in Frozen.cs (#76868)
Egor Bogatov [Tue, 11 Oct 2022 22:10:14 +0000 (00:10 +0200)]
Fix gc hole in Frozen.cs (#76868)

Co-authored-by: Jan Kotas <jkotas@microsoft.com>
2 years agoIntroduce a source generator for invoking methods on unmanaged vtables (#68276)
Jeremy Koritzinsky [Tue, 11 Oct 2022 21:27:06 +0000 (14:27 -0700)]
Introduce a source generator for invoking methods on unmanaged vtables (#68276)

2 years agoUpdate Arm64 cross build container (#76897)
Drew Scoggins [Tue, 11 Oct 2022 21:08:54 +0000 (14:08 -0700)]
Update Arm64 cross build container (#76897)

* Update Arm64 cross build container

* Reomve suffix

2 years agoDouble the size of new frozen segments (#76870)
Egor Bogatov [Tue, 11 Oct 2022 20:42:28 +0000 (22:42 +0200)]
Double the size of new frozen segments (#76870)

2 years agoDoc improvements (#76863)
Jan Kotas [Tue, 11 Oct 2022 20:35:53 +0000 (13:35 -0700)]
Doc improvements (#76863)

- Use proper macOS capitalization
- Delete superfluous details

Co-authored-by: Theodore Tsirpanis <teo@tsirpanis.gr>
2 years agoDon't unnecessarily allocate ObjectNodeSection objects (#76894)
Filip Navara [Tue, 11 Oct 2022 20:35:21 +0000 (22:35 +0200)]
Don't unnecessarily allocate ObjectNodeSection objects (#76894)

2 years ago[JIT] Cleanup to lsra inspired by #73424 (#76481)
Mark Plesko [Tue, 11 Oct 2022 17:13:36 +0000 (10:13 -0700)]
[JIT] Cleanup to lsra inspired by #73424 (#76481)

Inspired by comments ([here](https://github.com/dotnet/runtime/pull/73424#discussion_r939068635) and [here](
https://github.com/dotnet/runtime/pull/73424#discussion_r939090204))

- Remove `RefPosition* currentRefPosition = &reverseIterator` as it creates two variables that are essentially the same, especially since the iterator has operators like `->`.  In fact, I had to spend a bit of time verifying that there weren't any updates to one but not the other in the code.  (And actually #73424 did slightly impact this relationship since it moved the assignment from the loop iteration step to the loop body, but I don't believe that this mattered.)
I renamed the "iterator" variable to the "position" name to reduce textual churn in the code.  This didn't work as well for the range-based loops since they yield -references- to the underlying object so a bunch of C++ punctuation changes.
- Break apart two complicated `for` conditions and remove duplication between the condition and the loop body.  Search for `continueLoop` to see them.
 - Delete list's `operator&` on each iterator since they are no longer used and not part of normal iterators.

Manually verified no diffs (other than memory addresses) on a jitdump for a test case with minopts on and off to exercise the dump code in lsra.  Manually verified asm diffs were spurious (differences in runtime addresses, sometimes also causing changes in the compiler internal representation size and then locations of labels).

This regains the unexplained small throughput loss in #73424.

2 years agoAdd non-generic Create method to DispatchProxy (#73046)
Heath Baron-Morgan [Tue, 11 Oct 2022 16:44:26 +0000 (09:44 -0700)]
Add non-generic Create method to DispatchProxy (#73046)

Co-authored-by: Buyaa Namnan <bunamnan@microsoft.com>
2 years ago[test][tvos] Disable InvalidIVSizes overflow case for tvos (#76725)
Mitchell Hwang [Tue, 11 Oct 2022 16:16:26 +0000 (12:16 -0400)]
[test][tvos] Disable InvalidIVSizes overflow case for tvos (#76725)

This test has flakily caused app crashes on tvOS arm64 lanes. dotnet/arcade#11167
When the app crashes, it was observed that of the last tests ran, there commonly was only 2 InvalidIVSizes see
https://gist.github.com/mdh1418/563ce4066e16dfee055e0903e2c70a1e
https://gist.github.com/mdh1418/ed11c7ba361c3fdb8906e57034c58f90
https://gist.github.com/mdh1418/c831b807dc0d949bc01cdeee61a1d795

Whereas on a successful test suite run, there are 3.
https://gist.github.com/mdh1418/912914871d580475751d460719624224

Its suspected that the last test case is problematic, so disabling to make CI cleaner

2 years ago[mono] Add Vector128 Abs intrinsics for Amd64 (#76668)
Matous Kozak [Tue, 11 Oct 2022 15:58:23 +0000 (17:58 +0200)]
[mono] Add Vector128 Abs intrinsics for Amd64 (#76668)

* Abs intrinsics

* rename OP_SSSE3_ABS

2 years agoFix debug a app that has another .NET Wasm instance in a service worker (#76072)
Thays Grazia [Tue, 11 Oct 2022 13:45:10 +0000 (10:45 -0300)]
Fix debug a app that has another .NET Wasm instance in a service worker (#76072)

2 years ago[wasm][debugger] Fix debugger behavior when the type has ToString method overridden...
Thays Grazia [Tue, 11 Oct 2022 13:02:43 +0000 (10:02 -0300)]
[wasm][debugger] Fix debugger behavior when the type has ToString method overridden (#76780)

* The description of an object that has ToString implemented should be the result of the ToString and not the type name.

* Fix if cannot find ToString method.

* removing my name of the code

* Implementing support for inherited classes with ToString overriden.
Implement support for value types with ToString overriden.
Fix Debugger* is more relevant than ToString

* Fix test cases.

* Apply suggestions from code review

Co-authored-by: Ankit Jain <radical@gmail.com>
* Adding more tests and addressing @radical comments

* Adding tests for record

* Moving implementation of InvokeToStringAsync to sdbhelper and reuse it on objects and valuetypes.

* Apply suggestions from code review

Co-authored-by: Ankit Jain <radical@gmail.com>
* Addressing @radical comments.

Co-authored-by: Ankit Jain <radical@gmail.com>
2 years agoAdd more optimizations for (https://github.com/dotnet/runtime/issues/61412) (#74806)
Igor Bagdamyan [Tue, 11 Oct 2022 12:20:23 +0000 (15:20 +0300)]
Add more optimizations for (https://github.com/dotnet/runtime/issues/61412) (#74806)

2 years agoEnsure reflection property metadata is instantiated lazily (#76828)
Eirik Tsarpalis [Tue, 11 Oct 2022 10:51:47 +0000 (11:51 +0100)]
Ensure reflection property metadata is instantiated lazily (#76828)

* Ensure reflection property metadata is instantiated lazily.

* Address feedback

2 years agoFix JsonDocument thread safety. (#76716)
Eirik Tsarpalis [Tue, 11 Oct 2022 09:09:18 +0000 (10:09 +0100)]
Fix JsonDocument thread safety. (#76716)

Co-authored-by: stoub@microsoft.com
2 years ago[mono][interp] Optimize out some ldloca uses (#76669)
Vlad Brezae [Tue, 11 Oct 2022 08:10:09 +0000 (11:10 +0300)]
[mono][interp] Optimize out some ldloca uses (#76669)

* [mono][interp] Remove redundant opcode

Also allowing general optimizations that are being applied to ldfld opcodes.

* [mono][interp] Remove ldloca when used with ldfld/stfld

Generate direct moves instead to the valuetype interior offset

* [mono][interp] Replace ldloca + ldind/stdind with simple var moves

2 years agoRequire global opt-in for distributed transactions (#76376) (#76838)
Shay Rojansky [Tue, 11 Oct 2022 08:07:00 +0000 (10:07 +0200)]
Require global opt-in for distributed transactions (#76376) (#76838)

Closes #76469

(cherry picked from commit 2070def2a1354c3c04f2ab0d39a5e68d9113d65b)

2 years agoFix loop canonicalization for call-finally case (#76734)
Bruce Forstall [Tue, 11 Oct 2022 06:23:40 +0000 (23:23 -0700)]
Fix loop canonicalization for call-finally case (#76734)

* Fix loop canonicalization for call-finally case

If a call-finally is followed by a loop body that requires
canonicalization, we hit an assert that the `head` block
preceding the loop must be a fall-through block. This was
true in all cases except if the preceding block was the
BBJ_ALWAYS of a BBJ_CALLFINALLY/BBJ_ALWAYS pair.

To fix this, add a new canonicalization. If this case occurs,
simply insert a new fall-through block above the loop top
and redirect the BBJ_ALWAYS to that new block.

Fixes #76346

* Add unit test

2 years agoRevert "Reduce CoreCLR PAL (#76832)" (#76860)
Jan Kotas [Tue, 11 Oct 2022 05:30:21 +0000 (22:30 -0700)]
Revert "Reduce CoreCLR PAL (#76832)" (#76860)

This reverts commit f745eb9faee1bd67886bf7f7b684821424aa014d.

2 years agoImprove performance of integer formatting (#76726)
Stephen Toub [Tue, 11 Oct 2022 04:05:48 +0000 (00:05 -0400)]
Improve performance of integer formatting (#76726)

* Improve performance of integer formatting

1. The DivRem(..., 10) for each digit in the number ends up being the most expensive aspect of formatting.  This employs a trick other formatting libraries use, which is to have a table for all the formatted values between 00 and 99, and to then DivRem(..., 100) to cut the number of operations in half, which for longer values is meaningful.
2. Avoids going through the digit counting path when we know at the call site it won't be needed.
3. Employs a branch-free, table-based lookup for CountDigits(ulong) to go with a similar approach added for uint.

* Address PR feedback (move license notice)

2 years agoUse property AutoreleasePoolSupport in test (#76800)
Austin Wise [Tue, 11 Oct 2022 03:20:13 +0000 (20:20 -0700)]
Use property AutoreleasePoolSupport in test (#76800)

The SDK also set the RuntimeHostConfigurationOption item.
So setting in this project results in multiple copies of the same item.

I'm not sure if this causes a problem with any currently supported
configuration of .NET, but it is detectable when compiling this test
with NativeAOT. ILC fails because multiple copies of the
`--appcontextswitch` flag are passed with the same key.

2 years agoReduce CoreCLR PAL (#76832)
Jan Vorlicek [Tue, 11 Oct 2022 02:16:14 +0000 (04:16 +0200)]
Reduce CoreCLR PAL (#76832)

Remove unused functionality from the CoreCLR PAL. Also replace the
`DeleteFile` by standard `remove` function.

2 years agoZipArchive.CreateEntry: include file type in default ExternalAttributes. (#76059)
Tom Deseyn [Mon, 10 Oct 2022 23:56:05 +0000 (01:56 +0200)]
ZipArchive.CreateEntry: include file type in default ExternalAttributes. (#76059)

* ZipArchive.CreateEntry: include file type in default ExternalAttributes.

For Unix-type zip files, ExternalAttributes value matches 'struct stat' st_mode.
Besides permissions it should also include the file type.

* Use 'int' everywhere for ExternalAttributes.

* Change back to use uint for external file attributes field.

2 years agoIf a method has the Intrinsic attribute, the interpreter should treat it as if it...
Katelyn Gadd [Mon, 10 Oct 2022 23:53:41 +0000 (16:53 -0700)]
If a method has the Intrinsic attribute, the interpreter should treat it as if it had AggressiveInlining set. (#76475)

This significantly improves performance for System.Numerics vectors

2 years agoFixing repro command line arguments (#76820)
Brian Bohe [Mon, 10 Oct 2022 22:25:56 +0000 (15:25 -0700)]
Fixing repro command line arguments (#76820)

* Fixing repro command line args

* Update src/coreclr/tools/aot/crossgen2/Program.cs

Co-authored-by: Brian Bohe <brianbohe@microsoft.com>
Co-authored-by: Jan Kotas <jkotas@microsoft.com>
2 years agoJIT: Move impMathIntrinsic, lookupNamedIntrinsic, impUnsupportedNamedIntrinsic, impAr...
Jakob Botsch Nielsen [Sun, 9 Oct 2022 18:44:18 +0000 (20:44 +0200)]
JIT: Move impMathIntrinsic, lookupNamedIntrinsic, impUnsupportedNamedIntrinsic, impArrayAccessIntrinsic, impKeepAliveIntrinsic

2 years agoJIT: Move impTailCallRetTypeCompatible, impCheckCanInline
Jakob Botsch Nielsen [Sun, 9 Oct 2022 18:41:46 +0000 (20:41 +0200)]
JIT: Move impTailCallRetTypeCompatible, impCheckCanInline

2 years agoJIT: Move impMarkInlineCandidate, impMarkInlineCandidateHelper, IsTargetIntrinsic...
Jakob Botsch Nielsen [Sun, 9 Oct 2022 18:35:57 +0000 (20:35 +0200)]
JIT: Move impMarkInlineCandidate, impMarkInlineCandidateHelper, IsTargetIntrinsic, IsIntrinsicImplementedByUserCall, IsMathIntrinsic, impDevirtualizeCall, impConsiderCallProbe, compClassifyGDVProbeType, impGetSpecialIntrinsicExactReturnType

2 years agoJIT: Move SpillRetExprHelper, addFatPointerCandidate, pickGDV, isCompatibleMethodGDV...
Jakob Botsch Nielsen [Sun, 9 Oct 2022 18:33:39 +0000 (20:33 +0200)]
JIT: Move SpillRetExprHelper, addFatPointerCandidate, pickGDV, isCompatibleMethodGDV, considerGuardedDevirtualization, addGuardedDevirtualizationCandidate

2 years agoJIT: Move impTransformThis, impCanPInvokeInline, impCanPInvokeInlineCallSite, impChec...
Jakob Botsch Nielsen [Sun, 9 Oct 2022 18:31:36 +0000 (20:31 +0200)]
JIT: Move impTransformThis, impCanPInvokeInline, impCanPInvokeInlineCallSite, impCheckForPInvokeCall

2 years agoJIT: Move impPopCallArgs, impPopReverseCallArgs
Jakob Botsch Nielsen [Sun, 9 Oct 2022 18:29:16 +0000 (20:29 +0200)]
JIT: Move impPopCallArgs, impPopReverseCallArgs

2 years agoJIT: Move impInitializeArrayIntrinsic, impCreateSpanIntrinsic, impIntrinsic, impSRCSU...
Jakob Botsch Nielsen [Sun, 9 Oct 2022 18:27:46 +0000 (20:27 +0200)]
JIT: Move impInitializeArrayIntrinsic, impCreateSpanIntrinsic, impIntrinsic, impSRCSUnsafeIntrinsic

2 years agoJIT: Move impImportIndirectCall, impPopArgsForUnmanagedCall
Jakob Botsch Nielsen [Sun, 9 Oct 2022 18:25:46 +0000 (20:25 +0200)]
JIT: Move impImportIndirectCall, impPopArgsForUnmanagedCall

2 years agoJIT: Move impImportCall, impImportJitTestLabelMark, impFixupCallStructReturn
Jakob Botsch Nielsen [Sun, 9 Oct 2022 18:22:42 +0000 (20:22 +0200)]
JIT: Move impImportCall, impImportJitTestLabelMark, impFixupCallStructReturn

2 years agoJIT: Add importercalls.cpp for upcoming split, remove underscores from file names
Jakob Botsch Nielsen [Sun, 9 Oct 2022 18:17:51 +0000 (20:17 +0200)]
JIT: Add importercalls.cpp for upcoming split, remove underscores from file names

Also avoid marking some functions as 'inline' since then they cannot be
used from other TUs (in general, we can just leave the DCE up to the
compiler).

2 years agoFix MetadataLoadContext Readme (#76778)
MSDN.WhiteKnight [Mon, 10 Oct 2022 21:48:38 +0000 (02:48 +0500)]
Fix MetadataLoadContext Readme (#76778)

2 years agoAdd basic test for `PrintDocument.Print` using the default print controller (#76752)
Elinor Fung [Mon, 10 Oct 2022 20:51:56 +0000 (13:51 -0700)]
Add basic test for `PrintDocument.Print` using the default print controller (#76752)

2 years agoFix converting old SIMD ctors to HWI ones (#71865)
Joni Aromaa [Mon, 10 Oct 2022 20:51:12 +0000 (23:51 +0300)]
Fix converting old SIMD ctors to HWI ones (#71865)

* Fix converting old SIMD ctors to HWI ones

* Address PR feedback

* Fix Linux build

2 years agoImprovements to CoreCLR Building, Debugging, and Testing Documentation (#75569)
Ivan Diaz Sanchez [Mon, 10 Oct 2022 20:39:22 +0000 (13:39 -0700)]
Improvements to CoreCLR Building, Debugging, and Testing Documentation (#75569)

* Quality Week 2022: The First Step to a Better Documentation.

* Removed the Markdown Extension's additional development tags.

* Removed redundant stuff.

* Removed redundant stuff.

* Removed guide testing versions to avoid confusion that they would be the only supported versions.

* Addressed some Powershell comments, added a pointer to a yaml with links to other .NET sibling repos, and did a couple mini-corrections. Still got a few comments to address...

* Fixed a ';:' with Powershell's syntax.

* Addressed review comments: Redaction improvements, localization url's, improved code snippets, added info on individual subsets building configurations, changed COMPlus for DOTNET, and other misc improvements.

* Addressed remaining comments.

* Addressed some last comments regarding corerun, and the subset flags in the build scripts.

Co-authored-by: Ivan Diaz <bluehorizon186@gmail.com>
2 years agoOnly run Compilation liveness test on platforms with precise GC. (#76827)
Jeremy Koritzinsky [Mon, 10 Oct 2022 20:28:06 +0000 (13:28 -0700)]
Only run Compilation liveness test on platforms with precise GC. (#76827)

2 years agoDon't mark some byref locals as SIMD (#73819)
SingleAccretion [Mon, 10 Oct 2022 20:17:26 +0000 (23:17 +0300)]
Don't mark some byref locals as SIMD (#73819)

No point.

2 years agoJIT: import static readonly fields holding frozen objects as const handles (#76112)
Egor Bogatov [Mon, 10 Oct 2022 19:58:10 +0000 (21:58 +0200)]
JIT: import static readonly fields holding frozen objects as const handles (#76112)

Co-authored-by: Jan Kotas <jkotas@microsoft.com>
Co-authored-by: Jakob Botsch Nielsen <Jakob.botsch.nielsen@gmail.com>
2 years agoBase64.Decode: fixed latent bug for non-ASCII inputs (#76795)
Günther Foidl [Mon, 10 Oct 2022 19:44:19 +0000 (21:44 +0200)]
Base64.Decode: fixed latent bug for non-ASCII inputs (#76795)

2 years agoRevert "Remove closed issues from issues.targets (#75363)" (#76819)
Bruce Forstall [Mon, 10 Oct 2022 19:22:21 +0000 (12:22 -0700)]
Revert "Remove closed issues from issues.targets (#75363)" (#76819)

This reverts commit 105841c19e583487b270abd43b25d4ea91622a43.

2 years agoCorrect error messages for CoreCLR Win32 PAL uses in CoreLib (#76768)
Jan Kotas [Mon, 10 Oct 2022 18:52:12 +0000 (11:52 -0700)]
Correct error messages for CoreCLR Win32 PAL uses in CoreLib (#76768)

Contributes to #76736

2 years agoRemove more PAL exports for `wprintf` `wscanf` funcs (#76771)
Aaron Robinson [Mon, 10 Oct 2022 18:51:21 +0000 (11:51 -0700)]
Remove more PAL exports for `wprintf` `wscanf` funcs (#76771)

* Remove more PAL exports for wprintf funcs

* Remove tests for fwprintf

* Remove swscanf tests

* Remove wprintf tests

2 years agoImprove perf of Enumerable.Order{Descending} for primitives (#76733)
Stephen Toub [Mon, 10 Oct 2022 16:56:42 +0000 (12:56 -0400)]
Improve perf of Enumerable.Order{Descending} for primitives (#76733)

* Improve perf of Enumerable.Order{Descending} for primitives

For non-floating point primitive types, stable sorts are indistinguishable from unstable sorts.  They could be distinguishable if there are custom keys associated with each item, but Order{Descending} doesn't have separate keys from the elements themselves.  As such, we can avoid all of the overhead associated with the int[] map Order{Descending}By creates as part of implementing the stable sort, avoid always specifying a comparer, etc.  This PR does so for Order{Descending}(comparer) followed by ToArray, ToList, and foreach/GetEnumerator.

* Don't try to optimize custom comparers

2 years agoCombine AsSpan().Slice(...) calls into AsSpan(...) (#76799)
Stephen Toub [Mon, 10 Oct 2022 16:53:38 +0000 (12:53 -0400)]
Combine AsSpan().Slice(...) calls into AsSpan(...) (#76799)

2 years agoFix help formatting in cg2/ilc (#76772)
Adeel Mujahid [Mon, 10 Oct 2022 15:36:43 +0000 (18:36 +0300)]
Fix help formatting in cg2/ilc (#76772)

2 years agoAdd VMR attributes to preserve empty PDB files (#76810)
Přemek Vysoký [Mon, 10 Oct 2022 15:25:05 +0000 (17:25 +0200)]
Add VMR attributes to preserve empty PDB files (#76810)

Co-authored-by: Alexander Köplinger <alex.koeplinger@outlook.com>
2 years ago[wasm] Vector128's Sum and Dot SIMD implementation (#76446)
Radek Doulik [Mon, 10 Oct 2022 15:18:12 +0000 (17:18 +0200)]
[wasm] Vector128's Sum and Dot SIMD implementation (#76446)

* [wasm] Vector128's Sum and Dot SIMD implementation

Implements `Vector128.Sum` and `Vector128.Dot` SIMD intrinsics on WebAssembly. It calculates the sum by shuffling (with swizzle instruction) the lanes around and doing vector addition. This way it takes log2(number of lanes) additions.

An example of emitted code:
```
(func Wasm_Browser_Bench_Sample_Sample_VectorTask_DotFloat_RunStep(param $0 i32, $1 i32))
 local $2 v128
 local.get $0
 i32.eqz
 if
  call mini_llvmonly_throw_nullref_exception
  unreachable

 local.get $0
 local.get $0
 v128.load offset:16    [SIMD]
 local.get $0
 v128.load offset:32    [SIMD]
 f32x4.mul    [SIMD]
 local.tee $2
 local.get $2
 v128.const 0x0b0a09080f0e0d0c0302010007060504    [SIMD]
 i8x16.swizzle    [SIMD]
 f32x4.add    [SIMD]
 local.tee $2
 local.get $2
 v128.const 0x07060504030201000f0e0d0c0b0a0908    [SIMD]
 i8x16.swizzle    [SIMD]
 f32x4.add    [SIMD]
 f32x4.extract.lane 0    [SIMD]
 f32.store offset:48 align:2
```
C# method:
```
public override void RunStep() {
    result = Vector128.Dot(vector1, vector2);
}
```

bench sample measurements on amd64 desktop:

Chrome/amd64

| measurement | before | after | times faster |
|-:|-:|-:|-:|
|                Vector, Dot product int |     0.4398us |     0.0463us |  9.5 |
|              Vector, Dot product ulong |     0.2567us |     0.0474us |  5.4 |
|              Vector, Dot product float |     0.4305us |     0.0482us |  8.9 |
|             Vector, Dot product double |     0.2519us |     0.0458us |  5.5 |
|                      Vector, Sum sbyte |     0.8576us |     0.0463us | 18.5 |
|                      Vector, Sum short |     0.4632us |     0.0457us | 10.1 |
|                       Vector, Sum uint |     0.2686us |     0.0454us |  5.9 |
|                     Vector, Sum double |     0.1633us |     0.0480us |  3.4 |

Firefox/amd64

| measurement | before | after | times faster |
|-:|-:|-:|-:|
|                Vector, Dot product int |     0.3993us |     0.1108us | 3.6 |
|              Vector, Dot product ulong |     0.2668us |     0.1081us | 2.5 |
|              Vector, Dot product float |     0.3897us |     0.1032us | 3.8 |
|             Vector, Dot product double |     0.2592us |     0.1096us | 2.4 |
|                      Vector, Sum sbyte |     0.6510us |     0.1047us | 6.2 |
|                      Vector, Sum short |     0.4038us |     0.1025us | 3.9 |
|                       Vector, Sum uint |     0.2631us |     0.1025us | 2.6 |
|                     Vector, Sum double |     0.1928us |     0.1022us | 1.9 |

* Use XREG instead of VREG

* Update signature

* Fix result types

* Fix after merge

* Fix white space

2 years agoSPMI: Return recorded base instrumentation data address (#76765)
Jakob Botsch Nielsen [Mon, 10 Oct 2022 15:13:46 +0000 (17:13 +0200)]
SPMI: Return recorded base instrumentation data address (#76765)

This comment has not been accurate since the switch to the schema-based
PGO format. Today this buffer records only instrumentation data and only
the generated code accesses it, so we can return the recorded address
and fix one cause of spurious SPMI diffs.

2 years agoDateTime: Use Optimised Equals Implementation in object.Equals() (#76559)
Sewer [Mon, 10 Oct 2022 14:31:59 +0000 (15:31 +0100)]
DateTime: Use Optimised Equals Implementation in object.Equals() (#76559)

2 years agoUse IndexOf to find closing quote in WarningHeaderValue (#76804)
Stephen Toub [Mon, 10 Oct 2022 13:30:00 +0000 (09:30 -0400)]
Use IndexOf to find closing quote in WarningHeaderValue (#76804)

2 years agoDevirtualize EqualityComparer for reference types (#76714)
Egor Bogatov [Mon, 10 Oct 2022 13:29:04 +0000 (15:29 +0200)]
Devirtualize EqualityComparer for reference types (#76714)

2 years agoJIT: Preference locals away from PUTARG_REG killed registers (#76671)
Jakob Botsch Nielsen [Mon, 10 Oct 2022 12:54:46 +0000 (14:54 +0200)]
JIT: Preference locals away from PUTARG_REG killed registers (#76671)

If we see uses of locals between PUTARG_REG and the corresponding CALL node, then preference those intervals to not be allocated into the already placed register. Doing so will otherwise force a spill.

To do this effectively we only need to look at dying locals. If the local is not dying between the PUTARG_REG and CALL then it either does not have a use after the PUTARG_REG, or it has a use after the CALL and will be callee-saved register preferenced anyway.

2 years ago[main] Update dependencies from dotnet/llvm-project dotnet/icu dotnet/xharness dotnet...
dotnet-maestro[bot] [Mon, 10 Oct 2022 11:33:16 +0000 (11:33 +0000)]
[main] Update dependencies from dotnet/llvm-project dotnet/icu dotnet/xharness dotnet/emsdk (#76679)

[main] Update dependencies from dotnet/llvm-project dotnet/icu dotnet/xharness dotnet/emsdk

2 years ago[wasm] Implement next part of PackedSimd class (#76539)
Radek Doulik [Mon, 10 Oct 2022 09:35:29 +0000 (11:35 +0200)]
[wasm] Implement next part of PackedSimd class (#76539)

* [wasm] Implement next part of PackedSimd class

Also make the class public. The API review issue
https://github.com/dotnet/runtime/issues/53730#issuecomment-1209770214

* Use OP_XOP_X_X_X for PackedSimd.Dot

* Use XREG return for swizzle and shuffle

* Add doc comments to PackedSimd class

* Move comment to the right place

2 years agoFix Vector documentation (#74701)
Michał Petryka [Mon, 10 Oct 2022 07:48:48 +0000 (09:48 +0200)]
Fix Vector documentation (#74701)

2 years agoPort SpanHelpers.SequenceCompareTo(ref byte, int, ref byte, int) to Vector128/256...
Adam Sitnik [Mon, 10 Oct 2022 07:43:56 +0000 (09:43 +0200)]
Port SpanHelpers.SequenceCompareTo(ref byte, int, ref byte, int) to Vector128/256 (#73475)

2 years agoJIT: Streamline SIMD recognition (#76613)
Jakob Botsch Nielsen [Sat, 8 Oct 2022 10:08:47 +0000 (12:08 +0200)]
JIT: Streamline SIMD recognition (#76613)

Put it on the same plan as HW intrinsics. Use names from metadata and
use getTypeInstantiationArgument to get the base type. This avoids
relying on appendClassName and how the EE side formats instantiations
with it.

2 years agoThrow ObjectDisposedException for AES-CCM on Android
Kevin Jones [Sat, 8 Oct 2022 01:16:23 +0000 (21:16 -0400)]
Throw ObjectDisposedException for AES-CCM on Android

2 years agofiltering out addresses conservatively reported that land in the GC range but not...
Maoni Stephens [Sat, 8 Oct 2022 00:13:48 +0000 (17:13 -0700)]
filtering out addresses conservatively reported that land in the GC range but not in bookkeeping range (#76737)

this fixes the last issue standing in the way of enabling regions for AoT. AoT could conservatively report addresses that land in the GC heap range but not in range that bookkeeping covers. so these need to filtered out.

2 years agoFix #76116. (#76747)
Eirik Tsarpalis [Fri, 7 Oct 2022 21:25:17 +0000 (22:25 +0100)]
Fix #76116. (#76747)

2 years agoFix for pipelines broken in #75473 (#76758)
Jo Shields [Fri, 7 Oct 2022 21:22:10 +0000 (17:22 -0400)]
Fix for pipelines broken in #75473 (#76758)

2 years agoProperly handle filesizes larger than 8 Gb (#76707)
David Cantú [Fri, 7 Oct 2022 19:50:02 +0000 (14:50 -0500)]
Properly handle filesizes larger than 8 Gb (#76707)

* Properly handle filesizes larger than 8 Gb

* Add simulated data stream and address feedback

* Move tests for 8Gb files to outerloop and disable parallelization

* Change TarSizeFieldTooLargeForEntryType on .resx

2 years agoUse CCKeyDerivationPBKDF on iOS
Kevin Jones [Fri, 7 Oct 2022 19:24:50 +0000 (15:24 -0400)]
Use CCKeyDerivationPBKDF on iOS

2 years agoUse static abstracts instead of partial + containing class to define a solid contract...
Jeremy Koritzinsky [Fri, 7 Oct 2022 19:02:16 +0000 (12:02 -0700)]
Use static abstracts instead of partial + containing class to define a solid contract to simplify authoring our custom type marshalling tests (#76479)

2 years agoTest and fix using AEAD ciphers after disposal
Kevin Jones [Fri, 7 Oct 2022 18:01:23 +0000 (14:01 -0400)]
Test and fix using AEAD ciphers after disposal

2 years agoUse AzDO Pipeline Resources to define our build Docker containers (#75473)
Jeremy Koritzinsky [Fri, 7 Oct 2022 17:47:28 +0000 (10:47 -0700)]
Use AzDO Pipeline Resources to define our build Docker containers (#75473)

2 years agoRemove GUID <=> string functions in PAL (#76729)
Aaron Robinson [Fri, 7 Oct 2022 17:31:23 +0000 (10:31 -0700)]
Remove GUID <=> string functions in PAL (#76729)

* Remove PAL versions of Win32 GUID/string funcs

* Fix contract violation for non-throwing path

2 years agoRemove XmlConvert.StrEqual and use Span<char>.StartsWith() instead. (#74955)
Trayan Zapryanov [Fri, 7 Oct 2022 17:08:38 +0000 (20:08 +0300)]
Remove XmlConvert.StrEqual and use Span<char>.StartsWith() instead. (#74955)

* Use Span.SequenceEqual instead if manual loop over char array.

* Remove StrEqual.
Replace with StartsWith as suggested.

* Remove not needed brackets + fix tests

* Use switch expression for "verison", "encoding" and "standalone"

* Use ranges + one more switch expression

* Remove StartsWith helper method from ParsingState

* Address range feedback

* Add test for XmlTextReader.ReadChars

* Fix test

Co-authored-by: Traian Zaprianov <Traian.Zaprianov@docuware.com>
2 years agoMake sure isRunSmokeTestsOnly is false when manually triggering runtime-extra-platfor...
Steve Pfister [Fri, 7 Oct 2022 17:01:49 +0000 (13:01 -0400)]
Make sure isRunSmokeTestsOnly is false when manually triggering runtime-extra-platforms (#76715)

Also, remove runtime-bionic references in the yml as this pipeline does not exist.

Co-authored-by: mdh1418 <mitchhwang1418@gmail.com>