platform/upstream/dotnet/runtime.git
3 years agoReplace a couple FormatterServices uses in DataContractSerialization (#49290)
Stephen Toub [Mon, 8 Mar 2021 15:46:24 +0000 (10:46 -0500)]
Replace a couple FormatterServices uses in DataContractSerialization (#49290)

3 years agoRule number correction (#49288)
CadenJi [Mon, 8 Mar 2021 11:39:08 +0000 (19:39 +0800)]
Rule number correction (#49288)

3 years agoReduce the size of the pipe (#49270)
David Fowler [Mon, 8 Mar 2021 06:58:05 +0000 (22:58 -0800)]
Reduce the size of the pipe (#49270)

- Use the pipe itself as the synchronization object
- Store the options instance as a way to reference shared settings
- Added a field to PipeOptions for storing if the Pool is the ArrayPool implementation of the MemoryPool
- Shrink PipeAwaitable in the common case
  - Move the ExecutionContext and SynchronizationContext into a typed called the SchedulingContext. These types are mostly used with async await and it's extremely rare to have to capture any of this state.
- Shrink the size of PipeCompletion
  - Since completion callbacks are deprecated they are rarely set. We remove the pool and the other fields and just store a list (which should be rarely used now).
- Reduce the default segment pool size to 4 items = 16K buffered
  - The original size was optimized to avoid pool resizes but we need to balance idle memory and the potential resize cost of the resize.

3 years agoLog the reason for importer's decision to reject the tail call in the dump (#49280)
SingleAccretion [Mon, 8 Mar 2021 05:48:48 +0000 (08:48 +0300)]
Log the reason for importer's decision to reject the tail call in the dump (#49280)

3 years agofix proxy detection for websockets on Windows (#48734)
Tomas Weinfurt [Mon, 8 Mar 2021 00:57:49 +0000 (16:57 -0800)]
fix proxy detection for websockets on Windows (#48734)

* fix proxy detection for websockets on Windows'

* feedback from review

3 years agoApply feedback to grow methods of generic collections (#49167)
Eirik Tsarpalis [Mon, 8 Mar 2021 00:56:02 +0000 (00:56 +0000)]
Apply feedback to grow methods of generic collections (#49167)

* Apply feedback to Grow methods of generic collections

* add assertion

3 years agoImprove zero-byte read handling in SslStream to reduce memory usage (#49123)
Geoff Kizer [Sun, 7 Mar 2021 21:02:28 +0000 (13:02 -0800)]
Improve zero-byte read handling in SslStream to reduce memory usage (#49123)

* add ZeroByteRead_PerformsZeroByteReadOnUnderlyingStreamWhenDataNeeded to stream conformance tests

* remove dead code

* change SslStream zero byte read implementation to issue zero-byte read on underlying stream when appropriate

* ensure buffer is always freed when not needed, and assert this

* create StreamConformanceTests assembly and reference from appropriate test projects

Co-authored-by: Geoffrey Kizer <geoffrek@windows.microsoft.com>
3 years agoSpeed up interface checking and casting (#49257)
Ben Adams [Sun, 7 Mar 2021 19:54:19 +0000 (19:54 +0000)]
Speed up interface checking and casting (#49257)

* Reduce branches in IsInstanceOfInterface/ChkCastInterface

* Drop extra var, lea; additional check for small counts

* Feedback

* Undo IsInstanceOfClass change

* Tidy usings

3 years agoFix Activity.ParentId trace flags part (#49162)
Tarek Mahmoud Sayed [Sun, 7 Mar 2021 00:45:10 +0000 (16:45 -0800)]
Fix Activity.ParentId trace flags part (#49162)

3 years agoFix inverted active issues (#49265)
Steve MacLean [Sat, 6 Mar 2021 22:10:29 +0000 (17:10 -0500)]
Fix inverted active issues (#49265)

3 years agoJIT: update non-null assertion prop to destructure VNs (#49238)
Andy Ayers [Sat, 6 Mar 2021 19:15:50 +0000 (11:15 -0800)]
JIT: update non-null assertion prop to destructure VNs (#49238)

In addition to checking for assertions based on the VN of an address, try and
destructure the VN to find the "base" address, and check its VNs as well.

This lets us get rid of some extra null checks, typically ones that are at
an offset from an existing non-null pointer.

Closes #49180.

3 years ago[AndroidCrypto] Implement DSA import/export and signing/verification. (#49153)
Jeremy Koritzinsky [Sat, 6 Mar 2021 11:58:54 +0000 (03:58 -0800)]
[AndroidCrypto] Implement DSA import/export and signing/verification. (#49153)

Co-authored-by: Jeremy Barton <jbarton@microsoft.com>
3 years agoAdd DataflowBlock.ReceiveAllAsync extension method (#37876)
Emmanuel André [Sat, 6 Mar 2021 11:56:24 +0000 (12:56 +0100)]
Add DataflowBlock.ReceiveAllAsync extension method (#37876)

3 years agoUpdate debug dump template after runfo update to include dumps (#49183)
Santiago Fernandez Madero [Sat, 6 Mar 2021 05:15:29 +0000 (21:15 -0800)]
Update debug dump template after runfo update to include dumps (#49183)

* Update debug dump template after runfo update to include dumps

* Fix workitem param and generate a dump command per dump found

* PR Feedback

3 years agoJIT: fix prejit entry PGO instrumentation (#49154)
Andy Ayers [Sat, 6 Mar 2021 02:49:34 +0000 (18:49 -0800)]
JIT: fix prejit entry PGO instrumentation (#49154)

Don't assume the entry block is `fgFirstBB`. Make sure to put the
entry probe in the scratch bb.

Closes #49108.

3 years agoMove scenario to float (#49255)
Drew Scoggins [Sat, 6 Mar 2021 01:39:30 +0000 (17:39 -0800)]
Move scenario to float (#49255)

* Remove version parsing

* Remove version macro from yml file

3 years agoAdd pip upgrade step inside venv to fix crypto issue (#49250)
Drew Scoggins [Fri, 5 Mar 2021 23:12:06 +0000 (15:12 -0800)]
Add pip upgrade step inside venv to fix crypto issue (#49250)

3 years agoDo not create R2R in memory hashes if profiler is not present or hasn't added types...
David Mason [Fri, 5 Mar 2021 23:04:56 +0000 (15:04 -0800)]
Do not create R2R in memory hashes if profiler is not present or hasn't added types (#49177)

* only create lazy map if profiler added types

* also don't create for ApplyMetadata if they haven't added new types

* add check to skip call if no profiler was called

* Update src/coreclr/vm/ceeload.cpp

Co-authored-by: Brian Robbins <brianrob@microsoft.com>
Co-authored-by: Brian Robbins <brianrob@microsoft.com>
3 years ago[AndroidCrypto] Implement IExportPal for X509 certs (#49196)
Elinor Fung [Fri, 5 Mar 2021 22:55:26 +0000 (14:55 -0800)]
[AndroidCrypto] Implement IExportPal for X509 certs (#49196)

3 years agoAllow using SupportedOSPlatform, UnsupportedOSPlatform attributes on interfaces ...
Buyaa Namnan [Fri, 5 Mar 2021 22:38:08 +0000 (14:38 -0800)]
Allow using SupportedOSPlatform, UnsupportedOSPlatform attributes on interfaces  (#48838)

* Allow OSPlatform attributes for interfaces

3 years agoSerialize Dns async-over-sync requests for the same host (#49171)
Stephen Toub [Fri, 5 Mar 2021 21:15:30 +0000 (16:15 -0500)]
Serialize Dns async-over-sync requests for the same host (#49171)

* Serialize Dns async-over-sync requests for the same host

* Update src/libraries/System.Net.NameResolution/src/System/Net/Dns.cs

3 years agoCapture Reverse P/Invoke frame offset in x86 GC info and disallow return hijacking...
Jeremy Koritzinsky [Fri, 5 Mar 2021 21:05:32 +0000 (13:05 -0800)]
Capture Reverse P/Invoke frame offset in x86 GC info and disallow return hijacking of reverse P/Invokes on x86. (#49066)

* Capture Reverse P/Invoke frame offset in x86 GC info and disallow return hijacking of reverse P/Invokes on x86.

* Check reverse p/invoke frame in exception handling.

* Fix formatting.

* Change sentinel values since 0 is a valid offset for the reverse P/Invoke frame variable.

* Fix decoding setting flip to actually flip the new sentinel values.

3 years ago[AndroidCrypto] Make RC2 transform explicitly throw PlatformNotSupportedException...
Elinor Fung [Fri, 5 Mar 2021 20:53:53 +0000 (12:53 -0800)]
[AndroidCrypto] Make RC2 transform explicitly throw PlatformNotSupportedException (#49195)

3 years agoRemove the exclusion for a fixed test. (#49223)
Sergey Andreenko [Fri, 5 Mar 2021 17:52:49 +0000 (09:52 -0800)]
Remove the exclusion for a fixed test. (#49223)

3 years agoDisable IsAtLeastLibgdiplus6 for Apple Silicon (#49173)
Steve MacLean [Fri, 5 Mar 2021 17:52:06 +0000 (12:52 -0500)]
Disable IsAtLeastLibgdiplus6 for Apple Silicon (#49173)

* Disable IsAtLeastLibgdiplus6 if !IsDrawingSupported

* PR feedback

3 years agoFix code coverage instrumentation and representation (#49181)
Viktor Hofer [Fri, 5 Mar 2021 17:42:25 +0000 (18:42 +0100)]
Fix code coverage instrumentation and representation (#49181)

When upgrading to the 6.0 SDK, the "dotnet tool run" command doesn't
work anymore with passing in arguments. Instead using the short form
which is just dotnet <tool>. Also disabling code coverage collection for
.NETFramework as it isn't supported.

3 years agoFix stress apple arm64 assertion '(thisFieldOffset + EA_SIZE_IN_BYTES(attr)) <= areaS...
Sergey Andreenko [Fri, 5 Mar 2021 16:22:20 +0000 (08:22 -0800)]
Fix stress apple arm64 assertion '(thisFieldOffset + EA_SIZE_IN_BYTES(attr)) <= areaSize' (#48936)

* Fix a stress Arm64 apple issue.

* fix issue.

3 years ago[main] Update dependencies from dotnet/llvm-project (#49208)
dotnet-maestro[bot] [Fri, 5 Mar 2021 16:10:21 +0000 (17:10 +0100)]
[main] Update dependencies from dotnet/llvm-project (#49208)

runtime.win-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools , runtime.win-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk , runtime.osx.10.12-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools , runtime.osx.10.12-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk , runtime.linux-arm64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk , runtime.linux-arm64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools , runtime.linux-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk , runtime.linux-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools
 From Version 9.0.1-alpha.1.21151.1 -> To Version 9.0.1-alpha.1.21154.1

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
3 years agoDelete unused define (#49190)
Jan Kotas [Fri, 5 Mar 2021 16:08:37 +0000 (08:08 -0800)]
Delete unused define (#49190)

3 years agoFix nullable attributes on ProcessStartInfo (#49175)
Stephen Toub [Fri, 5 Mar 2021 15:56:55 +0000 (10:56 -0500)]
Fix nullable attributes on ProcessStartInfo (#49175)

3 years agoAdd debugger attributes for PriorityQueue (#49188)
Stephen Toub [Fri, 5 Mar 2021 15:55:56 +0000 (10:55 -0500)]
Add debugger attributes for PriorityQueue (#49188)

3 years agoAdd Memory Overrides to Streams (#47125)
Newell Clark [Fri, 5 Mar 2021 15:36:31 +0000 (10:36 -0500)]
Add Memory Overrides to Streams (#47125)

* System.IO.Compression.DeflateStream.CopyToStream

-Implemented memory-based WriteAsync in DeflateStream.CopyToStream class.

This required implementing a memory-based overload of System.IO.Inflater.SetInput(). Previously, Inflater used a GCHandle to pin the array that was passed into SetInput. I converted it to use a MemoryHandle, and changed the array-based overload of SetInput to delegate to the new Memory-based overload.

* Implement suggested changes

* Memorify RequestStream

- Memory overrides for System.Net.RequestStream
- Memory overrides for System.Net.NetworkStreamWrapper

* Spanified ChunkedMemoryStream

WriteAsync is implemented in terms of Write, so I went ahead and implemented Write(ReadOnlySpan<byte>).
For some reason, AsSpan() isn't available in this file.

* Apply suggested changes

* Apply suggestions from code review

Co-authored-by: Adam Sitnik <adam.sitnik@gmail.com>
3 years agoFix nullable annotations on TraceSource/Listener (#49176)
Stephen Toub [Fri, 5 Mar 2021 15:10:55 +0000 (10:10 -0500)]
Fix nullable annotations on TraceSource/Listener (#49176)

3 years agoMisc PriorityQueue fixes (#48539)
Eirik Tsarpalis [Fri, 5 Mar 2021 14:13:37 +0000 (14:13 +0000)]
Misc PriorityQueue fixes (#48539)

* PriorityQueue fixes

* add missing enumerator invalidations

* Update src/libraries/System.Collections/src/System/Collections/Generic/PriorityQueue.cs

Co-authored-by: Stephen Toub <stoub@microsoft.com>
* add Debug assertion for heap arity

* presize buffer if EnqueueRange input is ICollection

* move capacity check outside of the core Grow method

* remove ICollection detection from EnumerableHelpers

* address feedback

Co-authored-by: Stephen Toub <stoub@microsoft.com>
3 years agoMonoAOTCompiler.cs: Correctly handle relative path for assembly to (#49178)
Ankit Jain [Fri, 5 Mar 2021 04:46:24 +0000 (23:46 -0500)]
MonoAOTCompiler.cs: Correctly handle relative path for assembly to (#49178)

.. precompile.

3 years agoJIT: profile updates for finally optimizations (#49139)
Andy Ayers [Fri, 5 Mar 2021 04:09:43 +0000 (20:09 -0800)]
JIT: profile updates for finally optimizations (#49139)

Update `impImportLeave` to propagate IBC counts to new blocks.

Fix profile weights during callfinally chain merging.

Scale profile weights for cloned finallys. Choose the continuation path based
on profile weight. Make sure to keep handler entry hot.

Partial fix for #48925.

3 years agoRemove StructWithPublicDefaultConstructor test (#49133)
Eric Erhardt [Fri, 5 Mar 2021 03:55:45 +0000 (21:55 -0600)]
Remove StructWithPublicDefaultConstructor test (#49133)

Commenting out this test until the C# language feature is implemented. This allows us to ship the DI Specification tests without shipping the TestStructs project.

Contributes to #49069

3 years agoAdd current-dns-lookups counter to System.Net.NameResolution (#49146)
Stephen Toub [Fri, 5 Mar 2021 03:32:41 +0000 (22:32 -0500)]
Add current-dns-lookups counter to System.Net.NameResolution (#49146)

3 years ago[AndroidCrypto] Consume RSA implementation in X509 certs (#49151)
Elinor Fung [Fri, 5 Mar 2021 03:09:37 +0000 (19:09 -0800)]
[AndroidCrypto] Consume RSA implementation in X509 certs (#49151)

3 years ago[wasm] Silence remaining warnings (#49170)
Larry Ewing [Fri, 5 Mar 2021 02:58:06 +0000 (20:58 -0600)]
[wasm] Silence remaining warnings (#49170)

* [wasm] Silence remaining warnings

* enable -Werror in CI

3 years agoDotnet pgo phase2 (#49087)
David Wrighton [Fri, 5 Mar 2021 02:08:48 +0000 (18:08 -0800)]
Dotnet pgo phase2 (#49087)

- Add merge command as designed earlier
  - Add new typesystem variant that works based exclusively on the typerefs in existing mibc files and can operate without references to implementation binaries
  - Re-use ibc reader/merger from crossgen2 codebase
- Increase usability of the tool
  - Set default verbosity to normal
  - Normal verbosity prints a relatively limited amount of output

3 years ago[wasm] Use timezone abbreviations as fallback if full names don't exist (#45385)
Tammy Qiu [Fri, 5 Mar 2021 01:54:15 +0000 (20:54 -0500)]
[wasm] Use timezone abbreviations as fallback if full names don't exist (#45385)

* use unix ver of GetDisplayName instead of invariant display name

* Add tests for Daylight Names

* Use tz abbreviations as fallback for browser cases, added test cases, fixed regex

* Move abbrev fields to TimeZoneInfo.Unix.cs

* [wasm] If standard, or daylight names are not available, then fallback

.. to abbreviations.

[This code](https://github.com/dotnet/runtime/blob/master/src/libraries/System.Private.CoreLib/src/System/TimeZoneInfo.GetDisplayName.cs#L29-L40) seems to return `true` result, even though `timeZoneDisplayName` is null/empty. So, in such a case don't set the out var
and let the abbrev get used as the fallback (like it already says in the
comment).

* add additional platform tests

* edit displayname test

Co-authored-by: Ankit Jain <radical@gmail.com>
3 years agoApple Silicon platform detection (#49155)
Steve MacLean [Thu, 4 Mar 2021 22:28:07 +0000 (17:28 -0500)]
Apple Silicon platform detection (#49155)

* Add Apple Silicon PlatformDetection

* Disable OSVersion_ValidVersion_OSX on Apple Silicon

* Update docs

3 years agoAdd null-check in AdjustContextForVirtualStub for ARM64 (#49147)
Kevin Gosse [Thu, 4 Mar 2021 21:35:28 +0000 (22:35 +0100)]
Add null-check in AdjustContextForVirtualStub for ARM64 (#49147)

3 years ago[main] Update dependencies from dotnet/xharness (#49125)
dotnet-maestro[bot] [Thu, 4 Mar 2021 21:04:05 +0000 (21:04 +0000)]
[main] Update dependencies from dotnet/xharness (#49125)

[main] Update dependencies from dotnet/xharness

 - [wasm] Update functional tests to xharness change in  dotnet/xharness#492

`xharness wasm test-browser` ignored `--expected-exit-code` before, but
the xharness PR added that option. So, the code here needs to be updated
to pass the exit code along as is.

3 years agoAdd quotes around the python command (#49148)
Brian Sullivan [Thu, 4 Mar 2021 21:03:34 +0000 (13:03 -0800)]
Add quotes around the python command (#49148)

Fixes an error with there is a space in the python path

3 years agoAdd Vector conversion to PointF/SizeF/RectangleF (#48547)
Jeremy Kuhne [Thu, 4 Mar 2021 19:00:22 +0000 (11:00 -0800)]
Add Vector conversion to PointF/SizeF/RectangleF (#48547)

Implements part of #47940 to allow conversion between `Vector2` and `PointF` / `SizeF` and between `Vector4` and `RectangleF`.

3 years agoPort System.IO.Pipelines docs (#49118)
Eric StJohn [Thu, 4 Mar 2021 18:53:09 +0000 (10:53 -0800)]
Port System.IO.Pipelines docs (#49118)

* Port System.IO.Pipelines docs

* Clean up issues from the docs porting tool.

3 years ago[AndroidCrypto] Fix IncrementalHash.GetCurrentHash
Elinor Fung [Thu, 4 Mar 2021 18:04:11 +0000 (10:04 -0800)]
[AndroidCrypto] Fix IncrementalHash.GetCurrentHash

Fix incremental hash with MessageDigest

The underlying provider throws when cloning the digest for an HMAC, so disable the GetCurrentHash tests for HMAC.

3 years agoAdd a test to verify current behavior of floating point (#48438)
David Wrighton [Thu, 4 Mar 2021 17:38:30 +0000 (09:38 -0800)]
Add a test to verify current behavior of floating point (#48438)

The behavior of floating point to integer conversions outside of the valid range is not consistent today from platform to platform.

This test codifies the existing behavior, so that at the very least, any changes are understood.

As a summary, arm64 follows what is described as the saturating model, x86/x64 follow a model where 32/64 bit signed conversions have sentinel behavior (where NaN and out of range values are set to minint), and the unsigned conversion is performed via the signed 64bit conversion. And finally arm32 follows a model where 32bit operations are saturating, but 64bit conversions are defined in terms of the CRT 64 bit int signed conversion, which is defined based on the CRT 64 unsigned int conversion.

Implementations are provided in both C++ and C# using only standardized defined behavior. Both C++ and C# are used in order to detect cases where one or the other does not correctly implement conversions over the defined range.

3 years agoFix HttpClientHandler_ServerCertificates_Test (#49130)
Anton Firszov [Thu, 4 Mar 2021 16:52:44 +0000 (17:52 +0100)]
Fix HttpClientHandler_ServerCertificates_Test (#49130)

3 years agoMove method_to_dyn_method from MonoDomain to sre.c, add accessors. (#49126)
Zoltan Varga [Thu, 4 Mar 2021 15:52:38 +0000 (10:52 -0500)]
Move method_to_dyn_method from MonoDomain to sre.c, add accessors. (#49126)

3 years agoAdd nullable annotations to System.DirectoryServices (#48454)
Krzysztof Wicher [Thu, 4 Mar 2021 12:38:44 +0000 (13:38 +0100)]
Add nullable annotations to System.DirectoryServices (#48454)

* Add nullable annotations to System.DirectoryServices

* apply PR feedback

* Fix nullability of classes deriving from CollectionBase

3 years agoOverride WriteAsync in StreamPipeWriter (#49098)
David Fowler [Thu, 4 Mar 2021 10:51:07 +0000 (02:51 -0800)]
Override WriteAsync in StreamPipeWriter (#49098)

3 years agoDon't use the CoercedConstantValue value as the key, when we have a reloc (#49029)
Brian Sullivan [Thu, 4 Mar 2021 07:58:56 +0000 (23:58 -0800)]
Don't use the CoercedConstantValue value as the key, when we have a reloc (#49029)

* Don't use the CoercedConstantValue value as the key, when we have a reloc

* Code review feedback and added comments clarifying the behavior when isSharedConst is true.

3 years agoAdd Matrix3x2 transform methods (#48195)
Jeremy Kuhne [Thu, 4 Mar 2021 06:44:59 +0000 (22:44 -0800)]
Add Matrix3x2 transform methods (#48195)

* Add Matrix3x2 transform methods

This implements #47940 for System.Drawing.Common.

* Move GdipGetWorldTransform into try block.

* Fix build issues

* Add workaround to nuget issue

Co-authored-by: Santiago Fernandez Madero <safern@microsoft.com>
3 years agoFix SIMD12 assert when passing on stack on x64 Unix, arm64 Unix/Windows. (#49101)
Sergey Andreenko [Thu, 4 Mar 2021 05:40:15 +0000 (21:40 -0800)]
Fix SIMD12 assert when passing on stack on x64 Unix, arm64 Unix/Windows. (#49101)

* Fix the assert.

* Add a repro test.

* formatting

3 years agoFix DacTableGen build on Windows ARM64 (#49093)
Anton Lapounov [Thu, 4 Mar 2021 04:13:29 +0000 (20:13 -0800)]
Fix DacTableGen build on Windows ARM64 (#49093)

3 years agoFixup hot reload (#49099)
Aleksey Kliger (λgeek) [Thu, 4 Mar 2021 02:08:22 +0000 (21:08 -0500)]
Fixup hot reload (#49099)

Logic collision between e2fde0bd626e7556965f565ba17368b75d49e3c4 and e42b687ad5f3a7809b819ff86dd4e5d1909fb9a7

3 years agoDisable trimming on ConfigurationManager (#49085)
Eric Erhardt [Thu, 4 Mar 2021 02:04:12 +0000 (20:04 -0600)]
Disable trimming on ConfigurationManager (#49085)

Contributes to #49062

3 years agoRevert async nameresolution on Unix (#48666)
Günther Foidl [Thu, 4 Mar 2021 02:02:16 +0000 (03:02 +0100)]
Revert async nameresolution on Unix (#48666)

* Revert "NameResolutionPal.Unix: fixed loss of address family information in async lookup (#47171)"

This reverts commit 2f2593177dafbe702407fe0b7ac156a7829b7ee6.

* Revert "NameResolutionPal.Unix enabled async name resolution (#34633)"

This reverts commit f4ae9059426a942c5172c68ec7e7460178d87cf3.

* Fixed unreachable code bug

SupportsGetAddrInfoAsync is a constant on *nix. Tests check if it's supported and return if not, so unreachable code was created on *nix.

* Restored warning CS0162

3 years agoRevert "Use llvm-objcopy on Linux x64 (#48444)" (#49092)
Jan Kotas [Thu, 4 Mar 2021 01:55:53 +0000 (17:55 -0800)]
Revert "Use llvm-objcopy on Linux x64 (#48444)" (#49092)

This reverts commit ba50840433578d97de4ad8bb9d2a2b45e7455b30.

3 years agoRemove more domain code (#49047)
Zoltan Varga [Thu, 4 Mar 2021 00:53:13 +0000 (19:53 -0500)]
Remove more domain code (#49047)

* Remove mono_domain_ambient_memory_manager (), add mono_mem_manager_get_ambient () instead to get rid of a few domain references.

* Remove 'domain' argument from mono_thread_create_internal ().

* Remove domains from the metadata update code.

* Remove unused domain->env hash table. Also remove unused MONO_DOMAIN_FIRST_GC_TRACKED/LAST_GC_TRACKED.

* Remove more unused fields from MonoDomain.

* Remove context static field support.

* Move more fields out of MonoDomain.

* Move jit info tables out of MonoDomain.

* Move jit_code_hash from MonoDomain to MonoJitMemoryManager.

* Move special_static_fields from MonoDomain to MonoMemoryManager.

* Move entry_assembly to runtime.c, add accessors.

3 years agoFix delete ref for RSA private key spec (#49079)
Elinor Fung [Thu, 4 Mar 2021 00:49:56 +0000 (16:49 -0800)]
Fix delete ref for RSA private key spec (#49079)

3 years agoMisc createdump fixes (#49038)
Mike McLaughlin [Thu, 4 Mar 2021 00:06:19 +0000 (16:06 -0800)]
Misc createdump fixes (#49038)

* Misc createdump fixes

* Fixed issue https://github.com/dotnet/runtime/issues/42589

* Code review feedback

3 years ago[main] Update dependencies from dotnet/arcade dotnet/xharness (#49056)
dotnet-maestro[bot] [Wed, 3 Mar 2021 22:06:36 +0000 (22:06 +0000)]
[main] Update dependencies from dotnet/arcade dotnet/xharness (#49056)

[main] Update dependencies from dotnet/arcade dotnet/xharness

 - re-add workaround for publishing disk space issues

 - Just revert all changes to the publish-using-darc script

3 years agoRemove unnecessary references to System.ComponentModel.TypeConverter (#49068)
Eric Erhardt [Wed, 3 Mar 2021 21:45:11 +0000 (15:45 -0600)]
Remove unnecessary references to System.ComponentModel.TypeConverter (#49068)

These references don't appear to be needed, so I removed them.

3 years agoDisable RC2 tests on Android. (#49024)
Jeremy Koritzinsky [Wed, 3 Mar 2021 21:06:36 +0000 (13:06 -0800)]
Disable RC2 tests on Android.  (#49024)

* Disable RC2 tests on Android. RC2 isn't supported by Android.

* Use PlatformSpecific attribute instead of SkipOnMono.

* Skip key file tests that use RC2 encryption on Android

* Use ConditionalFact instead of PlatformSpecific.

* Reorganize usings and fix build failure.

* Add RC2Provider.cs to OpenSSL tests to fill in the RC2Factory type.

* Fix windows build.

3 years agoUse unknown placeholder for collectible class typehandle (#48707)
Andy Ayers [Wed, 3 Mar 2021 19:58:42 +0000 (11:58 -0800)]
Use unknown placeholder for collectible class typehandle (#48707)

instead of null, so that we won't over-estimate likelihood of other types at a
call site where we see both collectible and non-collectible types.

Addresses part of #48549.

3 years agoDon't box every single value type dictionary key. (#46460)
Ispiriants Artur [Wed, 3 Mar 2021 19:56:55 +0000 (21:56 +0200)]
Don't box every single value type dictionary key. (#46460)

During slow path deserialization fallback to storing dictionary key
as object only when Read returns false.

3 years agoNew tests that JsonIncludeAttribute and JsonNumberHandlingAttribute are honored durin...
Sychev Vadim [Wed, 3 Mar 2021 19:47:12 +0000 (22:47 +0300)]
New tests that JsonIncludeAttribute and JsonNumberHandlingAttribute are honored during deserialization (#47904)

* New test that JsonIncludeAttribute is honored during deserialization

ArgumentDeserialization_Honors_JsonInclude test is added #47855

* New test that JsonNumberHandlingAttribute is honored during deserialization

ArgumentDeserialization_Honors_JsonNumberHandling test is added #47855

* Extended Point_MembersHave_JsonInclude class for variety of test cases

Added new lines

3 years ago[sdb] Add MODULE_APPLY_CHANGES command for hot reload (#49043)
Aleksey Kliger (λgeek) [Wed, 3 Mar 2021 19:46:32 +0000 (14:46 -0500)]
[sdb] Add MODULE_APPLY_CHANGES command for hot reload (#49043)

3 years agoIntPtr and UIntPtr were added as DisallowedTypes (#47899)
Sychev Vadim [Wed, 3 Mar 2021 19:39:04 +0000 (22:39 +0300)]
IntPtr and UIntPtr were added as DisallowedTypes (#47899)

* IntPtr and UIntPtr were added as DisallowedTypes

NotSupportedException is fired when IntPtr/UIntPtr is being serialized/deserialized

* Returned typeof(T) calls back

3 years agoFix SPMI replay with JitStress. (#49045)
Sergey Andreenko [Wed, 3 Mar 2021 19:36:12 +0000 (11:36 -0800)]
Fix SPMI replay with JitStress. (#49045)

3 years ago Set default features flags to match to Android SDK defaults (#49005)
Maxim Lipnin [Wed, 3 Mar 2021 19:29:41 +0000 (22:29 +0300)]
 Set default features flags to match to Android SDK defaults (#49005)

Contributes to #43865.

Based on https://github.com/xamarin/xamarin-android/blob/master/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.DefaultProperties.targets#L64-L76

3 years ago[AndroidCrypto] Fix up RSA and some EC tests (#48930)
Jeremy Koritzinsky [Wed, 3 Mar 2021 18:55:02 +0000 (10:55 -0800)]
[AndroidCrypto] Fix up RSA and some EC tests (#48930)

Co-authored-by: Jeremy Barton <jbarton@microsoft.com>
3 years agoMono: Cleanup dead code from w32socket.h (#49061)
Alexander Köplinger [Wed, 3 Mar 2021 18:24:39 +0000 (19:24 +0100)]
Mono: Cleanup dead code from w32socket.h (#49061)

3 years agoDisable binplacing for DependencyInjection.Specification.Tests (#49067)
Eric StJohn [Wed, 3 Mar 2021 18:22:17 +0000 (10:22 -0800)]
Disable binplacing for DependencyInjection.Specification.Tests (#49067)

3 years agoDisable ParallelCrash tests for OSX (#49041)
Bruce Forstall [Wed, 3 Mar 2021 18:00:53 +0000 (10:00 -0800)]
Disable ParallelCrash tests for OSX (#49041)

Tracking issue: #47096

3 years agoFix isByteReg() assert for x86 (#48830)
Kunal Pathak [Wed, 3 Mar 2021 17:16:12 +0000 (09:16 -0800)]
Fix isByteReg() assert for x86 (#48830)

* [Windows x86] Fix isByteReg() assert

The change is similar to the one done in https://github.com/dotnet/runtime/pull/46567. If the type if `BYTE`, the use byte regs.

Fixes the following failures:

https://helixre8s23ayyeko0k025g8.blob.core.windows.net/dotnet-runtime-refs-pull-47307-head-c9ab37658a344842be/System.Linq.Queryable.Tests/console.2ce37104.log?sv=2019-07-07&se=2021-03-10T08%3A39%3A45Z&sr=c&sp=rl&sig=GdS1KlEkJHVcKz7lwpZeszudWYokZpr%2Bt7IGv4c61co%3D

https://helixre8s23ayyeko0k025g8.blob.core.windows.net/dotnet-runtime-refs-pull-47307-head-c9ab37658a344842be/System.Linq.Tests/console.4bc4fd10.log?sv=2019-07-07&se=2021-03-10T08%3A39%3A45Z&sr=c&sp=rl&sig=GdS1KlEkJHVcKz7lwpZeszudWYokZpr%2Bt7IGv4c61co%3D

* add an assert in allRegs()

* Revert "add an assert in allRegs()"

This reverts commit 91d9602556a06ee7e480e2730b3802ccde560ebe.

3 years agoAdd ArrayPool event for dropped buffers (#49031)
Stephen Toub [Wed, 3 Mar 2021 16:57:25 +0000 (11:57 -0500)]
Add ArrayPool event for dropped buffers (#49031)

* Add ArrayPool event for dropped buffers

* Address PR feedback

3 years ago[mono][debugger] Fix debugger to work without value on frame->de.domain (#49039)
Thays Grazia [Wed, 3 Mar 2021 16:01:39 +0000 (13:01 -0300)]
[mono][debugger] Fix debugger to work without value on frame->de.domain (#49039)

* Fix debugger.

* Removing unused change

* Fixed what @lambdageek suggested

* Changing what was suggested by @vargaz.

3 years agoUse MemoryExtensions.LastIndexOf in ReThrowWithPath (#48650)
Stephen Toub [Wed, 3 Mar 2021 15:28:31 +0000 (10:28 -0500)]
Use MemoryExtensions.LastIndexOf in ReThrowWithPath (#48650)

Enable string.LastIndexOf (and some of the other StringComparison paths) to be trimmed in a default Blazor wasm app, and don't require an ICU fallback as only ordinal is required here.

3 years agoHostWriter Performance Improvements (#48774)
Brian Robbins [Wed, 3 Mar 2021 15:06:19 +0000 (07:06 -0800)]
HostWriter Performance Improvements (#48774)

3 years agoFixes for building ARM64 Mac Catalyst test apps (#49032)
Jo Shields [Wed, 3 Mar 2021 13:46:29 +0000 (08:46 -0500)]
Fixes for building ARM64 Mac Catalyst test apps (#49032)

* Fix building tests on ARM64 macOS

* Specify a bi-arch value for CMAKE_OSX_ARCHITECTURES for Catalyst builds

If we don't specify CMAKE_OSX_ARCHITECTURES=arm64, we can't build Mac
Catalyst tests on Intel (or on Apple Silicon w/ Intel builds of dotnet).
Just specify both arches as valid, CMake should take it from here and
generate an .xcodeproj where both arches are valid, then we just build
the relevant one to make our final test executable.

* CMAKE_OSX_ARCHITECTURES must be arm64 not arm64e. Unify.

3 years ago[wasm][debugger] Add resolved assemblies to cache to help mono.cecil find them (...
Thays Grazia [Wed, 3 Mar 2021 13:32:45 +0000 (10:32 -0300)]
[wasm][debugger] Add resolved assemblies to cache to help mono.cecil find them (#48920)

* Fix loading assembly with type with an attribute with enum from other library

* Update src/mono/wasm/debugger/BrowserDebugProxy/DebugStore.cs

Co-authored-by: Larry Ewing <lewing@microsoft.com>
* Adding test case

* Fix @lewing suggestion

* Add copyright notice

Co-authored-by: Richard Davies <rathga@gmail.com>
* Removing unused includes, change test name.

* Changing what @radical suggested

* Update src/mono/wasm/debugger/BrowserDebugProxy/DebugStore.cs

Co-authored-by: Ankit Jain <radical@gmail.com>
Co-authored-by: Larry Ewing <lewing@microsoft.com>
Co-authored-by: Richard Davies <rathga@gmail.com>
Co-authored-by: Ankit Jain <radical@gmail.com>
3 years agoDon't default PackageVersion for NuGet Pack task generated packages (#49053)
Viktor Hofer [Wed, 3 Mar 2021 13:26:47 +0000 (14:26 +0100)]
Don't default PackageVersion for NuGet Pack task generated packages (#49053)

Specifying a default PackageVersion causes Arcade's calculated
Version not be used and instead the VersionSuffix-less Version be used
which indicates a stable packages. That later fails during publishing to
a non stable feed.

This is a mitigation for the official build breaks and a better
implementation that supports not reving the patch major during servicing
needs to be figured out.

3 years agoRemove unused Volatile icalls. (#49050)
Zoltan Varga [Wed, 3 Mar 2021 11:32:44 +0000 (06:32 -0500)]
Remove unused Volatile icalls. (#49050)

3 years agoOptimize asm size for the biggest corelib method - WebUtility..cctor (#48906)
Egor Bogatov [Wed, 3 Mar 2021 08:24:05 +0000 (11:24 +0300)]
Optimize asm size for the biggest corelib method - WebUtility..cctor (#48906)

3 years ago[main] Update dependencies from dotnet/xharness (#49016)
dotnet-maestro[bot] [Wed, 3 Mar 2021 08:01:23 +0000 (08:01 +0000)]
[main] Update dependencies from dotnet/xharness (#49016)

[main] Update dependencies from dotnet/xharness

3 years ago[mono] update readme.md to run sample (#49034)
Thays Grazia [Wed, 3 Mar 2021 08:01:00 +0000 (05:01 -0300)]
[mono] update readme.md to run sample (#49034)

run-sample does not exist anymore in makefile

3 years agoFix majority of failures in libraries-jitstressregs after EHWriteThru enabled (#48829)
Kunal Pathak [Wed, 3 Mar 2021 05:33:38 +0000 (21:33 -0800)]
Fix majority of failures in libraries-jitstressregs after EHWriteThru enabled (#48829)

* Fix majority of libraries-jitstressregs

When we verify final allocation, we were not resetting the `assignedInterval` if the interval got assigned to a different register. This was not consistent to what we do during allocation.

Fixed following failures:

https://dev.azure.com/dnceng/public/_build/results?buildId=989595&view=ms.vss-test-web.build-test-results-tab&runId=30998546&resultId=169282&paneView=dotnet-dnceng.dnceng-build-release-tasks.helix-test-information-tab

https://helixre8s23ayyeko0k025g8.blob.core.windows.net/dotnet-runtime-refs-pull-47307-head-5f85fedec0cd4ff9a0/System.Net.Security.Tests/console.73e69194.log?sv=2019-07-07&se=2021-03-03T08%3A52%3A21Z&sr=c&sp=rl&sig=naQOrM%2BszKDyDAO8m%2BU%2Fu149f4cjodTk1dYCKl9cvKs%3D

Failures happen on arch/OS
- Linux arm64
- Linux arm
- Linux x64
- Windows x86
- Windows x64

* Delete regsToFree and delayRegsToFree from verifyFinalAllocation

These two variables were always set to `RBM_NONE`. As part of https://github.com/dotnet/runtime/issues/48837, investigate how to reintroduce them.

* jitformat

3 years agoEmbedding dac and other debugging resources into singlefilehost (#49033)
Vladimir Sadov [Wed, 3 Mar 2021 05:16:30 +0000 (21:16 -0800)]
Embedding dac and other debugging resources into singlefilehost (#49033)

* Embedding dac and other debugging resources into singlefilehost

* Embed DAC later, when it had a chance to be signed.

* MINIDUMP_EMBEDDED_AUXILIARY_PROVIDER

Co-authored-by: Juan Hoyos <juan.hoyos@microsoft.com>
* fix for cross builds

Co-authored-by: Juan Hoyos <juan.hoyos@microsoft.com>
3 years agoFix issue where resolution move would overwrite the source of operand of JCMP (#48833)
Kunal Pathak [Wed, 3 Mar 2021 03:38:16 +0000 (19:38 -0800)]
Fix issue where resolution move would overwrite the source of operand of JCMP (#48833)

* [Windows/Linux arm4] Fix issue where resolution move would overwrite JCMP

We were overwritting a register with resolution move which was the source of the operand used for JCMP. Special case it to also check if that is the case and filter out such registers from getting resolution done.

Fixes following failures:

https://helixre8s23ayyeko0k025g8.blob.core.windows.net/dotnet-runtime-refs-pull-47307-head-929ed24b5ccf4bf2b0/System.Linq.Parallel.Tests/console.89614fbb.log?sv=2019-07-07&se=2021-03-15T02%3A39%3A50Z&sr=c&sp=rl&sig=mHbQ6BCU%2BLYjzTmsd9DRDTMHtSP5LsCDsZpwjhqvgn4%3D

https://helixre8s23ayyeko0k025g8.blob.core.windows.net/dotnet-runtime-refs-pull-47307-head-929ed24b5ccf4bf2b0/System.Threading.Channels.Tests/console.64cd2de3.log?sv=2019-07-07&se=2021-03-15T02%3A39%3A50Z&sr=c&sp=rl&sig=mHbQ6BCU%2BLYjzTmsd9DRDTMHtSP5LsCDsZpwjhqvgn4%3D

* rename variable and add comments

* jit format

3 years ago[AndroidCrypto] Consume ECC implementation in X509 certs (#49027)
Elinor Fung [Wed, 3 Mar 2021 02:59:19 +0000 (18:59 -0800)]
[AndroidCrypto] Consume ECC implementation in X509 certs (#49027)

3 years agoAllow libraries outerloop OSX_arm64 to be triggered from PR (#49018)
Steve MacLean [Tue, 2 Mar 2021 23:39:31 +0000 (18:39 -0500)]
Allow libraries outerloop OSX_arm64 to be triggered from PR (#49018)

3 years agoRemove Deterministic setting which is already the default (#49021)
Viktor Hofer [Tue, 2 Mar 2021 23:03:11 +0000 (00:03 +0100)]
Remove Deterministic setting which is already the default (#49021)

The SDK already enables deterministic builds by default. No need to set this property again.

3 years agoIncrease jitstress job run frequency (#49020)
Bruce Forstall [Tue, 2 Mar 2021 22:33:06 +0000 (14:33 -0800)]
Increase jitstress job run frequency (#49020)

Change #41856 reduced stress job frequency to once per day, alternating
between main and the release branches. However, the release branches
get few changes yet still run the job. (Also, all the release branches
run the job at the same time.)

Change to running the job daily in main, where most development
happens. Also change the runs to daily in the release branches, but
change to only run if the branch has changed since the last run.

3 years agoJIT: profile updates for return merges and tail calls (#48773)
Andy Ayers [Tue, 2 Mar 2021 22:03:01 +0000 (14:03 -0800)]
JIT: profile updates for return merges and tail calls (#48773)

Stop trying to update the common return block profile data during return
merging, as it is not yet known which return blocks will become tail calls.
Start updating constant return block profile data during return merging
as this is when we transform the flow.

Update the common return block profile data during return merging in
morph (adding more counts) and when creating tail calls (removing counts).

Update profile consistency checker to handle switches properly and to use
tolerant compares.

Add extra dumping when solving for edge weights or adjusting flow edge
weights to help track down where errors are coming from.

Add new FMT_WT formatting string for profile weights, and start using it
in fgprofile. Use %g so we don't see huge digit strings.

Handle constant return merges too.

Also fix dump output from `setEdgeWeights` and pass in the destination
of the edge.

Refactor `setBBProfileWeight` to also handle setting/clearing rarely run.

3 years agoRemove illink workaround (#49023)
Eric Erhardt [Tue, 2 Mar 2021 21:51:12 +0000 (15:51 -0600)]
Remove illink workaround (#49023)

System.ComponentModel.Annotations is now building NetCoreAppCurrent, just like any other library in the shared fx.