Michal Strehovský [Tue, 7 Jun 2022 17:36:40 +0000 (02:36 +0900)]
Fix trimmability of various System.Runtime tests (#70329)
The reflection patterns couldn't be statically analyzed.
Needed to unblock #70201. NativeAOT trims by default and CoreLib is marked trimmable.
SingleAccretion [Tue, 7 Jun 2022 17:35:37 +0000 (20:35 +0300)]
Delete a few dependencies on field sequences (#69991)
* Remove field seqs from "gtGetStructHandleIfPresent"
* Ensure block morphing preserves handles
Or, rather, restores them better in case they were lost from FIELD nodes.
* Delete two dependencies on FieldSeq from morph
Two small positive diffs where the following tree:
IND bool
ADDR [FieldSeq]
LCL_VAR bool
Is now folded into LCL_VAR instead of LCL_FLD.
Sychev Vadim [Tue, 7 Jun 2022 17:28:41 +0000 (20:28 +0300)]
Optimization for "~x + 1" to "-x" (#69003) (#69600)
SingleAccretion [Tue, 7 Jun 2022 17:15:33 +0000 (20:15 +0300)]
Delete `GT_INDEX` (#69917)
* Do not set NO_CSE on ARR_ADDRs
It is effectively no-CSE already because of how "optIsCSECandidate" works.
* Delete GT_INDEX
Instead:
1) For "ldelem", import "IND/OBJ(INDEX_ADDR)".
2) For "ldelema", import "INDEX_ADDR".
This deletes two usages of "ADDR":
1) "OBJ(ADDR(INDEX))" from "ldelem<struct>".
2) "ADDR(INDEX)" from "ldelema".
* Add a zero-diff quirk
* Update the first class structs document
Remove references to things that no longer exist.
Tanner Gooding [Tue, 7 Jun 2022 16:31:07 +0000 (09:31 -0700)]
Re-enable the pause intrinsic test for x86/x64 CoreCLR (#70230)
* Re-enable the pause intrinsic test for x86/x64 CoreCLR
* Ensure we don't skip base intrinsics when only SSE/SSE2 are disabled
* Ensure InstructionSet_Vector64/128/256 are handled correctly in lookupId
Tomáš Rylek [Tue, 7 Jun 2022 16:25:23 +0000 (18:25 +0200)]
Mop-up changes per Jakob's PR suggestions (#70180)
1) Rename CORINFO_HELP_STATIC_VIRTUAL_AMBIGUOUS_RESOLUTION to
CORINFO_HELP_THROW_AMBIGUOUS_RESOLUTION_EXCEPTION and put it next
to the other CORINFO_HELP_THROW methods;
2) Add the new helper to CorInfoHelpFunc.cs;
3) Remove the jitinterface member doesFieldBelongToClass;
4) Update the JIT EE GUID.
Thanks
Tomas
Fixes: #69900
Thays Grazia [Tue, 7 Jun 2022 16:15:13 +0000 (13:15 -0300)]
Update testing-android.md (#70362)
Sergei Papikian [Tue, 7 Jun 2022 16:09:32 +0000 (19:09 +0300)]
DebuggerDisplay Stopwatch (#65753)
* feat: add DebuggerDisplay method and attribute
* refactor: remove 'this'
* Test
* Fix test
Co-authored-by: Dan Moseley <danmose@microsoft.com>
Julien Couvreur [Tue, 7 Jun 2022 16:03:02 +0000 (09:03 -0700)]
Add bool and uint to documentation for RuntimeHelpers.CreateSpan (#70360)
Tarek Mahmoud Sayed [Tue, 7 Jun 2022 15:48:13 +0000 (08:48 -0700)]
Fix TZ Tests (#70309)
Koundinya Veluri [Tue, 7 Jun 2022 15:01:09 +0000 (08:01 -0700)]
Fix some scaling issues with the global queue in the thread pool (#69386)
* Fix some scaling issues with the global queue in the thread pool
- The global concurrent queue is not scaling well in some situations on machines with a large number of processors. A lot of contention is seen in dequeuing work on some benchmarks.
- I initially tried switching to queuing work from thread pool threads more independently with more efficient work stealing, but it looks like that may need more investigation/experimentation. This is a simpler change that seems to work reasonably well for now.
- Beyond 32 procs, added additional concurrent queues, one per 16 procs. When a worker thread begins dispatching work, it assigns one of those additional queues to itself, trying to limit assignments to 16 worker threads per queue.
- Work items queued by a worker thread queues to the assigned queue. The worker thread dequeues from the assigned queue first, and later tries to dequeue from other queues. Work items queued by non-thread-pool threads continue to go into the global queue.
- When a worker thread stops dispatching work items, it unassigns itself from the queue, and may transfer work items from it if it was the last thread assigned to the queue.
- In the observed cases, work items are distributed to the different queues and contention is reduced due to a limited number of threads operating on each queue
Olli Saarikivi [Tue, 7 Jun 2022 13:50:03 +0000 (06:50 -0700)]
NonBacktracking inner matching loop optimizations (#70217)
* Inner matching loop optimizations
* Cleanup and comments
* Fix and generalize FixedLength handling in matcher
* Fix FixedLength support again
* Suggestions from code review
* Change _stateInfo type to byte
Badre BSAILA [Tue, 7 Jun 2022 09:37:06 +0000 (11:37 +0200)]
handle SECURITY_STATUS 0x80090016 (#69942)
* handle SECURITY_STATUS 0x80090016
* adjust dictionary size
* capital set
Jakob Botsch Nielsen [Tue, 7 Jun 2022 09:00:42 +0000 (11:00 +0200)]
JIT ARM32: Fix passing odd sized structs from arbitrary sources (#70075)
* JIT ARM32: Fix odd sized structs from arbitrary sources
ARM32 ABI allows passing structs in register even when their sizes are
not divisible by 4. This means we sometimes need to pass 3 bytes in the
last register. The JIT would not handle this when the source was an
arbitrary memory location (this would require multiple loads and
shifts). The fix is to just force a copy into the local stack frame for
this case.
Fix #61168
* Reenable ABI tests
Fix #68837
Fix #70042
Andy Ayers [Tue, 7 Jun 2022 05:42:36 +0000 (22:42 -0700)]
JIT: broaden cloning invariant checks (#70232)
Streamline call effects checks. Use wider bit vectors.
Closes #70100.
SingleAccretion [Tue, 7 Jun 2022 02:18:03 +0000 (05:18 +0300)]
Fold more "OBJ(ADDR(LCL))" patterns in multi-reg morphing (#70207)
It is unfortunate that we have to expand this code, but it
will avoid diffs for a TYP_STRUCT LCL_FLD change.
SingleAccretion [Tue, 7 Jun 2022 02:14:05 +0000 (05:14 +0300)]
Do not use `LEA`s in HIR (#69992)
* Make LEAs backend-only
In the frontend, for better or worse, the canonical form
of address arithmetic is explicit pointer arithmetic.
* Add a test
Jackson Schuster [Tue, 7 Jun 2022 01:56:44 +0000 (20:56 -0500)]
Fix linker ref param warnings (#70082)
* Update dependencies from https://github.com/dotnet/linker build
20220523.1
Microsoft.NET.ILLink.Tasks
From Version 7.0.100-1.22270.1 -> To Version 7.0.100-1.22273.1
* Update dependencies from https://github.com/dotnet/linker build
20220524.1
Microsoft.NET.ILLink.Tasks
From Version 7.0.100-1.22270.1 -> To Version 7.0.100-1.22274.1
* Update dependencies from https://github.com/dotnet/linker build
20220525.1
Microsoft.NET.ILLink.Tasks
From Version 7.0.100-1.22270.1 -> To Version 7.0.100-1.22275.1
* Update dependencies from https://github.com/dotnet/linker build
20220530.1
Microsoft.NET.ILLink.Tasks
From Version 7.0.100-1.22270.1 -> To Version 7.0.100-1.22280.1
* Update dependencies from https://github.com/dotnet/linker build
20220531.1
Microsoft.NET.ILLink.Tasks
From Version 7.0.100-1.22270.1 -> To Version 7.0.100-1.22281.1
* WIP
* Supress warnings produced by ref param dataflow
* Update comments and remove IL2118/9 suppressions
* whitespace
* Trailing whitespace
* PR feedback
* Fix wording
Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: Sven Boemer <sbomer@gmail.com>
Zoltan Varga [Tue, 7 Jun 2022 01:29:58 +0000 (21:29 -0400)]
[mono][wasm] Revert the gc_pin optimization changes. (#70234)
Fixes https://github.com/dotnet/runtime/issues/70213.
Carlos Sanchez [Tue, 7 Jun 2022 01:19:03 +0000 (18:19 -0700)]
Rename TarFormat to TarEntryFormat (#70313)
SingleAccretion [Tue, 7 Jun 2022 00:56:29 +0000 (03:56 +0300)]
Remove obsolete code from "gtSetMultiOpOrder" (#70216)
Remove references to preserving previous behavior.
Use a better algorithm for calculating the "level" of MultiOp nodes.
SingleAccretion [Tue, 7 Jun 2022 00:48:33 +0000 (03:48 +0300)]
Do not retype SIMD nodes (#70265)
* Do not retype SIMD nodes
It is not necessary: the only case where it is required, SIMD8 to
LONG bitcasts on Windows x64, is already handled by lowering.
It is dangerous: in case we CSE the retyped tree, its other uses
will be (effectively) retyped as well.
* Add a test
Jakob Botsch Nielsen [Tue, 7 Jun 2022 00:43:38 +0000 (02:43 +0200)]
Always use portable tailcalling mechanism for delegate tailcalls (#70269)
* Always use portable tailcalling mechanism for delegate tailcalls
It is rare but possible to have delegates that point to VSD stubs. Since
VSD stubs on x86 may disassemble the call-site we cannot allow tail
calling these with the old mechanism.
Fix #70259
* Add regression test
* Calm down the test
Tailcall through built-in delegates is best-effort. Instantiating stubs
may break the chain and on ARM32 so may wrapper delegate stubs. The
latter happens for this particular test. Change the test so that it is
just verifying we do not hit the assert.
* Disable regression test on Mono
* Clean up some ildasm output
Thays Grazia [Tue, 7 Jun 2022 00:31:26 +0000 (21:31 -0300)]
[wasm][debugger] Support new hot reload features (#70097)
* Implementing support new method on enc
* HotReload - Support new static method
* - Fix adding a new static field in an class not initialized
- Returning the number of the fields in the class including the ones added by hotreload.
* Fix GetStringAfterEnc.
Add a test with 2 enc adding classes in both of them.
Adding in the dump changes typedef added.
* Fix space between function and (
* Removing try catch.
* Fix compilation
* Remove unnecessary if.
* Adressing @lambdageek comments and adding a test for it.
* Addressing @radical comments.
* Renaming method.
* Counting row indices per-kind.
* Addressing @radical comments.
* Apply suggestions from code review
Co-authored-by: Ankit Jain <radical@gmail.com>
* Addressing @radical comments.
* Fix methodDebugInformation.Document.IsNil.
Co-authored-by: Ankit Jain <radical@gmail.com>
Zoltan Varga [Tue, 7 Jun 2022 00:13:47 +0000 (20:13 -0400)]
[mono][jit] Emit a null check for ldobj. (#70308)
Tanner Gooding [Mon, 6 Jun 2022 23:55:08 +0000 (16:55 -0700)]
Fixing the costing of GT_CNS_DBL and GT_CNS_VEC instructions (#70215)
* Fixing the costing of GT_CNS_DBL and GT_CNS_VEC instructions
* Applying formatting patch
David Wrighton [Mon, 6 Jun 2022 22:12:27 +0000 (15:12 -0700)]
Stop unnecessary exceptions from being thrown from crossgen when a reference is not actually a managed dll (#70191)
- Makes ad hoc usage of crossgen2 much more convenient on Windows as the exceptions generated are annoying to deal with in the debugger
Eric Erhardt [Mon, 6 Jun 2022 21:38:08 +0000 (15:38 -0600)]
Move HostAbortedException to Abstractions (#70205)
* Move HostAbortedException to Abstractions
HostAbortedException was added directly to Microsoft.Extensions.Hosting, which depends on a lot of other libraries. This causes problems when using the HostFactoryResolver.Sources package because now consumers of HostFactoryResolver need to reference the whole Hosting package and all of its dependencies.
Fix this by moving the new exception to the Hosting.Abstractions library, which has a minimal set of dependencies.
* Remove direct dependency from HostFactoryResolver on Microsoft.Extensions.Hosting assemblies.
Load the HostAbortedException using Reflection instead. If it can't be found, throw a private exception with the same name.
Mitchell Hwang [Mon, 6 Jun 2022 21:20:48 +0000 (17:20 -0400)]
[mono] Extend mono AOT compiler to ingest .mibc profiles (#70194)
* [mono] Add non_executable field to MonoImage to properly load MethodRef in .mibc files
* [mono][aot] Extend mono-aot-compiler to handle .mibc profile
* [tasks] Extend MonoAOTCompiler task to handle .mibc profiles
* Address feedback
* Add method descriptions
* Address more feedback
Günther Foidl [Mon, 6 Jun 2022 20:56:03 +0000 (22:56 +0200)]
Update libraries' building docs for native components (#70284)
* Update libraries' building docs for native components
Also added a (short) ReadMe.md to src/native/libs.
* Removed trailing whitespace
* Update src/native/libs/ReadMe.md
Co-authored-by: Jan Kotas <jkotas@microsoft.com>
Co-authored-by: Jan Kotas <jkotas@microsoft.com>
Kunal Pathak [Mon, 6 Jun 2022 20:15:49 +0000 (13:15 -0700)]
Bug fixes from dead code elimination (#69897)
* Track if unreachable blocks were detected
squash: Update test case name
* Unreachable one-by-one
unreachable
to squash
* Add test cases
* add test description
* Check if there were any unreachable blocks
* review feedback
* jit format
* Fix a case for isBBCallAlwaysPairTail for Arm
Stephen Toub [Mon, 6 Jun 2022 20:10:34 +0000 (16:10 -0400)]
Fix lazy loop backtracking uncapture in compiled regexes (#70280)
When a lazy loop backtracks, we should be uncapturing everything after the loop, but we're failing to do so. As we do elsewhere, we need to store the current capture position and then uncapture until that position when backtracking.
Bruce Forstall [Mon, 6 Jun 2022 18:46:27 +0000 (11:46 -0700)]
Improve binaries filtering for PMI runs of SPMI collection (#70294)
Add some more to the "exclude" list:
1. A few new native dlls
2. An uninteresting managed dll
3. 2 cases where running PMI on a dll causes a VM assert. Note that
"PMI DriveAll" should recover from this, but these exact assemblies
seem to cause a hang when run in the CI. Perhaps on those Helix
machines the crash is intercepted, sometimes? I did not add mscorlib.dll
to this list, which also causes an assert
(https://github.com/dotnet/runtime/issues/65814), because it is too
important and it doesn't appear to be causing failures all the time.
Nikola Milosavljevic [Mon, 6 Jun 2022 18:28:32 +0000 (11:28 -0700)]
Do not add x86 host to PATH on 64-bit machines (#69902)
Marek Fišera [Mon, 6 Jun 2022 18:09:34 +0000 (20:09 +0200)]
[wasm] Properly handle trailing whitespace in the URL for the HttpClient (#70154)
Eirik Tsarpalis [Mon, 6 Jun 2022 16:58:14 +0000 (17:58 +0100)]
Decouple TimeOnlyConverter from TimeSpanConverter (#70035)
* Decouple TimeOnlyConverter from TimeSpanConverter
* remove redundant using declarations
Steve Harter [Mon, 6 Jun 2022 16:08:09 +0000 (11:08 -0500)]
Remove unused code (#70282)
Jan Kotas [Mon, 6 Jun 2022 15:32:32 +0000 (08:32 -0700)]
Add list of pre-requisities for Alpine (#70283)
Fixes https://github.com/dotnet/runtimelab/issues/1891
Thays Grazia [Mon, 6 Jun 2022 15:15:19 +0000 (12:15 -0300)]
[wasm][debugger]Fix entrypoint breakpoint when it's an async method (#69856)
* Fix entrypoint when it's an async method.
Add methods in the type even if there isn't source information.
* Update src/mono/wasm/debugger/BrowserDebugProxy/MonoProxy.cs
Co-authored-by: Ankit Jain <radical@gmail.com>
* Addressing @radical comments.
* Addressing @radical comment
* Update src/mono/wasm/debugger/BrowserDebugProxy/MonoProxy.cs
Co-authored-by: Ankit Jain <radical@gmail.com>
* Address @radical comments.
* Revert @radical suggestion.
* Addressing @radical comment.
* Addressing @radical comments offline.
* Addressing @radical comments offline.
Co-authored-by: Ankit Jain <radical@gmail.com>
Steve Pfister [Mon, 6 Jun 2022 14:59:17 +0000 (10:59 -0400)]
[iOS] Grab the default timezone using native API (#70149)
This change grabs the default timezone name using NSTimeZone if the TZ environment variable is not set. Previously, it would fall back to UTC because the TZ files we look for do not exist on devices.
Shay Rojansky [Mon, 6 Jun 2022 14:10:15 +0000 (17:10 +0300)]
Implement DbDataSource (#70006)
Closes #64812
Ilona Tomkowicz [Mon, 6 Jun 2022 14:02:11 +0000 (16:02 +0200)]
[wasm][debugger] Added Default Interface Method tests. (#70002)
* Added DIM tests.
* Addressed @radical's suggestions.
* Block failing firefox tests.
Stephen Toub [Mon, 6 Jun 2022 13:56:19 +0000 (09:56 -0400)]
Improve string.Format / {Value}StringBuilder.AppendFormat parsing throughput (#69757)
The primary purpose of this change was to use IndexOfAny as part of parsing a composite string format in order to look for the next brace in the string: for longer composite formats with fewer holes, this can significantly speed up the parsing. However, for very small strings filled with formats, the overhead of the IndexOfAny is unnecessary, and so I ended up overhauling the implementation to gain back the losses for those shorter cases, e.g. by avoiding bounds checking, by favoring expected cases, etc., and also generally cleaned up the implementation. As part of this, I also deleted the internal ParamsArray helper struct and replaced it with use of `ReadOnlySpan<object?>`.
SingleAccretion [Mon, 6 Jun 2022 10:51:35 +0000 (13:51 +0300)]
Generalize the "BOX(nullable) cmp null" opt (#69961)
We can obtain the "Nullable<T>" class handle from the helper's arg.
SingleAccretion [Mon, 6 Jun 2022 10:16:24 +0000 (13:16 +0300)]
Enable folding of struct indirs used by returns in local morph (#69947)
* Enable TYP_STRUCT LCL_FLD for RETURNs
This is already supported: such LCL_FLDs are used for
structs returned in a single register.
The multi-register form is unaffected because it is
currently treated rather specially, with the value
always spilled by the importer to a temporary of the
right type.
* Delete a redundant assert
"verifyLclFldDoNotEnregister" does the same check already.
Radek Doulik [Mon, 6 Jun 2022 09:37:01 +0000 (11:37 +0200)]
[wasm] Initial SIMD support (#70086)
Add initial SIMD support for wasm. This is subset of the original [draft PR](https://github.com/dotnet/runtime/pull/67848) without the public API additions.
Add `WasmSIMD` property to enable SIMD in AOT builds. With the property enabled, the apps built with AOT get SIMD intrinsics inlined for parts of `S.R.I.Vector128` and `S.R.I.Vector128<T>` API.
Add test to build and run a simple app with SIMD enabled.
* Initial wasm SIMD support
* Enable Vector intrinsic on wasm
The llvm code generator works nicely with them.
* Add missing files
* Make SIMD support conditional
* Remove test code
* Fix debug build
* Update after merge
* Add Splat and ExcractLane methods
* Switch i64 values for Constant method
So that C#
WasmBase.Constant(0xff11ff22ff33ff44, 0xff55ff66ff77ff88)
is compiled into wasm code
v128.const 0xff11ff22ff33ff44ff55ff66ff77ff88 [SIMD]
* Update PlatformNotSupported version of WasmBase
* Fix CI build
* Add ReplaceLane and Swizzle
* Change WasmBase.Constant to get Vector128 as input
* Add Shuffle methods
This will need more work, as it crashes clang during 'WebAssembly
Instruction Selection' pass:
WasmApp.Native.targets(353,5): error : 3. Running pass 'WebAssembly Instruction Selection' on function '@corlib_System_Runtime_Intrinsics_Wasm_WasmBase_Shuffle_System_Runtime_Intrinsics_Vector128_1_byte_System_Runtime_Intrinsics_Vector128_1_byte_System_Runtime_Intrinsics_Vector128_1_byte'
* Handle SN_Shuffle
* Fix crash in OP_STOREX_MEMBASE
* Add build test
* Set WasmSIMD to false as default value
Also add "experimental" to the property comment
* Remove public API, it will be part of another PR
* Add link to the llvm issue
* Review feedback
* Review feedback
Simon Rozsival [Mon, 6 Jun 2022 09:07:56 +0000 (11:07 +0200)]
[Android] Fix app crash when using non-native HttpClientHandler (#69565)
* Add test
* Avoid null reference exception
* Add missing nullable variable annotations
* Update GetRemoteCertificate method nullability annotations
* Fix compilation error
* Remove test
* Enable System.Net.Http functional tests on Android
* Disable tests which test unsupported code paths
* Fix accessing the underlying handler in tests
* Disable failing tests
* Skip tests that do not work on Android
* TMP: include android tests in outerloop-mono
* Change test attributes
* Simplify null check
* Fix invalid cast
Huo Yaoyuan [Mon, 6 Jun 2022 08:43:54 +0000 (16:43 +0800)]
Remove ternary workaround for string.IsNullOrEmpty (#63095)
Tomas Weinfurt [Mon, 6 Jun 2022 08:18:26 +0000 (10:18 +0200)]
limit retries of EPROTOTYPE on macOS (#69882)
* limit retries of EPROTOTYPE on macOS
* update comment
Tomas Weinfurt [Mon, 6 Jun 2022 08:08:06 +0000 (10:08 +0200)]
allow null TargetHost in SslClientAuthenticationOptions (#69071)
* allow null TargetHost in SslClientAuthenticationOptions
* feedback from review
Beau Gosse [Mon, 6 Jun 2022 07:24:37 +0000 (02:24 -0500)]
Ignoring test for NativeAOT since GetCallingAssembly is unsupported (#70221)
Adeel Mujahid [Mon, 6 Jun 2022 07:21:39 +0000 (10:21 +0300)]
Add support for symbol stripping (#70233)
Bruce Forstall [Mon, 6 Jun 2022 05:03:41 +0000 (22:03 -0700)]
Re-disable `Runtime_56953` (#70258)
Tracking: https://github.com/dotnet/runtime/issues/67870
Jan Kotas [Mon, 6 Jun 2022 00:57:23 +0000 (17:57 -0700)]
Delete ENABLE_REFLECTION_TRACE (#70244)
Jan Kotas [Mon, 6 Jun 2022 00:55:59 +0000 (17:55 -0700)]
[NativeAOT] Fold System.Private.Reflection.Metadata into Corelib (#70241)
Vlad Brezae [Sun, 5 Jun 2022 21:07:46 +0000 (00:07 +0300)]
[mono][interp] Fix performance regression (#70255)
Taking address of `ip` is not only questionable design wise, but also very bad for performance, since it is a hot variable in the interpreter loop that is normally allocated in a register. Taking its address forces spills.
Huo Yaoyuan [Sun, 5 Jun 2022 19:34:47 +0000 (03:34 +0800)]
Delete some dead util code (#70254)
* Delete ParseCommandLine and ISWWHITE
* Delete IS_HEXDIGIT
* Delete self defined Pair
The comments otherwhere should be demonstrating a managed generic
* Delete CStackArray
* Delete TFreeList
Jérôme Laban [Sun, 5 Jun 2022 18:02:14 +0000 (14:02 -0400)]
[Wasm] Restore _free default export for Emcc 3.1.7 or later (#70245)
Tom Deseyn [Sun, 5 Jun 2022 13:38:22 +0000 (15:38 +0200)]
FileSystem.Unix: CreateSymbolicLink: remove unused statement. (#70252)
Stephen Toub [Sun, 5 Jun 2022 12:15:46 +0000 (08:15 -0400)]
Fix regex outerloop tests (#70246)
github-actions[bot] [Sun, 5 Jun 2022 01:18:53 +0000 (18:18 -0700)]
Sync shared code from aspnetcore (#70236)
Co-authored-by: JamesNK <JamesNK@users.noreply.github.com>
Jan Kotas [Sat, 4 Jun 2022 21:47:11 +0000 (14:47 -0700)]
Move Environment.iOS.cs under libraries (#70226)
The file does not contain anything Mono-specific and there is Environment.iOS.cs under libraries already.
SingleAccretion [Sat, 4 Jun 2022 16:13:20 +0000 (19:13 +0300)]
Re-enable Runtime_56953 on ARM64 (#70237)
The assert it was disabled for has since been deleted.
SingleAccretion [Sat, 4 Jun 2022 12:46:17 +0000 (15:46 +0300)]
Consolidate morphing of local nodes (#69819)
* Consolidate morphing of locals
Support all types of local nodes in preparation for allowing
varargs stack args to be transformed by LocalAddressVisitor.
* Morph x86 stack args in LocalAddressVisitor
Fan Yang [Sat, 4 Jun 2022 11:38:42 +0000 (07:38 -0400)]
[Mono] Fix test skipping for mobile device runtime tests (#70023)
Co-authored-by: Přemek Vysoký <premek.vysoky@microsoft.com>
SingleAccretion [Sat, 4 Jun 2022 09:32:19 +0000 (12:32 +0300)]
Utilize VN-based non-null knowledge better (#69808)
Previously, global non-null assertion propagation would give up
on any non-"ADD(LCL_VAR, CONST)"-like trees. This is correct for
actual assertion-based propagation (since we record assertions
based on conservative VNs and those propagate only through locals),
but is unnecessarily conservative when it comes to utilizing
non-nullness provided by VN.
Fix this by moving the IR checks after the VN check.
Margus Veanes [Sat, 4 Jun 2022 09:29:00 +0000 (02:29 -0700)]
Safe size estimation for SymbolicRegexNode (#70139)
Adding a feature to estimate how many NFA states can arise from any given regex R that uses the Nonbacktracking option.
It provides an upper bound that is calculated from the size of R combined with the upper and lower bounds used in repetitions.
If the estimation exceeds a given (configurable) threshold that is 1000 by default, a NonSupportedException is thrown.
The threshold can be configured using a designated AppContext variable.
Added unit tests to validate the estimated bound calculation.
SingleAccretion [Sat, 4 Jun 2022 03:35:14 +0000 (06:35 +0300)]
Delete a little more dead rationalizer code (#70218)
This was a leftover from the initial FEATURE_SIMD implementation.
Andy Ayers [Sat, 4 Jun 2022 01:35:15 +0000 (18:35 -0700)]
JIT: add missing cloning test case and fix jit dump (#70225)
Tom Deseyn [Fri, 3 Jun 2022 20:35:40 +0000 (22:35 +0200)]
Make Cryptography.Pkcs.Tests pass when rsa+sha1 signing is not supported.
Co-authored-by: Kevin Jones <vcsjones@github.com>
David Wrighton [Fri, 3 Jun 2022 19:59:16 +0000 (12:59 -0700)]
Simplify ReadyToRunCompilationGroupBase config (#70192)
- Create a side class used only for holding config
- Pass it through the various types that hold all the compilation group arguments
dotnet-maestro[bot] [Fri, 3 Jun 2022 16:50:53 +0000 (11:50 -0500)]
Update dependencies from https://github.com/dotnet/hotreload-utils build
20220531.2 (#70078)
Microsoft.DotNet.HotReload.Utils.Generator.BuildTool
From Version 1.1.0-alpha.0.22273.2 -> To Version 1.1.0-alpha.0.22281.2
Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Huo Yaoyuan [Fri, 3 Jun 2022 15:43:30 +0000 (23:43 +0800)]
Remove unused winapi mimicking headers under PAL (#70153)
* Delete commctrl, commdlg,. htmlhelp and richedit
* Delete shellapi.h
Usage within apphost.windows and #ifdef Windows are safe
* Remove no longer included winuser.h
* Delete wininet
* Delete urlmon
* Remove wincrypt from unused cpp
* Delete winapifamily
mono usage is under #ifder _MSC_VER
* Delete wtsapi32
* Delete tlhelp32
the remaining mention is never used in coreclr
* Delete shlobj
* Delete share.h
* Delete process.h
this isn't pal/process.h
* Delete new.h
this isn't jitstd/new.h
* Delete aclapi
Andy Ayers [Fri, 3 Jun 2022 15:03:27 +0000 (08:03 -0700)]
JIT: fix invariant analysis for cloning (#70126)
Fix some cases where the JIT was not sufficiently careful in verifying that
operands in a loop were invariant.
Closes #61040.
Vladimir Sadov [Fri, 3 Jun 2022 13:42:29 +0000 (06:42 -0700)]
Some cleanups in Native AOT suspension area (#69885)
* some renames
* strongly typed transition frames
* remove remaining pieces of LoopHijack
* comments and some refactoring
* IsManaged
* removed m_CodeManagerList
* m_ModuleListLock
* better comment for a SafeHandle hack
* Renamed SetupHackPInvokeTunnel (to not have "hack in the name)
* made IsInForbidBlockingRegion a debug-only assert
* removed ForbidBlockingHolder
* remove forbidBlocking tracking. It only affects 4 methods.
* Fix Unix build
* typo
* record managed code range in RuntimeInstance.
Michal Strehovský [Fri, 3 Jun 2022 12:14:37 +0000 (21:14 +0900)]
Consider targets of delegates reflection-visible (#70198)
This is to make sure `Delegate.GetMethodInfo` API works in `IlcTrimMetadata=true` mode. In this mode, the presence of code doesn't automatically mean the method is visible to reflection (we only consider results of dataflow analysis or XML inputs, or `DynamicDependency`). Add delegate targets to this list so that `GetMethodInfo` API reliably works.
The compiler already tracks delegate creation sequence, so adding a callback to `MetadataManager` to inject the dependencies that make the method reflection-visible.
We also handle the situation when the delegate was created to a virtual method and the exact target isn't known until runtime. We do this by injecting conditional dependencies on virtual method implementations.
This change causes a 0.3% size regression on ASP.NET WebApi template with IlcTrimMetadata=true. I spot checked the diffs and they all look correct (there's a lot of delegates being created to support various captures and suddenly those things become reflectable - it's what we want).
Radek Zikmund [Fri, 3 Jun 2022 08:17:54 +0000 (10:17 +0200)]
Update CentOS7 image (#69892)
This updates the CentOS7 image used for libraries CI run to the newest version, which includes updates for `ca-certificates` package which in turn fixes certificate validation issues during test runs.
Carlos Sanchez [Fri, 3 Jun 2022 07:06:27 +0000 (00:06 -0700)]
Do not read position when tar archive stream is unseekable (#70178)
* src: Do not set length nor read position when stream is unseekable.
* tests: Verify can write and read tar.gz archives.
* tests: Add TarWriter test to write to generic unseekable stream.
Adeel Mujahid [Fri, 3 Jun 2022 01:48:25 +0000 (04:48 +0300)]
Add {M}IBC to glossary (#68111)
* Add {M}IBC to glossary
* Modern -> Managed
Levi Broderick [Fri, 3 Jun 2022 01:39:23 +0000 (18:39 -0700)]
Improve Encoding.UTF8.GetMaxByte/CharCount perf (#69910)
- Also fixes some potential integer overflows in callers
- Also updates some code comments
Tanner Gooding [Fri, 3 Jun 2022 00:33:23 +0000 (17:33 -0700)]
Ensure that GT_CNS_VEC is handled in LinearScan::isMatchingConstant (#70171)
* Ensure that GT_CNS_VEC is handled in LinearScan::isMatchingConstant
* Ensure an Arm64 assert includes GT_CNS_VEC
* Update src/coreclr/jit/codegenarmarch.cpp
Co-authored-by: Egor Bogatov <egorbo@gmail.com>
Co-authored-by: Egor Bogatov <egorbo@gmail.com>
Kevin Jones [Thu, 2 Jun 2022 22:27:31 +0000 (18:27 -0400)]
Remove thumbprint allocation in ManagedCertificateFinder
Akhil Indurti [Thu, 2 Jun 2022 22:25:35 +0000 (15:25 -0700)]
fix InstanceDataCollectionCollection_CopyTo by retrying on 0 values (#70119)
* fix InstanceDataCollectionCollection_CopyTo by retrying on 0 values
Previously, when pcc.ReadCategory() returned 0 values, we did not retry,
which broke the test that asserted its length > 0. This time, we retry
when there are 0 values, by triggering the RetryHelper's exception
handler.
Fixes #68291
* add ZeroDataException
* Revert "add ZeroDataException"
This reverts commit
43ba3adf8e5e2967b60309cd2527cdac41076732.
* throw xUnitException instead of making a custom one
* no need for if statement
Egor Bogatov [Thu, 2 Jun 2022 22:24:03 +0000 (01:24 +0300)]
Fix crash on osx-arm64 with Vector3 (#70141)
Jeremy Barton [Thu, 2 Jun 2022 21:03:53 +0000 (14:03 -0700)]
Enable server-side OCSP stapling on Linux
This enables OCSP stapling on Linux when the server uses SslStreamCertificateContext instead of just passing the cert.
On Linux, the SslStreamCertificateContext will perform the background fetches of the OCSP payload
and is responsible for presenting the data to the TLS session during the handshake.
Like other platforms, the OCSP stapling is "best effort" and there's no way to force it to block until ready.
All of the reflection-based HttpClient usage from Linux X509Chain got factored out to a utility type called X509ResourceClient.
Aaron Robinson [Thu, 2 Jun 2022 20:54:51 +0000 (13:54 -0700)]
Update updating-ref-source.md (#70169)
Update flags for using GenAPI.
Zoltan Varga [Thu, 2 Jun 2022 20:43:06 +0000 (16:43 -0400)]
Wasm AOT micro optimizations (#69955)
* [mono][llvm] Fix the detection of the Buffer.Memmove intrinsic.
The arguments changed from pointers to byref types.
* [mono][wasm] Avoid storing literal nulls into the gc pin area, its not needed.
* [mono][llvm] Nullify the arguments of the nullified mini_init_method_rgctx () call as well.
This avoids the generation of an unused MONO_PATCH_INFO_GSHARED_METHOD_INFO.
* [mono][wasm] Enable atomic intrinsics.
LLVM generates correct single threaded code for these even if threads are not enabled.
* Fix.
* [mono][interp] Increase the parameter count limit for interp->jit transitions.
* [mono] Avoid a call to jit_mm_for_class () in mono_class_fill_runtime_generic_context ().
* [mono][llvm] Avoid storing dead/volatile vars into the gc pin area.
Volatile vars are already stored into a stack location.
* [mono][jit] Allow inlining ctors which can be gshared.
This affects ctors like ReadOnlySpan<T>.ctor ().
* [mono][llvm] Avoid storing arguments and results of moves into the gc_pin area.
Jakob Botsch Nielsen [Thu, 2 Jun 2022 20:22:20 +0000 (22:22 +0200)]
Tag myself on area-CodeGen-coreclr issues (#70142)
Jakob Botsch Nielsen [Thu, 2 Jun 2022 19:50:07 +0000 (21:50 +0200)]
JIT: Fix checked/release diff (#70144)
Fix #70143 introduced by #68869
SingleAccretion [Thu, 2 Jun 2022 19:08:45 +0000 (22:08 +0300)]
Delete an old quirk in "gtSetEvalOrder" (#69894)
The quirk prevented us from marking address modes for SIMD types as
NO_CSE, which in most cases is not good for CQ.
Thus, deleting the quirk yields mostly positive diffs, with some small
regressions in ARM64 where "genCreateAddrMode" is not perfect in its
understanding of which address modes are legal.
Buyaa Namnan [Thu, 2 Jun 2022 19:01:57 +0000 (12:01 -0700)]
Enable test that already fixed (#70065)
Eric Erhardt [Thu, 2 Jun 2022 17:58:32 +0000 (11:58 -0600)]
Skip HostAbortedExceptionTests when BinaryFormatter isn't supported (#70151)
Fix #70132
Lakshan Fernando [Thu, 2 Jun 2022 17:13:41 +0000 (10:13 -0700)]
Enable Expression tests for NativeAOT (#69945)
* Enable Expression tests for NativeAOT
* Add debug info
* FB
* FB2
* FB4
Sergio Pedri [Thu, 2 Jun 2022 15:09:29 +0000 (17:09 +0200)]
Move TypeReference.ToObject to managed (CoreCLR) (#70055)
* Initial partial TypedReference.ToObject managed port
* Port rest of mamaged TypeDesc method table logic
* Add RuntimeTypeHandle.GetElementTypeMethodTable FCall
* Remove TypedReference.InternalToObject FCall
* Remove throwing path, add an assert
* Remove unnecessary TypeDesc paths
* Remove ParamTypeDesc::m_TemplateMT and related code
* Fix TypeDesc::GetMethodTable
* Reuse RuntimeTypeHandle.GetValueInternal to drop an FCall
* Add unit tests for TypedReference.ToObject and type desc
* Move ifdef methods to TypedReference.Mono file
* Skip new TypedReference tests on Mono
* Use [ActiveIssue] instead of [SkipOnMono]
* Commented tests out to skip Mono AOT failure
Kevin Jones [Thu, 2 Jun 2022 14:56:13 +0000 (10:56 -0400)]
Use key properties to determine ECC key size for Apple
Remove previous workarounds for determining ECC key sizes since those workarounds only apply to unsupported macOS versions now.
Vitek Karas [Thu, 2 Jun 2022 14:22:06 +0000 (07:22 -0700)]
Improve DisplayNameHelpers for NativeAOT (#70084)
These helpers are used to report names of things in warnings. The functional changes are:
* For method parameters, use the parameter name if available (and only if not fallback to the #1 notation)
* For property accessor methods, use the C# naming scheme, so for example Type.Property.get instead of Type.get_Property.
Both of these changes are in preparation to bring NativeAOT closer in behavior to ILLink and the trim analyzers.
For this I moved some of the helpers to the common shared code.
Some unrelated code cleanup as well.
Co-authored-by: Michal Strehovský <MichalStrehovsky@users.noreply.github.com>
Marie Píchová [Thu, 2 Jun 2022 12:47:14 +0000 (14:47 +0200)]
[QUIC] Latest msquic interop (#69876)
* Latest msquic interop
* Update src/libraries/System.Net.Quic/src/System/Net/Quic/Implementations/MsQuic/Interop/msquic_extensions.cs
* No polyfill for runtime repo
* Feedback
Radek Zikmund [Thu, 2 Jun 2022 10:01:42 +0000 (12:01 +0200)]
Disable flaky DNS cancellation tests during jitstress (#70089)
* Revert "Reenable GetHostAddressesTest_Cancellation on Unix (#70009)"
This reverts commit
e8b95926ed9880156071ee8575a7c22f13675081.
* Revert "Fix flakyness of DnsGetHostAddresses_PostCancelledToken_Throws (#70044)"
This reverts commit
a466063cd273e88276abe9d84eb28dccaf50d633.
* Disable flaky tests on jitstress
* fixup! Disable flaky tests on jitstress
Stephen Toub [Thu, 2 Jun 2022 07:10:11 +0000 (03:10 -0400)]
Exempt MemberNotNullWhen from genapi ref assembly requirements (#70113)
As with MemberNotNull, MemberNotNullWhen is an implementation detail when it refers to a private member (even when attributed on a public API). The tooling shouldn't require it in reference assemblies, as in such situations it a) isn't meaningful to a consumer and b) leaks implementation details.
Andrew Au [Thu, 2 Jun 2022 06:46:26 +0000 (23:46 -0700)]
Fix build issues after enabling TRACE_GC (#69766)