platform/upstream/dotnet/runtime.git
3 years agoMore Parse tests for double, single and Half (#50394)
Prashanth Govindarajan [Tue, 22 Jun 2021 01:22:30 +0000 (18:22 -0700)]
More Parse tests for double, single and Half (#50394)

* Test ibm-fpgen locally for validation

* sq

3 years agoDisable mainv1 and mainv2 for GCStress due to #54203 (#54514)
Bruce Forstall [Tue, 22 Jun 2021 01:10:58 +0000 (18:10 -0700)]
Disable mainv1 and mainv2 for GCStress due to #54203 (#54514)

3 years agoSYSLIB0026: Obsolete mutable X509 certificate APIs
Kevin Jones [Mon, 21 Jun 2021 23:36:51 +0000 (19:36 -0400)]
SYSLIB0026: Obsolete mutable X509 certificate APIs

3 years agoAdd name of corrupted certificate to CryptographicException on Mac
Oded Hanson [Mon, 21 Jun 2021 22:14:16 +0000 (01:14 +0300)]
Add name of corrupted certificate to CryptographicException on Mac

* Add name of corrupted certificate to CryptographicException on Mac

When trying to create a CertificateData out of raw X509 byte array it might throw if the data is corrupted. The existing exception message does not provide any information which might help the user identify the corrupted certificate and fix it.

This change, makes a native call to SecCertificateCopySubjectSummary which will provide a human readable summary of the certificate, and will generate an exception message using this string.

Co-authored-by: Jeremy Barton <jbarton@microsoft.com>
3 years agoDispose transient CFData in Interop.AppleCrypto.X509GetRawData
Oded Hanson [Mon, 21 Jun 2021 22:12:18 +0000 (01:12 +0300)]
Dispose transient CFData in Interop.AppleCrypto.X509GetRawData

3 years agoAdd code to flush JSON writer after root-level fast-path serialization (#54502)
Layomi Akinrinade [Mon, 21 Jun 2021 22:08:27 +0000 (15:08 -0700)]
Add code to flush JSON writer after root-level fast-path serialization (#54502)

3 years agoHTTP/3: Fix header field length calculation (#54442)
James Newton-King [Mon, 21 Jun 2021 21:45:57 +0000 (09:45 +1200)]
HTTP/3: Fix header field length calculation (#54442)

3 years ago[Mono] Enable runtime tests to run on Android x64 with interpreter (#54084)
Fan Yang [Mon, 21 Jun 2021 20:04:39 +0000 (16:04 -0400)]
[Mono] Enable runtime tests to run on Android x64 with interpreter (#54084)

* Enable Android x64 with interpreter

* Make variable RuntimeVariant available for testenvironment

* Pass down runtimeVariant

* Verify that tests are running with interpreter

* Pass MONO_ENV_OPTIONS value to the app

* Set ForceInterpreter to true

* Change default value for interp to false

* dummy commit

* dummy commit 2

* dummy commit

* Configure interp for Android

* Pass RuntimeVariant down as a parameter

* Add issue link

* Enable Mono with interpreter on desktop

* Disable Android x64 with JIT

* Revert hacks to enable all lanes

* revert unintentional change

* Disable Vector128_1_r*

3 years agoSwitch MsQuicOpen to MsQuicOpenVersion (#54443)
Thad House [Mon, 21 Jun 2021 19:56:27 +0000 (12:56 -0700)]
Switch MsQuicOpen to MsQuicOpenVersion (#54443)

* Switch MsQuicOpen to MsQuicOpenVersion

MsQuicOpenVersion is designed so we can update the API without breaking old consumers. The version of MsQuic specified in the readme already has this change, so it is safe to completely switch over.

Also switches the API to function pointers, as it was easier then updating the delegate too.

* Add version contant

3 years agoAdd UnixFilePermissions.xml for Mono AOT compilers (#54501)
Jo Shields [Mon, 21 Jun 2021 19:30:03 +0000 (15:30 -0400)]
Add UnixFilePermissions.xml for Mono AOT compilers (#54501)

* Add UnixFilePermissions.xml for Mono AOT compilers

Ref: https://github.com/dotnet/runtime/issues/53545
Ref: https://github.com/dotnet/sdk/issues/16894
Ref: https://github.com/xamarin/xamarin-macios/pull/11869
Ref: https://github.com/xamarin/xamarin-android/pull/6010

* Only set permissions on !windows

3 years agoAdd Cross DAC documentation (#54498)
Steve MacLean [Mon, 21 Jun 2021 19:10:16 +0000 (15:10 -0400)]
Add Cross DAC documentation (#54498)

* Add Cross DAC documentation

3 years agoAvoid Attribute.InternalGetCustomAttributes overheads when inherit==true is useless...
Stephen Toub [Mon, 21 Jun 2021 17:59:46 +0000 (13:59 -0400)]
Avoid Attribute.InternalGetCustomAttributes overheads when inherit==true is useless (#54402)

3 years agoSpecial-case no attributes in GetCustomAttributeData (#54405)
Stephen Toub [Mon, 21 Jun 2021 17:59:28 +0000 (13:59 -0400)]
Special-case no attributes in GetCustomAttributeData (#54405)

3 years agoBuild for any RID if building from source (#54223)
Michael Simons [Mon, 21 Jun 2021 17:42:57 +0000 (12:42 -0500)]
Build for any RID if building from source (#54223)

3 years agoRemove BitmapSelector.Suffix property (#54364)
Eric Erhardt [Mon, 21 Jun 2021 17:10:47 +0000 (12:10 -0500)]
Remove BitmapSelector.Suffix property (#54364)

With https://github.com/dotnet/runtime/issues/22761 and https://github.com/dotnet/corefx/pull/22833, BitmapSelector.Suffix will always be null. This means this feature is dead code, and users are unable to use it.

Removing this dead code because:

1. It doesn't do anything.
2. It is causing ILLink warnings, and it is easier to delete than to try to address the warnings.

I logged https://github.com/dotnet/runtime/issues/54363 to follow up and either re-implement this feature, or obsolete the attributes that no longer have any effect on the app.

3 years agoSyntax highlighted `type-loader.md` (#54497)
Takym (たかやま) [Mon, 21 Jun 2021 17:06:29 +0000 (02:06 +0900)]
Syntax highlighted `type-loader.md` (#54497)

* Syntax-highlighted `type-loader.md`

* Update type-loader.md

3 years agoFix the slot calculation for multiple services (#54462)
David Fowler [Mon, 21 Jun 2021 15:24:16 +0000 (08:24 -0700)]
Fix the slot calculation for multiple services (#54462)

3 years agoClarify Visual Studio minimum requirement (#52820)
xtqqczze [Mon, 21 Jun 2021 15:21:52 +0000 (16:21 +0100)]
Clarify Visual Studio minimum requirement (#52820)

3 years ago[WASM] Converted mono-config.js to mono-config.json (#53606)
Daniel Genkin [Mon, 21 Jun 2021 14:10:58 +0000 (10:10 -0400)]
[WASM] Converted mono-config.js to mono-config.json (#53606)

* converted mono-config.js to mono-config.json

* Fixed test

* fixed handling of case where Module isn't defined

* Fixed remaining failing tests

* Replaced alerts with console.log to fix Helix test

* replaced all vars with consts

* use fetch

* clean syntax

* prevent timeouts when the mono-config file fails to load

* Moved config file loading to preInit

* Fixed tests

* Adjusted file linking

* removed the unnecessary js_support.js

* cleaned up function

* updated samples

* removed lingering pre-js flag

* Fixed trimming tests

* addressed PR comments

* removed useless function

3 years agoRemove redundant P/Invoke-s in S.D.Process on Apple platforms (#54273)
Maxim Lipnin [Mon, 21 Jun 2021 07:20:03 +0000 (10:20 +0300)]
Remove redundant P/Invoke-s in S.D.Process on Apple platforms (#54273)

* Remove P/Invoke to SystemNative_ConfigureTerminalForChildProcess which doesn't exist on Apple platforms

* Address the feedback based on the ifdef approach

* Add IsiOSLike property

* Use a partial method approach

* Address the feedback

3 years agoAllow mono samples to build and run again (#54089)
Aleksey Kliger (λgeek) [Mon, 21 Jun 2021 07:13:44 +0000 (03:13 -0400)]
Allow mono samples to build and run again (#54089)

3 years agoRemove System.Security.Cryptography.Cng from ASP.NET transport package (#54428)
Eric StJohn [Sat, 19 Jun 2021 20:31:12 +0000 (13:31 -0700)]
Remove System.Security.Cryptography.Cng from ASP.NET transport package (#54428)

3 years agoDisable tests for #54007 (#54207)
Bruce Forstall [Sat, 19 Jun 2021 17:07:59 +0000 (10:07 -0700)]
Disable tests for #54007 (#54207)

3 years agoenable ZeroByteRead_BlocksUntilDataAvailableOrNops test for quic (#54431)
Tomas Weinfurt [Sat, 19 Jun 2021 00:37:42 +0000 (02:37 +0200)]
enable ZeroByteRead_BlocksUntilDataAvailableOrNops test for quic (#54431)

3 years agoRemove crossgen from test build and run scripts (#54348)
Bruce Forstall [Fri, 18 Jun 2021 23:57:05 +0000 (16:57 -0700)]
Remove crossgen from test build and run scripts (#54348)

3 years agoFix AMD64 epilog ABI (#54357)
Bruce Forstall [Fri, 18 Jun 2021 23:51:50 +0000 (16:51 -0700)]
Fix AMD64 epilog ABI (#54357)

* Fix AMD64 epilog ABI

The Windows AMD64 epilog ABI states that an `lea rsp,[rbp+constant]` instruction
may only be used if a frame pointer has been reported to the OS in the prolog
unwind info, otherwise an `add rsp, constant` instruction must be used.
There were a number of cases where the JIT used the `lea` form simply because
a frame pointer had been established and was available, even though it had not
been reported to the OS (and, thus, the frame was effectively an `rsp` frame).

Fix this by using the same condition in the epilog for determining which form
to use, `lea` or `add`, that was used in the prolog to determine whether or not
to report the frame pointer in the unwind info.

Fixes #54320

* Formatting

* Fix OSR

3 years agoDisable two Interop tests failing in outerloop under crossgen2 (#54435)
Bruce Forstall [Fri, 18 Jun 2021 23:48:58 +0000 (16:48 -0700)]
Disable two Interop tests failing in outerloop under crossgen2 (#54435)

https://github.com/dotnet/runtime/issues/54379
https://github.com/dotnet/runtime/issues/54316

3 years ago[wasm][aot] Add support for passing items to the aot/helix test project (#54425)
Ankit Jain [Fri, 18 Jun 2021 22:40:07 +0000 (18:40 -0400)]
[wasm][aot] Add support for passing items to the aot/helix test project (#54425)

3 years agoEnable loading composite r2r images from a singlefile bundle (#53739)
Vladimir Sadov [Fri, 18 Jun 2021 20:48:22 +0000 (13:48 -0700)]
Enable loading composite r2r images from a singlefile bundle (#53739)

* Enable loading composite r2r images from a singlefile bundle

3 years agoBackport bugfixes, infrastructural changes and perf improvements from the polymorphis...
Eirik Tsarpalis [Fri, 18 Jun 2021 20:17:18 +0000 (23:17 +0300)]
Backport bugfixes, infrastructural changes and perf improvements from the polymorphism feature branch (#54420)

* backport opportunistic bugfixes

* strengthen debug assertions and add clarifying comments

* Rework WriteStack/ReadStack implementations

* Use array instead of list for storing frames. Previous frames can now be passed by reference
* Ensure that the _count field always reflects the current depth.
* Remove StackFrame.Reset() methods which are occassionally a source of dirty frames being reused.

* Take advantage of JIT optimizations in the serialization hot path

* address PR feedback

3 years agoset UsableAfterCanceledReads for QUIC tests (#54416)
Tomas Weinfurt [Fri, 18 Jun 2021 19:40:18 +0000 (21:40 +0200)]
set UsableAfterCanceledReads for QUIC tests (#54416)

3 years agoCreate a summary Markdown file for all asm diffs (#54430)
Bruce Forstall [Fri, 18 Jun 2021 19:23:40 +0000 (12:23 -0700)]
Create a summary Markdown file for all asm diffs (#54430)

Create a per-MCH file summary.md file, then accumulate them all into
a single overall summary Markdown file, for use in GitHub comments.
Uses the existing `jit-analyze --md` functionality.

Also, change asm diffs to not report missing data or asm diffs as a
replay failure.

Finally, don't overwrite superpmi.log files (or the new diff_summary.md files):
create new, unique file names for each run.

3 years agoMake some p/invokes blittable (#54370)
Elinor Fung [Fri, 18 Jun 2021 14:55:08 +0000 (07:55 -0700)]
Make some p/invokes blittable (#54370)

3 years agofix some failing quic tests (#54326)
Tomas Weinfurt [Fri, 18 Jun 2021 14:03:39 +0000 (16:03 +0200)]
fix some failing quic tests (#54326)

* fix some failing quic tests

* feedback from review

* add comment

3 years agoCondition MibcArgs for source-build (#54225)
Michael Simons [Fri, 18 Jun 2021 13:26:13 +0000 (08:26 -0500)]
Condition MibcArgs for source-build (#54225)

3 years agoFix Linux x86 build (#50836)
Gleb Balykov [Fri, 18 Jun 2021 12:38:22 +0000 (15:38 +0300)]
Fix Linux x86 build (#50836)

3 years agoHTTP/3: Remove ASP.NET Core specific code from QPackEncoder (#54378)
James Newton-King [Fri, 18 Jun 2021 10:49:46 +0000 (22:49 +1200)]
HTTP/3: Remove ASP.NET Core specific code from QPackEncoder (#54378)

3 years agoExclude experimental projects from source-build (#54222)
Michael Simons [Fri, 18 Jun 2021 07:52:22 +0000 (02:52 -0500)]
Exclude experimental projects from source-build (#54222)

3 years agofix MsQuicStream counting on failure (#54249)
Tomas Weinfurt [Fri, 18 Jun 2021 07:00:05 +0000 (09:00 +0200)]
fix MsQuicStream counting on failure (#54249)

3 years agoImplement NativeMemory (#54006)
Tanner Gooding [Fri, 18 Jun 2021 02:06:29 +0000 (19:06 -0700)]
Implement NativeMemory (#54006)

* Implement NativeMemory

* Exposing additional APIs as approved

* Ensure we have a test covering alignment and size being less than sizeof(void*)

* Update src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/NativeMemory.Unix.cs

Co-authored-by: Jan Kotas <jkotas@microsoft.com>
* Responding to PR feedback

* Adding additional alignment test coverage for 1 to 16384

* Add coverage for 65k and 1/2/4MB alignments

* Fixing the Native\Unix\System.Native\CMakeLists.txt

* Update src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/NativeMemory.Unix.cs

Co-authored-by: Jan Kotas <jkotas@microsoft.com>
* Don't call Buffer.Memmove in NativeMemory.AlignedRealloc if ptr is null

* Updating NativeMemory.AlignedRealloc to correctly copy only the size of the last allocation

* Ensure check_symbol_exists(HAVE_ALIGNED_ALLOC) is under the non-apple paths

* Check for malloc_usable_size in malloc_np for FreeBSD and ensure tests compile

* Fix the ReallocSmallerToLargerTest test

* Handle that posix_memalign differs from aligned_alloc for size == 0

Co-authored-by: Jan Kotas <jkotas@microsoft.com>
3 years agoFix casing (#54384)
Larry Ewing [Fri, 18 Jun 2021 01:23:29 +0000 (20:23 -0500)]
Fix casing (#54384)

3 years agoOnly include Microsoft.NET.Runtime.RuntimeConfigParser.Task on mobile (#54361)
Larry Ewing [Fri, 18 Jun 2021 00:25:44 +0000 (19:25 -0500)]
Only include Microsoft.NET.Runtime.RuntimeConfigParser.Task on mobile (#54361)

* Only include Microsoft.NET.Runtime.RuntimeConfigParser.Task on mobile

* Add maccatalyst target imports per request

3 years agoLazy-allocate ValidationState.CurPos (#54346)
Stephen Toub [Thu, 17 Jun 2021 23:58:30 +0000 (19:58 -0400)]
Lazy-allocate ValidationState.CurPos (#54346)

The array is only used for a subset of validators; no point in paying for this array for every ValidationState instance even if it's not going to be used.

3 years agoFix lots of unnecessary XmlValueGetter delegate allocations (#54344)
Stephen Toub [Thu, 17 Jun 2021 23:57:43 +0000 (19:57 -0400)]
Fix lots of unnecessary XmlValueGetter delegate allocations (#54344)

3 years agoMs.Ext.Options.OptionsBuilder.BindConfiguration adds ConfigurationChangeTokenSource...
Fredrik Høisæther Rasch [Thu, 17 Jun 2021 22:15:45 +0000 (00:15 +0200)]
Ms.Ext.Options.OptionsBuilder.BindConfiguration adds ConfigurationChangeTokenSource to DI (#46740)

3 years agoCodesign apphosts on Mac (#53913)
Mateo Torres-Ruiz [Thu, 17 Jun 2021 22:09:27 +0000 (15:09 -0700)]
Codesign apphosts on Mac (#53913)

* Add CodeSign to HostWriter

* Fix test

* PR feedback

* Add EnableMacOSCodeSign to CreateAppHost
Add tests

* Check that OSPlatform is OSX before running codesign.

* Guard from filepaths containing spaces

* Move apphost exceptions to a single file
Modify apphost exceptions inheritance

* Move AppHostUpdateException

* Apply suggestions from code review

Co-authored-by: Jan Kotas <jkotas@microsoft.com>
* Add exit code to AppHostSigningException

Co-authored-by: Jan Kotas <jkotas@microsoft.com>
3 years agoUpdate superpmi_setup.py script with more exclusions (#54309)
Bruce Forstall [Thu, 17 Jun 2021 21:13:47 +0000 (14:13 -0700)]
Update superpmi_setup.py script with more exclusions (#54309)

I noticed a bunch of failures trying to run crossgen2 on these binaries
in one of our collections.

Also, make the checking case-insensitive: I saw that we were failing to
match "corerun.exe" against "CoreRun.exe" that was in the exclusion list.

3 years agoAdd a test for Expression.Property and its handling of property accessors (#54279)
Vitek Karas [Thu, 17 Jun 2021 20:21:55 +0000 (22:21 +0200)]
Add a test for Expression.Property and its handling of property accessors (#54279)

* Add a test for Expression.Property and its handling of property accessors

This mostly a linker test as this effectively validates linker feature from https://github.com/mono/linker/pull/1880.

But having a clean trimming tests here is better validation for this specific case.

* Add one more test case as per feedback

* Remove debugging leftover

3 years ago[mono] Enable more HardwareIntrinsics tests and fix more amd64 intrinsics bugs (...
imhameed [Thu, 17 Jun 2021 17:04:56 +0000 (10:04 -0700)]
[mono] Enable more HardwareIntrinsics tests and fix more amd64 intrinsics bugs (#54127)

Enables nearly all disabled `JIT/HardwareIntrinsics` tests.
`StoreNonTemporal_{r,ro}` and `Sse42.X64/Crc32_{r,ro}` remain disabled due to
issues that are out of scope for this PR.

Changes:

* Enable `pclmul` and `aes` when AOT compiling runtime tests.

* Add a `immediate_unroll_unreachable_default`, used to mark the default case
  in an unrolled immediate switch as unreachable.

* Fix `OP_MULX_HL{32,64}`: the low-word address is sometimes an integer produced
  by ptrtoint

  Fixes compilation of `JIT/HardwareIntrinsics/X86/Bmi2/Bmi2_{r,ro}/**`
  and `JIT/HardwareIntrinsics/X86/Bmi2.X64/Bmi2.X64_{r,o}/**`.

* Implement immediate unrolling for `Ssse3.AlignRight`

  Fixes `JIT/HardwareIntrinsics/X86/Ssse3/Ssse3_{r,ro}/**`.

* Implement the 3-argument overload of `Bmi1.BitFieldExtract`

  Fixes `JIT/HardwareIntrinsics/X86/Bmi1/Bmi1_{r,ro}/**` and
  `JIT/HardwareIntrinsics/X86/Bmi1.X64/Bmi1.X64_{r,ro}/**`.

* Implement immediate unrolling for `Aes.KeygenAssist`

  Fixes `JIT/HardwareIntrinsics/X86/Aes/Aes_{r,ro}/**`.

* Implement immediate unrolling for `Sse41.MultipleSumAbsoluteDifferences`

  Fixes
  `JIT/HardwareIntrinsics/X86/Sse41/MultipleSumAbsoluteDifferences_{r,ro}/**`.

* Mask vector selection index in `OP_XEXTRACT_*` and `OP_XINSERT_*`

  LLVM `insertelement` and `extractelement` yield poison values for lane
  indices that are out of bounds, but the underlying instructions on amd64 only
  care about the lower few bits in the immediate octet and the
  `Extract.UInt64.129` etc. tests in
  `JIT/HardwareIntrinsics/X86/Sse41.X64/Sse41.X64_r` test for this.

  Also, rename `OP_SSE41_INSERT` to `OP_SSE41_INSERTPS` and specialize this to
  the `insertps` overload of `Sse41.Insert`.

  Implement immediate unrolling for `OP_SSE41_INSERTPS`.

  Fixes `JIT/HardwareIntrinsics/X86/Sse41.X64/Sse41.X64_{r,ro}/**` and .
  `JIT/HardwareIntrinsics/X86/Sse41/Sse41_{r,ro}/**`.

* Copy the upper lanes over to the destination in `OP_SSE_CMPSS` and `OP_SSE2_CMPSD`

  Also fix the overloaded types associated with SSE saturating arithmetic LLVM
  intrinsic functions.

  Fixes `JIT/HardwareIntrinsics/X86/Sse2/Sse2_{r,ro}/**` and
  `JIT/HardwareIntrinsics/X86/Sse/Sse_{r,ro}/**`.

* Implement immediate unrolling for `Pclmulqdq.CarrylessMultiply`

  Fixes `JIT/HardwareIntrinsics/X86/Pclmulqdq/Pclmulqdq_{r,ro}`.

3 years agoFix SuperPMI handling of resolveVirtualMethod (#54315)
Bruce Forstall [Thu, 17 Jun 2021 17:01:49 +0000 (10:01 -0700)]
Fix SuperPMI handling of resolveVirtualMethod (#54315)

Change #53567 introduced new functionality to the JIT-EE
resolveVirtualMethod() API. This fixes the SuperPMI implementation
in the case where the API returns `false`, where some data fields
are not initialized.

Fixes crossgen2 SuperPMI collections.

Fixes #54310

3 years agoFix Activity last tag deletion (#54306)
Tarek Mahmoud Sayed [Thu, 17 Jun 2021 16:23:07 +0000 (09:23 -0700)]
Fix Activity last tag deletion (#54306)

3 years agoRemove some overhead from XmlNode.SelectSingleNode (#54299)
Stephen Toub [Thu, 17 Jun 2021 15:27:09 +0000 (11:27 -0400)]
Remove some overhead from XmlNode.SelectSingleNode (#54299)

* Remove unnecessary cost from XmlNode.SelectSingleNode

It's currently implemented by delegating to SelectSingleNodes and returning the first one.  While the list is lazily-populated, this still entails creating an `XPathNodeList`, creating a `List<XmlNode>`, storing the enumerated into the list, and then returning the element from the list, which is then thrown away.  With just a few lines, we can cut through all of that.

* Make XPathScanner and XPathParser into structs

No need for these to be allocated classes.  They can just live on the stack where they're created.

* Reduce ScanName overhead

This shows up on the hot path of parsing the xpath expression.  We can use a span to avoid bounds checking.

* Avoid bounds check in NextChar

NextChar is used by lots of routines to advance to the next character.  We can streamline it to avoid the bounds check when indexing into the string.

* Optimize SkipSpace for there not being any

The typical case is there isn't any whitespace, so inline that fast check.  This was showing up as a few percentage of a simple scenario.

3 years agoDelete invalid assert in PathInternal.CaseSensitivity (#54325)
Stephen Toub [Thu, 17 Jun 2021 14:43:27 +0000 (10:43 -0400)]
Delete invalid assert in PathInternal.CaseSensitivity (#54325)

* Delete invalid assert in PathInternal.CaseSensitivity

* Update PathInternal.CaseSensitivity.cs

3 years agoResolving first part of System.Drawing.Common IlLink warnings (#54076)
Jose Perez Rodriguez [Thu, 17 Jun 2021 13:49:13 +0000 (06:49 -0700)]
Resolving first part of System.Drawing.Common IlLink warnings (#54076)

* Resolving first part of System.Drawing.Common IlLink warnings

* Address PR feedback

Co-authored-by: Eric Erhardt <eric.erhardt@microsoft.com>
3 years agoAdd Dependency for wcf projects to compat pack (#54319)
Viktor Hofer [Thu, 17 Jun 2021 13:19:05 +0000 (15:19 +0200)]
Add Dependency for wcf projects to compat pack (#54319)

3 years agoAdd PipeWriter CanGetUnflushedBytes and UnflushedBytes properties (#54164)
Wraith [Thu, 17 Jun 2021 13:14:16 +0000 (14:14 +0100)]
Add PipeWriter CanGetUnflushedBytes and UnflushedBytes properties  (#54164)

* Add PipeWriter CanGetUnflushedBytes and UnflushedBytes properties and covering tests

* address feedback

3 years ago[mono] Add accessors m_method_is_final and m_method_is_abstract (#54271)
Aleksey Kliger (λgeek) [Thu, 17 Jun 2021 13:05:14 +0000 (09:05 -0400)]
[mono] Add accessors m_method_is_final and m_method_is_abstract (#54271)

* [metadata] Cleanup redundant logic

Follow-up to 4e03f3665ad197b005b361b3b7cdf7fcac298ef2

* Add m_method_is_abstract and m_method_is_final accessors

3 years agoFix profiling R2R code on Windows x64 (#54318)
Anton Lapounov [Thu, 17 Jun 2021 11:33:13 +0000 (04:33 -0700)]
Fix profiling R2R code on Windows x64 (#54318)

The kernel requires the function table to be 4-byte aligned.

3 years ago[mono] Fix comparisons between non runtime types (#54062)
Vlad Brezae [Thu, 17 Jun 2021 08:40:36 +0000 (11:40 +0300)]
[mono] Fix comparisons between non runtime types (#54062)

* [interp] Fix comparisons between non runtime types

We know that the result of object.GetType and ldftn + GetTypeFromHandle are runtime types and we track it on the compilation stack. If type equality operator is applied on two runtime types we use reference equality comparison, otherwise we use the managed implementation which uses Type.Equals.

* [mini] Fix comparisons between non runtime types

We know that the result of object.GetType and ldftn + GetTypeFromHandle are runtime types and we track it on the compilation stack. If type equality operator is applied on two runtime types we use reference equality comparison, otherwise we use the managed implementation which uses Type.Equals.

* [interp] Resolve GetType on constrained valuetype to the actual type

3 years agoIssue 36015 new BinderOption to throw on missing configuration (#53852)
Steve Dunn [Thu, 17 Jun 2021 04:15:52 +0000 (05:15 +0100)]
Issue 36015 new BinderOption to throw on missing configuration (#53852)

3 years agoImprove live variable JitDump output (#54256)
Bruce Forstall [Wed, 16 Jun 2021 22:50:31 +0000 (15:50 -0700)]
Improve live variable JitDump output (#54256)

The variable live range output is unnecessarily verbose. Simplify it; clean it up;
make it smaller; use standard dumpers.

Example, before:
```
////////////////////////////////////////
////////////////////////////////////////
Variable Live Range History Dump for Block 2
IL Var Num 0:
[rcx [ (G_M13669_IG02,ins#0,ofs#0), (G_M13669_IG03,ins#1,ofs#2) ]; rbp[16] (1 slot) [ (G_M13669_IG03,ins#1,ofs#2), NON_CLOSED_RANGE ]; ]
IL Var Num 1:
[rsi [ (G_M13669_IG03,ins#1,ofs#2), NON_CLOSED_RANGE ]; ]
////////////////////////////////////////
////////////////////////////////////////
End Generating code for Block 2
```
After:
```
Variable Live Range History Dump for BB02
V00 this: rcx [(G_M13669_IG02,ins#0,ofs#0), (G_M13669_IG03,ins#1,ofs#2)]; rbp[16] (1 slot) [(G_M13669_IG03,ins#1,ofs#2), ...]
V01 loc0: rsi [(G_M13669_IG03,ins#1,ofs#2), ...]
```

And the end-of-dump output, before:
```
////////////////////////////////////////
////////////////////////////////////////
PRINTING VARIABLE LIVE RANGES:
IL Var Num 0:
[rsi [18 , B5 )rsi [100 , 13A )rsi [14D , 186 )rsi [196 , 1C5 )rsi [1E3 , 271 )rsi [280 , 285 )]
IL Var Num 1:
[rdi [18 , B9 )rdi [100 , 137 )rdi [14D , 184 )rdi [196 , 1C2 )rdi [1E3 , 271 )rdi [280 , 288 )]
IL Var Num 2:
[rbx [18 , CA )rbx [100 , 10D )rbx [14D , 15A )rbx [196 , 1C7 )rbx [1E3 , 271 )rbx [280 , 28B )]
IL Var Num 3:
[rbp [3A , F0 )rbp [100 , 141 )rbp [14D , 18C )rbp [196 , 1D6 )rbp [1E3 , 275 )]
IL Var Num 4:
[r14 [3E , EC )r14 [100 , 13D )r14 [14D , 188 )r14 [196 , 1D2 )r14 [1E3 , 271 )]
IL Var Num 5:
[rcx [22A , 263 )]
////////////////////////////////////////
////////////////////////////////////////
```
After:
```
VARIABLE LIVE RANGES:
V00 arg0: rsi [18, B5); rsi [100, 13A); rsi [14D, 186); rsi [196, 1C5); rsi [1E3, 271); rsi [280, 285)
V01 arg1: rdi [18, B9); rdi [100, 137); rdi [14D, 184); rdi [196, 1C2); rdi [1E3, 271); rdi [280, 288)
V02 arg2: rbx [18, CA); rbx [100, 10D); rbx [14D, 15A); rbx [196, 1C7); rbx [1E3, 271); rbx [280, 28B)
V03 loc0: rbp [3A, F0); rbp [100, 141); rbp [14D, 18C); rbp [196, 1D6); rbp [1E3, 275)
V04 loc1: r14 [3E, EC); r14 [100, 13D); r14 [14D, 188); r14 [196, 1D2); r14 [1E3, 271)
V05 loc2: rcx [22A, 263)
```

3 years agoRemove duplicate tests (#54230)
Bruce Forstall [Wed, 16 Jun 2021 22:48:09 +0000 (15:48 -0700)]
Remove duplicate tests (#54230)

csgen.1 also exists in src\tests\Regressions\coreclr\0582
simple1 also exists in src\tests\JIT\Directed\Arrays

3 years agoRemove System.Drawing code that doesn't work (#54245)
Eric Erhardt [Wed, 16 Jun 2021 22:47:59 +0000 (17:47 -0500)]
Remove System.Drawing code that doesn't work (#54245)

This code only runs on macOS, and expects mono's System.Windows.Forms assembly is loaded into the process. This is causing trim warnings, and it is easier just to delete this code than try to make ILLink happy.

This code is only called from Graphics.FromHwnd, which doesn't work because the Carbon.framework no longer exists on macOS. Issue https://github.com/dotnet/runtime/issues/22221 is tracking the test failures that use FromHwnd.

3 years agoImprove cancellation in StreamPipeReader.ReadAtLeastAsync (#53306)
Emmanuel André [Wed, 16 Jun 2021 22:41:57 +0000 (00:41 +0200)]
Improve cancellation in StreamPipeReader.ReadAtLeastAsync (#53306)

* Improve cancellation in StreamPipeReader.ReadAtLeastAsync

* Introduce task variable

Co-authored-by: Stephen Toub <stoub@microsoft.com>
* Fix tests

* Expect TaskCanceledException on canceled token

Co-authored-by: Stephen Toub <stoub@microsoft.com>
3 years agoFollow the same failure behavior for [ComImport] classes on Windows with built-in...
Jeremy Koritzinsky [Wed, 16 Jun 2021 22:05:54 +0000 (15:05 -0700)]
Follow the same failure behavior for [ComImport] classes on Windows with built-in COM disabled as non-Windows. (#54298)

3 years agoUpdate to latest version of source index package (#54292)
Alex Perovich [Wed, 16 Jun 2021 21:07:27 +0000 (14:07 -0700)]
Update to latest version of source index package (#54292)

3 years ago[Mono] Fix memory leak during data registration (#54045)
Fan Yang [Wed, 16 Jun 2021 21:02:14 +0000 (17:02 -0400)]
[Mono] Fix memory leak during data registration (#54045)

* Fix memory leak

* Update src/mono/mono/mini/mini-generic-sharing.c

Co-authored-by: Aleksey Kliger (λgeek) <akliger@gmail.com>
* Update src/mono/mono/mini/mini-generic-sharing.c

Co-authored-by: Aleksey Kliger (λgeek) <akliger@gmail.com>
* Fix the return

Co-authored-by: Aleksey Kliger (λgeek) <akliger@gmail.com>
3 years agoRemove the `sealed` blittable layoutclass correctness fix because of backcompat....
Jeremy Koritzinsky [Wed, 16 Jun 2021 20:55:33 +0000 (13:55 -0700)]
Remove the `sealed` blittable layoutclass correctness fix because of backcompat. (#54235)

3 years ago[wasm][aot][tests] Enable libraries that have been consistently passing (#54291)
Ankit Jain [Wed, 16 Jun 2021 20:47:40 +0000 (16:47 -0400)]
[wasm][aot][tests] Enable libraries that have been consistently passing (#54291)

* [wasm][aot][tests] Enable libraries that have been consistently passing

.. on the tracking PR.

- `System.Linq.Tests`
Fixes https://github.com/dotnet/runtime/issues/51722

- `System.Runtime.Extensions.Tests`
- `System.IO.Pipelines.Tests`
    - the failing tests have been disabled

* [wasm][aot][tests] Disable more tests that depend on stacktraces

.. in System.Runtime.Tests . The library is still disabled for AOT,
because it hasn't been stable only for the last 7 days.

* Re-enable System.Runtime.Loader.Tests which is passing now.

3 years ago[wasm][aot] Disable tests that are failing because they depend on stacktrace API...
Ankit Jain [Wed, 16 Jun 2021 19:30:01 +0000 (15:30 -0400)]
[wasm][aot] Disable tests that are failing because they depend on stacktrace API (#54286)

3 years agoDon't use a remote server in SendAsync_HttpTracingEnabled_Succeeds (#54240)
Miha Zupan [Wed, 16 Jun 2021 18:00:47 +0000 (11:00 -0700)]
Don't use a remote server in SendAsync_HttpTracingEnabled_Succeeds (#54240)

3 years agoRemove crossgen tests (#54252)
Bill Wert [Wed, 16 Jun 2021 17:07:27 +0000 (10:07 -0700)]
Remove crossgen tests (#54252)

3 years agoFix packaging test use of Stream.Read (#54233)
Stephen Toub [Wed, 16 Jun 2021 16:56:03 +0000 (12:56 -0400)]
Fix packaging test use of Stream.Read (#54233)

Read returning the number of bytes requested is not guaranteed.

3 years agoRemove uses of Rijndael from EncryptedXml where possible (#54238)
Kevin Jones [Wed, 16 Jun 2021 16:20:33 +0000 (12:20 -0400)]
Remove uses of Rijndael from EncryptedXml where possible (#54238)

Also dispose of AES usages to match behavior of the .NET Framework.

3 years ago[wasm] Disable unsupported Stacktrace test, on AOT (#54206)
Ankit Jain [Wed, 16 Jun 2021 16:00:12 +0000 (12:00 -0400)]
[wasm] Disable unsupported Stacktrace test, on AOT (#54206)

```
[22:22:31] fail: [FAIL] System.Tests.EnvironmentStackTrace.StackTraceDoesNotStartWithInternalFrame
[22:22:31] info: System.NullReferenceException : Object reference not set to an instance of an object.
[22:22:31] info:    at System.Reflection.RuntimeMethodInfo.Invoke(Object , BindingFlags , Binder , Object[] , CultureInfo )
```

Issue: https://github.com/dotnet/runtime/issues/51676

3 years agoFix typo in comments in ConsoleLifetimeOptions.cs (#54255)
GitHubPang [Wed, 16 Jun 2021 15:16:20 +0000 (23:16 +0800)]
Fix typo in comments in ConsoleLifetimeOptions.cs (#54255)

3 years agoFix wrong indices for MobileAppHandler (#54275)
Fan Yang [Wed, 16 Jun 2021 14:34:02 +0000 (10:34 -0400)]
Fix wrong indices for MobileAppHandler (#54275)

3 years agoChange condition for stripping to per-file (#54224)
Jo Shields [Wed, 16 Jun 2021 10:24:01 +0000 (06:24 -0400)]
Change condition for stripping to per-file (#54224)

Previously, stripping of all produced libraries (libmono-component-*) was based on the file type of libmonosgen. That would fail to do stripping in the corner case of producing a static libmonosgen but dynamic components. This eliminates that problem.

3 years ago[mono][wasm] Fix the usage of function pointers in mixed mode. (#54098)
Zoltan Varga [Wed, 16 Jun 2021 09:52:37 +0000 (05:52 -0400)]
[mono][wasm] Fix the usage of function pointers in mixed mode. (#54098)

* [mono][wasm] Fix the usage of function pointers in mixed mode.

The llvm compiled code expects function pointers to be a MonoFtnDesc*, while
the interpreter expects them to be a InterpMethod*. Use a MonoFtnDesc in
both cases.

* Reenable some tests.

* Add caching.

3 years ago[mono] Search for components using mono_dl_build_path (#54237)
Aleksey Kliger (λgeek) [Wed, 16 Jun 2021 09:51:46 +0000 (05:51 -0400)]
[mono] Search for components using mono_dl_build_path (#54237)

It knows how to try various combinations of prefixes and suffixes on various
platforms.  In particular it knows to look for .dylib files on Apple platforms.

Fixes iOS simulator component search

3 years agoRemove unsigned executable entitlement (#51294)
Manish Godse [Wed, 16 Jun 2021 04:08:41 +0000 (21:08 -0700)]
Remove unsigned executable entitlement (#51294)

3 years agoupdate branding to preview7 (#54243)
Anirudh Agnihotry [Tue, 15 Jun 2021 23:25:46 +0000 (16:25 -0700)]
update branding to preview7 (#54243)

3 years agoSupport generating log methods in nested classes (#54180)
Maryam Ariyan [Tue, 15 Jun 2021 22:36:02 +0000 (18:36 -0400)]
Support generating log methods in nested classes (#54180)

3 years agoMark logging source generator file as generated (#53275)
Martin Costello [Tue, 15 Jun 2021 21:56:13 +0000 (22:56 +0100)]
Mark logging source generator file as generated (#53275)

Give the output file for the M.E.Logging logging classes a ".g" suffix
so that it is treated as a generated file to prevent it being flagged by
source analyzers for violations the application developer cannot fix
for themselves.

3 years agoAdd HashCode.AddBytes(ReadOnlySpan<byte>) (#54168)
Stephen Toub [Tue, 15 Jun 2021 21:28:45 +0000 (17:28 -0400)]
Add HashCode.AddBytes(ReadOnlySpan<byte>) (#54168)

* Add HashCode.Add(ReadOnlySpan<byte>)

* Address PR feedback

3 years agoAdd Type.GetMemberWithSameMetadataDefinitionAs (#53704)
Eric Erhardt [Tue, 15 Jun 2021 21:14:10 +0000 (16:14 -0500)]
Add Type.GetMemberWithSameMetadataDefinitionAs (#53704)

* Add API to find MethodInfo on instantiated generic type from generic type definition

Fix #45771

* Rename to GetMemberWithSameMetadataDefinitionAs
* Fix a bug for NestedType
* Use new method libraries that were working around not having it

* Implement GetMemberWithSameMetadataDefinitionAs in mono

* Revert JavaScript Runtime changes.

* Support inheritance in GetMemberWithSameMetadataDefinitionAs.

3 years agolvDoNotEnregister is not set when we are calling this function. (#54199)
Sergey Andreenko [Tue, 15 Jun 2021 21:11:12 +0000 (14:11 -0700)]
lvDoNotEnregister is not set when we are calling this function. (#54199)

3 years ago[Android] Fix crash in startup when running below API Level 24 (#54231)
Steve Pfister [Tue, 15 Jun 2021 20:38:44 +0000 (16:38 -0400)]
[Android] Fix crash in startup when running below API Level 24 (#54231)

This change fixes a crash when running below API Level 24 due to SNIHostName and SSLParameters.setServerNames not being available. We will now throw a PlatformNotSupportedException to make things a little more apparent.

Fixes #54182

3 years agoGeneralize C#/JS string interning and ensure most bindings code supports interned...
Katelyn Gadd [Tue, 15 Jun 2021 20:38:10 +0000 (13:38 -0700)]
Generalize C#/JS string interning and ensure most bindings code supports interned strings (#54086)

This PR refactors all C# -> JS string decoding to go through a single path that maintains an intern table

3 years agocatch DirectoryOperationException to check Negotiate as for LdapException (#52748)
Trivalik [Tue, 15 Jun 2021 19:31:51 +0000 (21:31 +0200)]
catch DirectoryOperationException to check Negotiate as for LdapException (#52748)

resolves https://github.com/dotnet/runtime/issues/51222

Co-authored-by: Trivalik <rborchert@live.de>
3 years agoFix unboxing datetime instances (#54105)
Katelyn Gadd [Tue, 15 Jun 2021 19:29:51 +0000 (12:29 -0700)]
Fix unboxing datetime instances (#54105)

Unboxing datetime instances is currently broken in some cases due to an incorrect method signature

3 years agoRename wasm/browser-bench sample to match others, so it gets built on CI (#54205)
Ankit Jain [Tue, 15 Jun 2021 19:21:41 +0000 (15:21 -0400)]
Rename wasm/browser-bench sample to match others, so it gets built on CI (#54205)

Co-authored-by: Radek Doulik <radekdoulik@gmail.com>
3 years agoMake System.Net.Http.HPack.IntegerEncoder a struct (#54209)
Theodore Tsirpanis [Tue, 15 Jun 2021 19:21:22 +0000 (22:21 +0300)]
Make System.Net.Http.HPack.IntegerEncoder a struct (#54209)

3 years agoSet of offset-based APIs for thread-safe file IO (#53669)
Adam Sitnik [Tue, 15 Jun 2021 18:59:58 +0000 (20:59 +0200)]
Set of offset-based APIs for thread-safe file IO (#53669)

Co-authored-by: Stephen Toub <stoub@microsoft.com>
3 years agoDon't return null target methods in GetInterfaceMap for abstract classes, or classes...
Aleksey Kliger (λgeek) [Tue, 15 Jun 2021 18:56:58 +0000 (14:56 -0400)]
Don't return null target methods in GetInterfaceMap for abstract classes, or classes using DIMs (#53972)

* Add DIM tests for GetInterfaceMap

Regression tests for https://github.com/dotnet/runtime/issues/53933

* Return null target methods from GetInterfaceMap in fewer cases

If the iterface method is reabstracted, and either the found implementation
method is abstract, or the found implementation method is from another
DIM (meaning neither klass nor any of its ancestor classes implemented the
method), then say the target method is null.  Otherwise return the found
implementation method, even if it is abstract, unless we found a reabstracted
method in a non-abstract class

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

3 years agoAdd the concept of "notification profilers" to the runtime (#53122)
David Mason [Tue, 15 Jun 2021 18:54:02 +0000 (11:54 -0700)]
Add the concept of "notification profilers" to the runtime (#53122)

3 years ago[mono] Split the shared tooling into a separate abstract workload (#53102)
Larry Ewing [Tue, 15 Jun 2021 18:44:05 +0000 (13:44 -0500)]
[mono] Split the shared tooling into a separate abstract workload (#53102)

This moves the shared parts of the mono workload to a separate abstract workload to allow the VS packaging tooling to treat it as a component group.

3 years agoFix PAL_JitWriteProtect export on Linux (#54190)
Jan Vorlicek [Tue, 15 Jun 2021 18:37:30 +0000 (20:37 +0200)]
Fix PAL_JitWriteProtect export on Linux (#54190)

* Fix PAL_JitWriteProtect export on Linux

I have not realized that we actually export that symbol on Linux too and
that mscordac then have the dummy function missing.

* Code review feedback

* Disable PAL_JitWriteEnable usage in DBI / DAC

* Fix typo in amd64 version

Co-authored-by: Mike McLaughlin <mikem@microsoft.com>
3 years agoSplit 16-byte SIMD store around GC struct fields into two 8-byte SIMD stores (x86...
Egor Chesakov [Tue, 15 Jun 2021 17:59:28 +0000 (10:59 -0700)]
Split 16-byte SIMD store around GC struct fields into two 8-byte SIMD stores (x86)/ two 8-byte mov-s (x64) (#53116)

Fixes #51638 by using

1) Constructing `ASG(OBJ(addr), 0)` for structs that have GC fields and keeping the current IR (i.e. `ASG(BLK(addr), 0)`) for other types. Such bookkeeping would allow the JIT to maintain information about the class layout.

2a) Emitting a sequence of `mov [m64],r64` instead of `movdqu [m128],xmm` when zeroing structs with GC fields that are not guaranteed to be on the stack on win-x64 or linux-x64.

2b) Emitting a sequence of `movq [m64],xmm` when zeroing such structs on win-x86.

3 years ago[android] Don't print debug messages at startup (#54221)
Aleksey Kliger (λgeek) [Tue, 15 Jun 2021 17:50:31 +0000 (13:50 -0400)]
[android] Don't print debug messages at startup (#54221)

The JNI_OnLoad method calls GetClassGRef and GetMethod several hundred times
during startup.  The debug output is redundant (if any classes or methods are
missing we will assert and print a message and kill the process) and it slows
down startup.