Tomas Weinfurt [Tue, 29 Jun 2021 06:50:32 +0000 (08:50 +0200)]
add System.Net.MsQuic.Transport as dependency for Windows build (#54851)
Sergey Andreenko [Mon, 28 Jun 2021 23:37:06 +0000 (16:37 -0700)]
Fix unreached during dump. (#54861)
Sergey Andreenko [Mon, 28 Jun 2021 22:33:32 +0000 (15:33 -0700)]
Fix lowering usage of an unset LSRA field. (#54731)
* Add repro.
* fix the issue.
* delete a dead condition
* add a todo.
* Fix the failures.
Juan Hoyos [Mon, 28 Jun 2021 21:33:51 +0000 (14:33 -0700)]
Fix setting breakpoints on AVX 256 instructions and other 32 byte immediate instructions (#54786)
Aaron Kunkle [Mon, 28 Jun 2021 21:24:57 +0000 (14:24 -0700)]
Add perf_slow yaml (#54853)
David Wrighton [Mon, 28 Jun 2021 20:10:56 +0000 (13:10 -0700)]
Faster type load for scenarios made more common by generic math (#54588)
Change interface map layout in two interesting ways
1. For interface maps defined in System.Private.CoreLib, rely on the C# compiler to prevent any ambiguous duplicates, and to find the full interface expansion, instead of expanding it within the type loader See code marked with #SpecialCorelibInterfaceExpansionAlgorithm
- Note that this optimization is only applied for ValueTypes as the presence of inheritance makes the optimization much more complex in many cases, and isn't needed.
- This optimization reduces the amount of parsing of the interface implementation table must be done for valuetypes in CoreLib. In particular, with the new interfaces that are added as part of #54650 there is a very deep interface hierarchy that requires a great deal of scanning. As those interfaces are added to all the primitive types, the impact on startup performance is significant and measurable.
2. For interface map expansion that follows the curiously recurring generic pattern, place the open instantiation of the type in the interface map instead of the the exact instantiation, and update all places in the runtime which consider the interface map to deal with that change (Mostly by adding special purpose logic to work with the special marker type in the interface map, but there is also logic to simply force the exact interface type to be loaded, when working with the partially loaded type is not quite good enough, or excessively complex)
- This optimization reduces the set of interface types that need to be loaded if they are unused. Of particular benefit are the numerous interfaces associated with the primitive types that are added as part of #54650.
Performance of launching an extremely simple .NET process (process with empty main method). Results acquired using local testing on my developer machine, using a simple script that launches the process 500 times in a row.
| Before #54650 | After #54650 | After #54650 and #54588 (this pr) |
| :-: | :-: | :-: |
| 14.1ms | 16.5ms |14.3ms |
Jeremy Koritzinsky [Mon, 28 Jun 2021 19:41:39 +0000 (12:41 -0700)]
Make sure we consider buffer length when marshalling back Unicode ByValTStr fields (#54695)
* Use string constructor that takes length instead of the one that searches for a null terminator.
Fixes #54662
* Marshal back buffer size or string to first null terminator, whichever is shorter
* Add tests.
* Add unicode test.
* Use the same implementation style for the wstr case case as the cstr case
* Fix accidental deletion from test.
Gleb Balykov [Mon, 28 Jun 2021 18:16:44 +0000 (21:16 +0300)]
Add YieldProcessor implementation for arm (#54829)
Larry Ewing [Mon, 28 Jun 2021 18:12:08 +0000 (13:12 -0500)]
Remove ActiveIssue for #50968 (#54831)
Larry Ewing [Mon, 28 Jun 2021 18:11:30 +0000 (13:11 -0500)]
Enable System.Text.Json tests for Wasm AOT (#54833)
Larry Ewing [Mon, 28 Jun 2021 18:04:55 +0000 (13:04 -0500)]
Remove ActiveIssue for #51723 (#54830)
Wei Zheng [Mon, 28 Jun 2021 17:51:46 +0000 (01:51 +0800)]
Fix load exception on generic covariant return type (#54790)
Kevin Jones [Mon, 28 Jun 2021 16:59:06 +0000 (12:59 -0400)]
Obsolete X509Certificate2.PrivateKey and PublicKey.Key. (#54562)
The two properties got different diagnostic IDs so that the messages could better reflect the caller recovery action.
Eric Erhardt [Mon, 28 Jun 2021 16:39:17 +0000 (10:39 -0600)]
First round of converting System.Drawing.Common to COMWrappers (#54636)
* First round of converting System.Drawing.Common to COMWrappers
Using COM Wrappers makes the library trim compatible.
* Add Trimming Test for Icon.Save
* Add support for OS specific trimming tests
* Use function pointers instead of delegates
* Rename Guid to IID
* Better interop to closely match the native side
* Release any COM pointer that was QueryInterface
* Use pointers instead of Marshal.PtrToStructure/StructureToPtr
* No need for a VTable struct, just set each function pointer right into the table
* Wrap all managed calls in try-catch and return HResult
* Use COM naming
* Fix method signature to use pointer instead of out.
* CheckStatus => ThrowExceptionForHR
* Pass -1 to Marshal.GetExceptionForHR so it doesn't query GetErrorInfo, and always returns the correct exception type
* Create the PictureWrapper with UniqueInstance, so it doesn't get cached. Caching it causes lifetime issues.
Jeremy Koritzinsky [Mon, 28 Jun 2021 16:32:11 +0000 (09:32 -0700)]
Fix alloc-dealloc mismatches (#54701)
Kevin Jones [Mon, 28 Jun 2021 15:55:27 +0000 (11:55 -0400)]
Add one-shot ECB methods
This change adds SymmetricAlgorithm.EncryptEcb, SymmetricAlgorithm.DecryptEcb, their
respective Try- and -Core methods, derived type implementations thereof, and tests.
There's an open question of should these members on on the base class throw or
"succeed if the Mode property is in agreement with the algorithm". While the latter is "nicer",
just throwing is easier to reason about, and that's the current behavior.
Co-authored-by: Jeremy Barton <jbarton@microsoft.com>
Maxim Lipnin [Mon, 28 Jun 2021 15:19:52 +0000 (18:19 +0300)]
[Mono] MSBuild Task housekeeping (#54485)
- added TargetFrameworkForNETCoreTasks property similar to NetCoreAppToolCurrent one as NetCoreAppToolCurrent will likely bump more aggressively between new sdks;
- renamed TargetFrameworkForNETFramework to TargetFrameworkForNETFrameworkTasks.
Steve Pfister [Mon, 28 Jun 2021 14:50:46 +0000 (10:50 -0400)]
Move iOS/tvOS simulator AOT imports in the Mono workload (#54821)
The condition on the import group for the iOS and tvOS simulators was not valid since iOS/tvOSSimulator is not a `TargetPlatformIdentifier`. To simplify, the simulator imports were moved under iOS/tvOS.
Fixes https://github.com/dotnet/runtime/issues/53427
Co-authored-by: Steve Pfister <steve.pfister@microsoft.com>
Stephen Toub [Mon, 28 Jun 2021 14:46:21 +0000 (10:46 -0400)]
Remove unnecessary char[] allocation from Uri.GetRelativeSerializationString (#54799)
Stephen Toub [Mon, 28 Jun 2021 14:42:53 +0000 (10:42 -0400)]
Reduce overhead of Enumerable.Chunk (#54782)
Avoid passing the array by ref and yielding inside the loop, which defeat various optimizations (e.g. bounds checking elimination).
Tom Deseyn [Mon, 28 Jun 2021 12:57:30 +0000 (14:57 +0200)]
Fix EnumMemberRefs always returning NULL (#54805)
Thays Grazia [Mon, 28 Jun 2021 12:44:05 +0000 (09:44 -0300)]
[mono][debugger] Insert and search seq_point in the same MonoJitMemoryManager (#54757)
* [mono][debugger] Fixing side effect of #48483
When starting XAML Hot Reload, in transform.c the seq_point was saved using jit_mm_for_method: https://github.com/thaystg/runtime/blob/
abccfadbf570033efee8ac9a6992f6f7ee51f474/src/mono/mono/mini/interp/transform.c#L9760
When trying to search was trying on get_default_jit_mm.
* Fixing everywhere that uses seq_points.
* Not used.
* Revert "Not used."
This reverts commit
fd7f2061b40436300abdcc919705b56af53f4ca0.
* Revert "Fixing everywhere that uses seq_points."
This reverts commit
6faffb8c92a1c9be17d8c53d5f735075b9212220.
* Revert "[mono][debugger] Fixing side effect of #48483"
This reverts commit
44601d310bd5ca1929604af5e0b96436b416ced8.
* Always use get_default_jit_mm for seq_points.
* Adding a test case and fixing wasm debugging on ALC.
* Moving implementation to avoid changing line number
* Update src/mono/wasm/debugger/DebuggerTestSuite/Tests.cs
Co-authored-by: Larry Ewing <lewing@microsoft.com>
* Update src/mono/wasm/debugger/DebuggerTestSuite/Tests.cs
Co-authored-by: Larry Ewing <lewing@microsoft.com>
Co-authored-by: Larry Ewing <lewing@microsoft.com>
Stephen Toub [Mon, 28 Jun 2021 08:31:45 +0000 (04:31 -0400)]
Avoid per-XmlSchemaValidator PositionInfo allocation (#54356)
It can easily use a static singleton, as the instance is immutable and exists purely to provide a "I don't have line info" / (0,0) value if anyone queries for position.
Vlad Brezae [Mon, 28 Jun 2021 06:39:32 +0000 (09:39 +0300)]
[mono] Intrinsify inequality comparision between runtime types (#54602)
This is needed because, when inlining op_Inequality, the information on whether the arguments are runtime types gets lost. We should track that information instead when inlining, but it is a more invasive change.
Steve Molloy [Mon, 28 Jun 2021 01:24:35 +0000 (18:24 -0700)]
Use Empty instead of null for DCS deserializing namespace. (#54670)
Kevin Jones [Mon, 28 Jun 2021 01:04:20 +0000 (21:04 -0400)]
Fix missing entrypoints and add build-time validation (#54785)
* Fix missing entrypoints and add build-time validation
* Fix missing include
* Update src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/CMakeLists.txt
Co-authored-by: Jan Kotas <jkotas@microsoft.com>
Martin Costello [Sun, 27 Jun 2021 17:21:13 +0000 (18:21 +0100)]
Do not timeout HostingListener when debugging (#54791)
Do not timeout waiting for the host to start when running with
the debugger attached.
Addresses dotnet/aspnetcore#33886.
Jan Vorlicek [Sun, 27 Jun 2021 15:13:46 +0000 (17:13 +0200)]
Fix MacOS build on 11.x SDK and Catalyst build (#54506)
* Fix MacOS build on 11.x SDK and Catalyst build
The configure.cmake was not getting the minimum supported OS version because
it was being set via set_compile_options and the config functions can only
get options from CMAKE_XXX_FLAGS.
* Add comment explaining why we set the macOS options via CMAKE_XXX_FLAGS
Sergio Pedri [Sat, 26 Jun 2021 21:22:09 +0000 (23:22 +0200)]
Make DependentHandle public (#54246)
* Move DependentHandle to System.Runtime
* Update DependentHandle APIs to follow review
* Make DependentHandle type public
* Update DependentHandle on Mono runtime
* Add allocation checks to DependentHandle APIs
This avoids throwing ExecutionEngineException-s if one of the public APIs is called on a non-allocated DependentHandle instance
* Add more unit tests for new public DependentHandle APIs
* Add faster, unsafe internal APIs versions to DependentHandle
* Naming improvements to Ephemeron type
The ephemeron type is checked in the Mono runtime in "object.c" as follows:
m_class_get_image (klass) == mono_defaults.corlib && !strcmp ("Ephemeron", m_class_get_name (klass))
As such, the namespace it belongs to in the managed runtime doesn't matter: the VM will just check
that the type name matches, and that the type is in fact defined in corelib. This means we can
just move it to System.Runtime without worrying about it being properly managed in the VM.
Additionally, the type is defined in "sgen-mono.c" as follows:
typedef struct {
GCObject* key;
GCObject* value;
} Ephemeron;
So as long as the layout matches the one of the type defined in C# (which it does), we're also free
to rename the fields to better follow the naming guidelines, and the VM will have no issues with it.
* Code style tweaks, improved nullability annotations
* Remove incorrect DependentHandle comment on Mono
* Add default Dispose test for DependentHandle
Co-authored-by: Stephen Toub <stoub@microsoft.com>
* Fix race condition in DependentHandle on Mono
* Optimize DependentHandle.nGetPrimary on CoreCLR
Removed internal call, same optimization as GCHandle
* Small IL codegen improvement in DependentHandle.nGetPrimary
* Simplify comments, add #ifdef for using directive
* Minor code style tweaks
* Change nGetPrimaryAndSecondary to nGetSecondary
* Minor code refactoring to DependentHandle on Mono
* Rename DependentHandle FCalls
* Remove DependentHandle.UnsafeGetTargetAndDependent
* Remove DependentHandle.GetTargetAndDependent
* Fix FCall path for internal DependentHandle APIs
* Add more DependentHandle unit tests
* Reintroduce DependentHandle.GetTargetAndDependent()
This fixes a bug due to a race condition in ConditionalWeakTable<K, V>, which relies on this method which atomically retrieves both target and dependent with respect to target being set to null concurrently by other threads. This also exposes the same API publically to allow consumers to potentially implement custom conditional weak tables in the same manner.
* Minor IL tweaks to produce smaller IR in the JIT
* Add DependentHandle.StopTracking() API
This also fixes two potential GC holes when setting DependentHandle.Target (see conversation from https://github.com/dotnet/runtime/pull/54246#issuecomment-
863285327 onwards)
* Rename InternalSetTarget to StopTracking, remove redundant param
* Remove FCUnique from InternalStopTracking
This was added in https://github.com/dotnet/runtime/pull/39810 to avoid a collision with MarshalNative::GCHandleInternalSet, as the two FCalls had identical implementations and their entry points were not unique. This should no longer be needed after
099fc478551f46cc54e7a18a32d9a9ac73727c73, as that changed both the signature and the implementation of this FCall.
* Update API surface to match approved specs from API review
* Update DependentHandle XML docs
Co-authored-by: Stephen Toub <stoub@microsoft.com>
Adam Sitnik [Sat, 26 Jun 2021 21:20:32 +0000 (23:20 +0200)]
More file stream options tests (#53982)
* add more tests
* StreamWriter and StreamReader require FileStreamOptions with necessary access
* allow for bufferSize == 0
* extend the test
* refactor the tests
* Revert "allow for bufferSize == 0"
This reverts commit
f1259be18a3446c1b8939883f484cc28347c74cf.
Joseph Da Silva [Sat, 26 Jun 2021 19:33:01 +0000 (12:33 -0700)]
Fix BigInteger hex string parsing bug (#54251) (#54262)
Stephen Toub [Sat, 26 Jun 2021 19:30:56 +0000 (15:30 -0400)]
Fix WaitForNextTickAsync_CanceledWaitThenWaitAgain_Succeeds test (#54775)
There's a race condition in the test between the timer firing and cancellation being requested. It repros more on Linux because there's a smaller quantum on Linux than on Windows.
Danny Friar [Sat, 26 Jun 2021 19:29:30 +0000 (20:29 +0100)]
Expose underlying unix file descriptor in SafeMemoryMappedFileHandle (#53538)
* expose unix file descriptor safe memory map
* store handle after DangerousAddRef
* add test verifying handle matches filestream handle
* Update src/libraries/System.IO.MemoryMappedFiles/src/Microsoft/Win32/SafeMemoryMappedFileHandle.Unix.cs
Co-authored-by: Stephen Toub <stoub@microsoft.com>
* Update src/libraries/System.IO.MemoryMappedFiles/src/Microsoft/Win32/SafeMemoryMappedFileHandle.Unix.cs
Co-authored-by: Stephen Toub <stoub@microsoft.com>
* Update src/libraries/System.IO.MemoryMappedFiles/src/Microsoft/Win32/SafeMemoryMappedFileHandle.Unix.cs
Co-authored-by: Stephen Toub <stoub@microsoft.com>
* Update src/libraries/System.IO.MemoryMappedFiles/src/Microsoft/Win32/SafeMemoryMappedFileHandle.Unix.cs
Co-authored-by: Stephen Toub <stoub@microsoft.com>
* Update src/libraries/System.IO.MemoryMappedFiles/tests/MemoryMappedFile.CreateFromFile.Tests.cs
Co-authored-by: Stephen Toub <stoub@microsoft.com>
* Dispose MemoryMappedFile in MapHandleMatchesFileStreamHandle test
* Update src/libraries/System.IO.MemoryMappedFiles/src/Microsoft/Win32/SafeMemoryMappedFileHandle.Unix.cs
Co-authored-by: Stephen Toub <stoub@microsoft.com>
* Update MemoryMappedFile.CreateFromFile.Tests.cs
* Move mmf in test to using block
* Fix test
Co-authored-by: Danny Friar <danny@Dannys-MacBook-Pro.local>
Co-authored-by: Stephen Toub <stoub@microsoft.com>
Theodore Tsirpanis [Sat, 26 Jun 2021 19:11:08 +0000 (22:11 +0300)]
Use an untyped `Task` instead of a `Task<bool>` in `TimerQueueTimer`. (#54455)
Tomas Weinfurt [Sat, 26 Jun 2021 18:20:39 +0000 (20:20 +0200)]
add pre-cancellation check and enable ReadWriteAsync_PrecanceledOperations_ThrowsCancellationException for QUIC (#54540)
Vlad Brezae [Sat, 26 Jun 2021 18:15:41 +0000 (21:15 +0300)]
[interp] Don't cprop between vt vars of different sizes (#54734)
Via unsafe code, getting the lower Vector128 from a Vector256 ends up as a move of `sizeof (Vector128)` from a Vector256 var. However, the destination var is not a valid copy of the source var, having a different type
Juan Hoyos [Sat, 26 Jun 2021 17:52:23 +0000 (10:52 -0700)]
Revert "Fix 54025 (#54070)" (#54728)
This reverts commit
b2fe6678282503374aeea7ab5f468f7a3cc85a2f.
Kevin Ransom (msft) [Sat, 26 Jun 2021 13:51:19 +0000 (06:51 -0700)]
Add metadatatoken override to SymbolMethod (#54656)
* Add metadatatoken override to SymbolMethod
* Add test
Co-authored-by: Jan Kotas <jkotas@microsoft.com>
Oded Hanson [Sat, 26 Jun 2021 13:37:59 +0000 (16:37 +0300)]
minor optimization: move creation of X509 Subject Summary into catch block on MacOS. (#54774)
Sergey Andreenko [Sat, 26 Jun 2021 08:24:54 +0000 (01:24 -0700)]
Extract fgMorph(Init/Copy)Block into their own classes. (#53983)
* Rewrite fgMorph(Copy/Init)Block.
* fix a last squash error.
* fix nits
David Fowler [Sat, 26 Jun 2021 07:52:38 +0000 (00:52 -0700)]
Clean up some DI code (#54732)
- Remove empty CreateInstanceCallSite file
- Removed ServiceScopeFactoryCallsite and used ConstantCallsite instead.
- Added fast path if the value is already cached on the callsite.
Aleksey Kliger (λgeek) [Sat, 26 Jun 2021 07:30:00 +0000 (03:30 -0400)]
Miscellaneous MetadataUpdater cleanups (#54751)
Geoff Kizer [Sat, 26 Jun 2021 04:10:32 +0000 (21:10 -0700)]
Move remote server redirect and decompression tests to HttpClientHandlerTest.RemoteServer.cs (#54738)
* move remote redirect and decompression tests to HttpClientHandler_RemoteServerTest
Co-authored-by: Geoffrey Kizer <geoffrek@windows.microsoft.com>
David Wrighton [Sat, 26 Jun 2021 03:21:40 +0000 (20:21 -0700)]
Fix gc hole in IO thread pool (#54769)
Geoff Kizer [Sat, 26 Jun 2021 01:45:42 +0000 (18:45 -0700)]
HTTP3: Re-enable cookie and cancellation tests (#54727)
* fix an issue with GOAWAY handling and enable cookie tests
* disable ConnectTimeout test for HTTP3
* fix Expect 100 continue handling in HTTP3
* add and use GenericLoopbackServer.SendPartialResponseHeadersAsync
* enable cancellation tests for HTTP3
* disable failing interop tests
Co-authored-by: Geoffrey Kizer <geoffrek@windows.microsoft.com>
Layomi Akinrinade [Fri, 25 Jun 2021 23:09:23 +0000 (16:09 -0700)]
Clean up JSON source gen APIs (#54527)
* Clean up JSON source gen APIs
* Address review feedback
* Simplify GenerateX computation
David Wrighton [Fri, 25 Jun 2021 22:06:22 +0000 (15:06 -0700)]
Fix handling of static virtual method implementation checking (#54710)
- It turns out that GetMethodDescFromMemberDefOrRefOrSpec and FindOrCreateAssociatedMethodDesc are not safe to use on a MemberRef whent the associated MethodTable is not fully loaded.
- Instead only use that feature when working with a MethodDef or a fully loaded type, and when working with a not fully loaded type, use MemberLoader::FindMethod instead.
- When running the resolution algorithm for doing constraint validation, it also is not necessary to fully resolve to the exact correct MethodDesc, which as that process uses FindOrCreateAssociatedMethodDesc needs to be avoided.
- The above was not evident as in many cases, the validation algorithm did not run as it was misplaced and located directly before the call to SetIsFullyLoaded. That code path is only followed if the type is able to fully load without circular dependencies. (Test case CuriouslyRecurringGenericWithUnimplementedMethod added to cover that scenario)
- In addition, while investigating these issues, I realized we were lacking checks that the constraints on the impl and decl method were not checked at during type load, but that work was instead deferred to dispatch time. Along with the constraint check there was also a set of accessibility checks that had been missed that are common to all MethodImpl handling. Fix by adding tweaking the logic to share most of that code.
David Wrighton [Fri, 25 Jun 2021 22:05:56 +0000 (15:05 -0700)]
Fix thread safety of _typeRefsInCompilationModuleSet (#54760)
David Wrighton [Fri, 25 Jun 2021 18:10:50 +0000 (11:10 -0700)]
Tweak classcompat loader to skip MethodImpls associated with static methods (#54658)
Jan Vorlicek [Fri, 25 Jun 2021 17:06:37 +0000 (19:06 +0200)]
Fix BackoutJitData (#54711)
* Fix BackoutJitData
The RemoveJitData that the BackoutJitData calls requires the code
header to be copied to the final location. This change fixes it.
I've also found that in one of my previous changes, I've accidentally
enabled jitting into a scratch buffer by default by adding the
FEATURE_WXORX define unconditionally. So I am removing it in this change
for non Apple Silicon, it will be replaced by a dynamic check whether W^X
is enabled in the final W^X change.
Zoltan Varga [Fri, 25 Jun 2021 16:55:02 +0000 (12:55 -0400)]
[mono][jit] Refactor the generic sharing code a bit. NFC. (#54705)
* [jit] Refactor the emit_rgctx code a bit.
* Add an enum to specify the way the rgctx is accessed from a gshared method.
Use it to simplify some logic.
Pavel Savara [Fri, 25 Jun 2021 14:14:54 +0000 (16:14 +0200)]
Revert "[wasm] browser http response stream could be seekable (#54603)" (#54742)
This reverts commit
c139d00640485e8c231c54d1573dc02d7c9e8daf.
Pavel Savara [Fri, 25 Jun 2021 08:56:28 +0000 (10:56 +0200)]
[wasm] browser http response stream could be seekable (#54603)
- browser http response stream could be seekable
- test WebAssemblyEnableStreamingResponse
Stephen Toub [Fri, 25 Jun 2021 07:35:29 +0000 (03:35 -0400)]
Override more Stream members on System.IO.Compression streams (#54518)
Přemek Vysoký [Fri, 25 Jun 2021 07:07:51 +0000 (09:07 +0200)]
[main] Update dependencies from 9 repositories (#54543)
SingleAccretion [Fri, 25 Jun 2021 06:37:09 +0000 (09:37 +0300)]
Fix CQ regression & correctness bug in morphing of long muls (#53566)
* Add a test covering GTF_MUL_64RSLT transform
* Disable the test on Mono
* Add genActualTypeIsInt helper
* Add some gtFlags helpers
* Prepare decomposition for new long muls
* Update gtIsValid64RsltMul
To understand the new format for long muls.
* Rework morphing of long muls
Previously, morph was looking for the exact pattern of
MUL(CAST(long <- int), CAST(long <- int)) when assessing
candidacy of GT_MUL for being marked with "GTF_MUL_64RSLT" and
emitted as "long mul".
This worked fine, until the importer was changed to fold
all casts with constant operands. This broke the pattern
matching and thus all MULs in the form of (long)value * 10
started being emitted as helper calls.
This change updates morph to understand the new folded casts
and in general updates the "format" of long mul from
"CAST * CAST" to "CAST * (CAST | CONST)".
In the process, new helper functions have been introduced, to
avoid bloating fgMorphSmpOp with the new sizeable logic.
Recognition of overflowing cases has been upgraded, and a correctness
bug, where "checked((long)uint.MaxValue * (long)uint.MaxValue)"
was wrongly treated as non-overflowing, fixed.
Additionally, the logic to emit intermediate NOPs has been
changed to instead always skip morphing the casts themselves,
even when remorphing.
* Add the script to generate the longmul test
The test itself has been regenerated using it and
there were no diffs, as expected.
SingleAccretion [Fri, 25 Jun 2021 06:32:54 +0000 (09:32 +0300)]
Eliminate chained casts to small types (#52561)
We can take advantage of the implicit zero/sign-extension for
small integer types and eliminate some casts.
SingleAccretion [Fri, 25 Jun 2021 06:32:44 +0000 (09:32 +0300)]
Optimize `CAST(int <- long)` on 32 bit targets (#53040)
* Optimize CAST(int <- long) on 32 bit targets
* Revert "Optimize CAST(int <- long) on 32 bit targets"
Revert the implementation in lowering
* Optimize CAST(int <- long) on 32 bit targets
Move the code from lowering to long decomposition.
* Fixed the "Arguments" note for DecomposeNode
* Added the function header
For OptimizeCastFromDecomposedLong.
* Remove the TODO comment
While correct, it has questionable value.
* Add a more detailed dump output
* Do not try to optimize checked casts
It is easy to get it wrong. Let the frontend handle this.
* Do not depend on tree order
Previous version of the code assumed that there could be
no nodes between the cast and its operand. That is not
a correct assumption to make in LIR.
Mike McLaughlin [Fri, 25 Jun 2021 05:54:28 +0000 (22:54 -0700)]
Move the metadata update related APIs to the MetadataUpdater class (#54590)
Move the metadata update related APIs to the MetadataUpdater class
The old APIs AssemblyExtensions.ApplyUpdate() and AssemblyExtensions.GetApplyUpdateCapabilities() will be removed
after all the references to them have been changed to the new APIs.
Add the new IsSupported API described in issue https://github.com/dotnet/runtime/issues/51159.
Change the tests to use the MetadataUpdater APIs.
Fix the ApplyUpdate qcalls and icalls
Add the ILLink substitutions for MetadataUpdater.IsSupported property
Change the old APIs to call the new ones
Update mono's MetadataUpdater.IsSupported property
Update feature switch doc
Fixed the argument checking in coreclr's MetadataUpdater.ApplyUpdate().
Marie Píchová [Fri, 25 Jun 2021 04:37:07 +0000 (06:37 +0200)]
S.N.Quic made private (#54610)
Note this will need reaction on ASP.NET side.
Egor Chesakov [Fri, 25 Jun 2021 03:26:08 +0000 (20:26 -0700)]
Disallow promotion of HVA structs when their fields of TYP_SIMD8 were promoted as plain structs (#54694)
Thays Grazia [Fri, 25 Jun 2021 01:21:57 +0000 (22:21 -0300)]
[wasm][debugger] Detect initial status of pause on exceptions. (#54040)
* Detect initial status of pause on exceptions.
* Changing what @radical suggested.
* Changing more things.
* Test case created.
I could not test the pause on "all" exceptions because if I enable the pause on caught exceptions and reload the page it will stop in a lot of exceptions other then the one that I inserted in AttachToTarget.
* Adding a test for Reload page with ALL set.
* Fixing merge conflicts.
* setting icordebug = false.
* Removing unrelated change.
Jeremy Koritzinsky [Thu, 24 Jun 2021 23:40:40 +0000 (16:40 -0700)]
defMAC construction up a scope to make it live long enough. (#54702)
Fixes #54649
Steve Pfister [Thu, 24 Jun 2021 23:19:11 +0000 (19:19 -0400)]
Fix MonoCrossAOT.UnixFilePermissions for wasm (#54693)
* Fix MonoCrossAOT.UnixFilePermissions for wasm
We introduced Microsoft.NETCore.App.MonoCrossAOT.UnixFilePermissions.xml in https://github.com/dotnet/runtime/pull/54501 to make sure the right permissions are set when installing AOT compiler workload packs. We hardcoded the list to include mono-aot-cross, llc, and opt. However, in wasm's case they only have mono-aot-cross.
This change makes the xml file a template and only includes mono-aot-cross for browser and all three for the other configurations.
Fixes https://github.com/dotnet/runtime/issues/54612
* Use property instead of item for the file nodes
* Ankit suggestion
Co-authored-by: Steve Pfister <steve.pfister@microsoft.com>
Maxim Lipnin [Thu, 24 Jun 2021 21:01:06 +0000 (00:01 +0300)]
Mark AssemblyDependencyResolver as unsupported on Browser and mobile (#54601)
* Mark AssemblyDependencyResolver as unsupported on Browser and mobile
* Apply AlekseyK's workaround to fix android CI builds
* Add an annotation for maccatalyst
imhameed [Thu, 24 Jun 2021 20:56:27 +0000 (13:56 -0700)]
[mono] Implement Rdm and Dp (#49737)
See https://github.com/dotnet/runtime/issues/42322 and
https://github.com/dotnet/runtime/issues/42280.
Tested manually on an arm64 Linux VM running on an M1 Mac Mini. Does not
enable RDM or DP when AOT-compiling the associated runtime tests; our CI
hardware doesn't support these extensions yet.
Aleksey Kliger (λgeek) [Thu, 24 Jun 2021 20:56:12 +0000 (16:56 -0400)]
Pass the default ALC gchandle to the v3 preload hook (#54686)
* Pass the default ALC gchandle to the v3 preload hook
Fixes crashes early during startup when the gchandle is then used by the hooks
to call mono API functions. The default ALC exists, but its managed object
doesn't, so the gchandle target is null. The mono APIs detect the the special
gchandle and resolve it to the default ALC
Example crash
https://gist.github.com/grendello/
b4ab24587a055725cc5e1416b86ad7ca
* [alc] Assert that we never see a null target from a managed ALC gchandle
Miha Zupan [Thu, 24 Jun 2021 20:45:52 +0000 (13:45 -0700)]
Add ActivitySource support to DiagnosticsHandler (#54437)
* Add ActivitySource support to DiagnosticsHandler
* Use ActivitySource as another enabled condition
* Make IsGloballyEnabled a property
* Simplify enabled check
* Revert using the exception filter
* Update HTTP ILLink.Substitutions.xml
Tom McDonald [Thu, 24 Jun 2021 20:17:39 +0000 (13:17 -0700)]
Add CustomAttributes ApplyUpdate Capability (#54619)
* Add CustomAttributes ApplyUpdate Capability
* Rename CustomAttributes ChangeCustomAttributes per #54284
Steve Harter [Thu, 24 Jun 2021 19:35:35 +0000 (14:35 -0500)]
Support synchronous Stream-based serialization methods (#54632)
SingleAccretion [Thu, 24 Jun 2021 19:34:08 +0000 (22:34 +0300)]
Add args descriptions for VNF_MapStore and VNF_MapSelect (#54108)
Anton Lapounov [Thu, 24 Jun 2021 19:09:36 +0000 (12:09 -0700)]
Ensure relocation blocks are 4-byte aligned (#54668)
Zoltan Varga [Thu, 24 Jun 2021 19:05:15 +0000 (15:05 -0400)]
[mono][wasm] Reenable the remove finally pass. (#54450)
* [mono][wasm] Reenable the remove finally pass.
* [mono][wasm] Run methods which need stack walks using the interpreter instead of pushing an LMF.
* Disable vtype based sharing for vtypes with explicit sizes.
Ryan Lucia [Thu, 24 Jun 2021 18:56:04 +0000 (14:56 -0400)]
Remove CoffeeFlux from CODEOWNERS (#54696)
Thays Grazia [Thu, 24 Jun 2021 18:36:56 +0000 (15:36 -0300)]
[wasm][debugger] Fixing debugger tests errors (#54664)
* Fixing new debugger tests errors.
Errno is not being assigned anymore.
DebuggerTests.SetVariableValueTests
* Passing icordbg flag as false.
* Adding new tests.
Bill Wert [Thu, 24 Jun 2021 17:46:31 +0000 (10:46 -0700)]
Add non-LLVM iOS size scenario (#54585)
* Add non-LLVM iOS size scenario
* add category
* remove parens
* variables in the wrong place.
* move setting configs to before it is written
Jakob Botsch Nielsen [Thu, 24 Jun 2021 17:25:54 +0000 (19:25 +0200)]
Fix instruction hex display (#54675)
Natalia Kondratyeva [Thu, 24 Jun 2021 17:24:56 +0000 (19:24 +0200)]
[QUIC] Add Windows version check to QUIC initialization (#54488)
Add Windows version check to QUIC initialization, log min supported and current Windows version
Krzysztof Wicher [Thu, 24 Jun 2021 17:20:36 +0000 (19:20 +0200)]
Fix Activator.CreateInstance(GetType(), ...) related ILLink warnings in (#54680)
System.Data.Common
Alexander Köplinger [Thu, 24 Jun 2021 15:43:55 +0000 (17:43 +0200)]
Disable MacCatalyst arm64 PR test runs on staging pipeline (#54678)
We don't have enough capacity right now on Helix to handle the load.
Daniel Genkin [Thu, 24 Jun 2021 15:39:04 +0000 (11:39 -0400)]
[WASM] Fix async/await in config loading (#54652)
* Fixed config issue
* Updated Hot Reload test
monojenkins [Thu, 24 Jun 2021 15:33:14 +0000 (11:33 -0400)]
Fix for heap_use_after_free flagged by sanitizer (#54679)
Copy of https://github.com/mono/mono/pull/21120
Co-authored-by: dseshadri <dseshadri@users.noreply.github.com>
Radek Doulik [Thu, 24 Jun 2021 15:20:26 +0000 (17:20 +0200)]
[wasm] Bump emscripten to 2.0.23 (#53603)
Bumps emscripten to 2.0.23
The Browser AOT tests now use `-Wl,-lto-O0` option to reduce memory usage of `wasm-ld` tool, which was in some cases going over avaiable 8GB on helix machines.
* Revert "Add ActiveIssue to the MemoryMappedFiles tests"
This reverts commit
ec1ae530606ef1061680600fc046226cc1c4cbc3.
* Revert "Add ActiveIssue attr to the FileSystem tests"
This reverts commit
356b3ff2a703980ac01b9df697a594e8c341c436.
* Bump emscripten version to 2.0.23
* Use newer docker images with 2.0.23
* Update docs
* Use 2.0.23 emscripten nuget packages
* Revert "Revert "Add ActiveIssue attr to the FileSystem tests""
This reverts commit
eb2f9548b08c114b359fab8d867ba50de098fe48.
The fix is not present in 2.0.23
* Revert "Revert "Add ActiveIssue to the MemoryMappedFiles tests""
This reverts commit
8be39f583499a8d8451034c65260a785330b0795.
The fix is not present in 2.0.23
* Increase timeout for AOT tests
* Add description of emscripten bump to README
* Try to get information about resources
* Get all limits
* Escape & chars
* Reduce platform matrix
* Lets try one more build with doubled timeout
* Revert "Lets try one more build with doubled timeout"
This reverts commit
67dd7754bb79218b2c6b687034162d041715093e.
* Try -Wl,-O0 on CI
To be sure it behaves the same as in local build
* Use -Wl,-lto-O0 do lower link time optimization
It looks like it reduces the memory load a lot
* Set EmccLinkOptimizationFlag for AOT tests
And reset the default value
* Escape commas
* Revert "Reduce platform matrix"
This reverts commit
fec0e557208eb165824e75cd57b895a74d164de4.
* Remove resource info retrieval
* Bump emsdk versions
Co-authored-by: Larry Ewing <lewing@microsoft.com>
Viktor Hofer [Thu, 24 Jun 2021 14:46:39 +0000 (16:46 +0200)]
Fix compiler references when building inside VS (#54614)
If for a source project a contract project exists, then the contract project's TargetPath should be passed to the compiler. This is handled by the SDK by default when `ProduceReferenceAssembly` is true. As dotnet/runtime doesn't use the `ProduceReferenceAssembly` feature yet, a custom target adds the necessary `ReferenceAssembly` metadata to the `TargetPathWithTargetPlatformMoniker` item which then is transformed to references for the compiler. That works fine on the CLI as the `GetTargetPathWithTargetPlatformMoniker` target runs after the ProjectReference to the ContractProject is resolved and its target path is available.
Inside VS the target ordering is different and the `ResolvedMatchingContract` item was empty as the ProjectReference to the contract wasn't yet resolved. The fix for that is to add a dependency onto the `ResolveProjectReferences` target to guarantee that the `ResolvedMatchingContract` item is populated in time.
Noticed this when the build of System.ComponentModel.Composition.Registration failed because the implementation assembly of System.ComponentModel.Composition was passed to the compiler instead of the reference assembly.
Tomas Weinfurt [Thu, 24 Jun 2021 14:31:07 +0000 (16:31 +0200)]
process more TLS frames at one when available (#50815)
* process more TLS frames when available
* add SslStream.Implementation.cs
* remove extra comment
* add back DefaultRequestHeaders_SentUnparsed
* feedback from review
* fix winhttp
* fix linker test
* feedback from review
* feedback from review
* feedback from review
* make EnsureFullTlsFrame async
* feedback from review
Stephen Toub [Thu, 24 Jun 2021 14:24:47 +0000 (10:24 -0400)]
Add PeriodicTimer (#53899)
LateApexEarlySpeed [Thu, 24 Jun 2021 12:30:55 +0000 (20:30 +0800)]
UdpClient with span support (#53429)
Add API from #864
Pavel Savara [Thu, 24 Jun 2021 12:06:06 +0000 (14:06 +0200)]
exclude fragile tests (#54671)
Adam Sitnik [Thu, 24 Jun 2021 10:38:53 +0000 (12:38 +0200)]
get last error before calling a method that might fail as well (#54667)
Adam Sitnik [Thu, 24 Jun 2021 06:58:33 +0000 (08:58 +0200)]
[FileStream] add tests for device and UNC paths (#54545)
* add a test for unseekable device by using a path to named pipe
* add a test for seekable device by using DeviceID instead of drive letter
* add a test for a UNC file path (local file share)
Dan Moseley [Thu, 24 Jun 2021 04:35:39 +0000 (22:35 -0600)]
Fix sporadic double fd close (#54660)
Fix https://github.com/dotnet/runtime/issues/54589
Stephen Toub [Thu, 24 Jun 2021 04:00:01 +0000 (00:00 -0400)]
Remove Version.Clone from AssemblyName.Clone (#54621)
Version is immutable.
Radek Doulik [Thu, 24 Jun 2021 03:52:40 +0000 (05:52 +0200)]
[wasm] Enable fixed libraries tests (#54641)
Fixed by https://github.com/dotnet/runtime/pull/52705 and
https://github.com/dotnet/runtime/pull/52707
Ankit Jain [Thu, 24 Jun 2021 02:29:00 +0000 (22:29 -0400)]
[wasm] Fix blazor/aot builds (#54651)
`dotnet\packs\Microsoft.NET.Runtime.WebAssembly.Sdk\6.0.0-preview.7.21321.15\Sdk\WasmApp.Native.targets(342,5): error : Could not find AOT cross compiler at $(_MonoAotCrossCompilerPath)=`
Make sure this is set for the aot path.
Thays Grazia [Thu, 24 Jun 2021 01:49:43 +0000 (22:49 -0300)]
[mono][wasm] Fix compilation error on wasm (#54659)
Miha Zupan [Thu, 24 Jun 2021 00:21:42 +0000 (17:21 -0700)]
Fix telemetry for Socket connects to Dns endpoints (#54071)
Aleksey Kliger (λgeek) [Thu, 24 Jun 2021 00:13:37 +0000 (20:13 -0400)]
[wasm] Build static components; include hot_reload in runtime (#54568)
* [wasm] Build static components; include hot_reload in runtime
Workaround until https://github.com/dotnet/runtime/issues/54565 is fixed
Build the runtime always with support for hot_reload, and without diagnostics_tracing
* Update wasm.proj
* Add a browser functional test for hot reload
Just check that the capabilities are non-empty which is a good proxy for hot reload being enabled in the runtime.
* Turn off trimming for hot reload functional test
* Disable test on browser AOT
* fix whitespace
Co-authored-by: Thays Grazia <thaystg@gmail.com>
Thays Grazia [Wed, 23 Jun 2021 23:06:58 +0000 (20:06 -0300)]
[wasm][debugger] Reuse debugger-agent on wasm debugger (#52300)
* Trying to reuse debugger-agent on wasm debugger. This will remove a lot of code that does the same thing on mini-wasm-debugger.
* Replace remove_breakpoint and clear_all_breakpoints with the ones on debugger-agent and remove unused code.
* Stepping and callstack using debugger-agent.
* Remove more code.
* Get frame values using debugger-agent.
* Working valuetypes and call function on valuetypes.
make -C src/mono/wasm/ run-debugger-tests TEST_FILTER=DebuggerTests.SteppingTests.InspectValueTypeMethodArgsWhileStepping is working without use_cfo.
* Failed: 316, Passed: 175
* Failed: 307, Passed: 184, Skipped: 0, Total: 491
* Failed: 280, Passed: 211
* Failed: 277, Passed: 214
* Implemented boxed value.
Failed: 271, Passed: 220
* Implementing get properties on objects.
Implementing handling error on debugger-agent.
* Implementing callfunctionon object.
Failed: 248, Passed: 243
* Implementing get pointer values.
Failed: 243, Passed: 248
* Fixing pointer values and implement call on function with pointers.
Failed: 226, Passed: 265
* Reimplement call function on, and implement set values.
Failed: 192, Passed: 299
* Failed: 192, Passed: 299
* Fixing valuetype with null values.
Failed: 184, Passed: 307
* Implemented Evaluate expressions, conditional breakpoints, all breakpoints tests are passing.
Failed: 172, Passed: 319
* Fixing evaluate with value type.
Failed: 156, Passed: 335
* Trim part and add cache.
Failed: 148, Passed: 343
* Fixing evaluate expression.
Failed: 99, Passed: 392
* GetPropertiesTests working.
Failed: 53, Passed: 438
* Passing delegate tests.
Failed: 31, Passed: 460
* Removing unused code.
* Implementing exception handler.
Failed: 30, Passed: 461
* Fixing cfo returning array.
Removing more code.
Removing 2 tests that tests functions which does not exist anymore.
Failed: 18, Passed: 471
* Fix CallFunctionOn returning primitive types and null.
Failed: 9, Passed: 480
* Failed: 7, Passed: 482
* Fixing some tests.
Failed: 2, Passed: 488
* Removing a lot of code.
Failed: 4, Passed: 485
* 0 ERRORS!
* Removing more code.
No errors.
* Fixing added tests.
* Return javascript callstack after managed callstack.
Step out from managed code return to native wasm or javascript.
Adding debug info to Wasm.Browser.Sample to help testing debugger with sample.
* Change what Ankit suggested.
Clear cache with valuetypes and pointers after resume or step.
* Fixing suggestions.
* Fix error on wasm build.
* Apply suggestions from code review
Co-authored-by: Larry Ewing <lewing@microsoft.com>
* Changing what was suggested by @lewing.
* Fix pointer tests.
* Refactoring CreateJObjectForVariableValue
* Changing what @lewing suggested.
* Apply suggestions from code review
Co-authored-by: Larry Ewing <lewing@microsoft.com>
* Update src/mono/wasm/debugger/BrowserDebugProxy/MonoProxy.cs
Co-authored-by: Larry Ewing <lewing@microsoft.com>
* Update src/mono/wasm/debugger/BrowserDebugProxy/MonoSDBHelper.cs
Co-authored-by: Larry Ewing <lewing@microsoft.com>
* Fixing @lewing changes.
* Trying to fix CI.
Co-authored-by: Larry Ewing <lewing@microsoft.com>
Tomáš Rylek [Wed, 23 Jun 2021 21:39:28 +0000 (23:39 +0200)]
Put Crossgen2 in sync with #54235 (#54438)
Eirik Tsarpalis [Wed, 23 Jun 2021 21:37:17 +0000 (00:37 +0300)]
Move System.Object serialization to ObjectConverter (#54436)
* move System.Object serialization to ObjectConverter
* simply customized object converter test