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)
Lakshan Fernando [Thu, 2 Jun 2022 05:13:37 +0000 (22:13 -0700)]
More lib testing with native AOT (#69132)
Carlos Sanchez [Thu, 2 Jun 2022 03:41:19 +0000 (20:41 -0700)]
Resumbmit tar feedback changes, include Android build fix (#69469)
* Address some System.Formats.Tar TODOs (infra and syscalls) (#69107)
Re-submitting the changes approved in PR: https://github.com/dotnet/runtime/pull/69107
Addresses: https://github.com/dotnet/runtime/issues/68230
Includes an extra change to prevent the android build failure with the addition of the new native call to getgrgid_r.
Co-authored-by: carlossanlop <carlossanlop@users.noreply.github.com>
Co-authored-by: Adam Sitnik <adam.sitnik@gmail.com>
Stephen Toub [Thu, 2 Jun 2022 02:43:34 +0000 (22:43 -0400)]
Update Roslyn to pick up recent features / bug fixes / design changes (#70087)
* Update Roslyn to pick up recent features
* Replace a straggling !!
* Fix now erroneous use of u8
* Disable several generic math tests
Ankit Jain [Thu, 2 Jun 2022 01:59:28 +0000 (21:59 -0400)]
[wasm] Add support for symbolicating traces via XHarness (#66226)
* [wasm] Add `WasmSymbolicator` project
- this can be used to symbolicate traces using patterns from
`src/mono/wasm/data/wasm-symbol-patterns.txt`.
- Includes a wrapper that can be passed to xharness for symbolicating
traces in the output.
- This can be used as a command line tool also:
`dotnet run /path/to/dotnet.js.symbols /path/to/traces`
If `-` is passed instead of the last argument, then it reads the
messages from stdin.
* [wasm] Enable xharness+symbolicator for library tests
* [wasm ] startup.ts: improve printing errors
* [wasm] test-main.js: print 'WASM EXIT' message even for non-browser cases
* [wasm] Enable symbols file generation for samples in Release config
* [wasm] Fix file check
* Fix build
* fix dotnet-linker-tests build
* Update condition for using wasmsymbolicator with xharness
* Update build-commons.sh
Revert unnecessary change
* Update gen-buildsys.sh
Revert unnecessary change
* Update build.sh
Revert unnecessary change
Elinor Fung [Thu, 2 Jun 2022 01:01:27 +0000 (18:01 -0700)]
Update test to stop expecting removed diagnostics (#70106)
Tarek Mahmoud Sayed [Thu, 2 Jun 2022 00:41:31 +0000 (17:41 -0700)]
Support more primitive type converters (#70057)
Tomáš Rylek [Wed, 1 Jun 2022 23:45:43 +0000 (01:45 +0200)]
CoreCLR support for default interface implementation of static virtual methods (#66887)
* Move the diamondshape test under StaticVirtualMethods
* Modify the test to exercise static virtual methods
* Fixes to svm_diamondshape to make it build; initial runtime changes
* Partial change for default interface implementations of SVMs
* Additional JIT changes to make default impl's of SVM resolve properly
* Add struct variants for the svm_diamondshape tests
* Add struct and ldftn testing per David's PR feedback
* Remove 'final' check; add reabstraction test cases
* Relax flag checking for reabstracted SVMs; runtime resolution test
Aleksey Kliger (λgeek) [Wed, 1 Jun 2022 23:31:06 +0000 (19:31 -0400)]
[wasm-ep] Implement EventSource counters support; add an EventPipeSessionOptions builder to TS (#69567)
1. Implements support for creating event counters in WebAssembly apps.
**Important change** adds `Thread.IsInternalThreadStartSupported` and `Thread.InternalUnsafeStart()` to `System.Threading.Thread` that can be used by System.Private.CoreLib to start threads on a runtime where `Thread.IsThreadStartSupported` is false.
This is used to create the event counters polling thread.
This is in addition to the native runtime being able to create threads using `mono_thread_create_internal`
2. Coop thread suspend: STW calls `mono_threads_platform_stw_defer_initial_suspend` which postpones suspending a thread until the next GC suspend phase. Doesn't do anything on most platforms. On WASM, suspend the main browser thread after all the other threads are suspended. This helps prevent deadlocks where the main thread is suspended while another thread is doing a call that is proxied to the main thread and cannot complete. By suspending the main thread last, we give it a chance to service the other threads' requests.
2. Adds a `MONO.diagnostics.SessionOptionsBuilder` class that can be used to create an `EventPipeSessionOptions` instance and populate the provider string for an event pipe session.
3. Updated the `browser-eventpipe` sample to create an EventSource and some counters. The sample is now interactive so you have to click "Start Work" in a browser for things to happen.
There's an outstanding issue https://github.com/dotnet/runtime/issues/69568 that will be investigated in a follow-up PR
* Add custom EventSource and counter
- Added a method for coop GC to suspend the main browser thread in the second phase (so that other threads are less likely to deadlock if they delegate work to it)
- Added an event provider builder
- Added a Thread.InternalUnsafeStart() method and a IsInternalThreadStartSupported property. This allows EventSource to start a thread to poll the counter values.
- The sample with counters can now record counter values. But not at the same time as the default configuration (runtime, runtime private, sample profiler). Not sure if it's a wasm issue or a limitation of EventPipe.
* Change ProvidersConfigBuilder to SessionOptionsBuilder
it creates an entire EventPipeSessionOptions object, not just the providers config
* checkout interactive demo
* Add docs; fix whitespace
* more whitespace fixes
* add default arg value to ThrowIfNoThreadStart
* fix build
* Review feedback
Steve Harter [Wed, 1 Jun 2022 22:22:24 +0000 (17:22 -0500)]
Avoid tailcall optimization in invoke test (#70108)
Andy Gocke [Wed, 1 Jun 2022 22:04:48 +0000 (15:04 -0700)]
Move comments about different form factors to the top (#70102)
Stephen Toub [Wed, 1 Jun 2022 21:24:10 +0000 (17:24 -0400)]
Remove more uses of StringBuilderCache (#69683)
* Remove more uses of StringBuilderCache
* Address PR feedback
* Fix missing colon in TimeZone formatting
Jan Kotas [Wed, 1 Jun 2022 19:59:43 +0000 (12:59 -0700)]
Fix state reference of reflection-only loader context (#70094)
Also delete unused winmd related error message
Fix #70074
Ankit Jain [Wed, 1 Jun 2022 19:05:13 +0000 (15:05 -0400)]
[wasm] Fix runtime test failing due to the app running in debug mode (#70050)
* [wasm] Fix runtime test failing due to the app running in debug mode
Fixes https://github.com/dotnet/runtime/issues/69517
- Recent [wasm-app-host commit](
6b3ea401ca20c26dbb5497b0fbbf77b3afc73374) changed `WasmApp.targets` so
`WasmDebugLevel` would be set to enable debugging if
`Configuration==Debug`.
- this broke some runtime tests which depend on tail call
optimizations, which get disabled when debugging is enabled in the
runtime.
- And the wasm apps for the runtime tests are being built with no
configuration set, which defaults to `Debug`. Instead, propogate the
config for the build to the wasm proxy (`WasmTestRunner`) projects too.
Fixes https://github.com/dotnet/runtime/issues/69517 .
* Revert "[wasm] Disable runtime test failing due to stack overflow (#69863)"
This reverts commit
61441fae579149181dc973ae4e58eccd4beef728.
Jan Vorlicek [Wed, 1 Jun 2022 18:40:18 +0000 (20:40 +0200)]
Fix VTableCallHolder writeable mapping size with W^X (#70093)
The size of this holder is dynamic, but when we are creating the writeable
mapping of this holder to initialize its code, we don't take that into account.
So in case the holder is located at the end of a memory page and crosses its
boundary, the writeable mapping covers only the beginning of the holder and
so we either crash during the initialization if the following memory page is
not mapped or read only, or we corrupt a completely unrelated memory page
in case it is mapped and writeable.
The fix is to use the real size of the holder instead of sizeof(...).
Will Smith [Wed, 1 Jun 2022 18:23:50 +0000 (11:23 -0700)]
Creating comma temps differently for SubMulDiv morph (#69770)
* Creating comma temps differently for SubMulDiv morph
* Fixing some formatting. Added comments. Renamed fgMustMakeTemp to fgIsCloneableInvariantOrLocal
* Renaming
* Putting back in a check
* Formatting
* Adding comments
* Formatting
Thays Grazia [Wed, 1 Jun 2022 17:53:30 +0000 (14:53 -0300)]
[wasm][debugging] Adding instructions for native debugging (#69873)
* Adding support to native debugging.
* Remove console.writeline commited by mistake
* Update debugger.md
* Update src/mono/wasm/debugger/debugger.md
Co-authored-by: Aaron Robinson <arobins@microsoft.com>
* Update src/mono/wasm/debugger/debugger.md
Co-authored-by: Larry Ewing <lewing@microsoft.com>
* Update debugger.md
* addressing comments in the PR
* Update WasmApp.Native.targets
* Update WasmApp.Native.targets
* Apply suggestions from code review
Co-authored-by: Ankit Jain <radical@gmail.com>
* Update debugger.md
* Update debugger.md
* Update debugger.md
* Update WasmApp.Native.targets
Co-authored-by: Aaron Robinson <arobins@microsoft.com>
Co-authored-by: Larry Ewing <lewing@microsoft.com>
Co-authored-by: Ankit Jain <radical@gmail.com>
Andrew Au [Wed, 1 Jun 2022 16:22:41 +0000 (09:22 -0700)]
Aggressive GC (#69695)
Ivan Povazan [Wed, 1 Jun 2022 16:09:22 +0000 (18:09 +0200)]
[mono] Support array parameter types of custom attributes in Mono AOT compiler (#69759)
- mono_reflection_create_custom_attr_data_args_noalloc now supports decoding array type parameters of custom attributes
- mono_reflection_create_custom_attr_data_args_noalloc is refactored to use MonoDecodeCustomAttr
- MonoDecodeCustomAttr encapsulates all the information of the decoded custom attribute parameters
- initial support for UnmanagedCallConvAttribute: native-to-managed wrapper generation now takes into account applied custom attributes by updating the method's signature
Fixes [#52977](https://github.com/dotnet/runtime/issues/52977)
Robin Lindner [Wed, 1 Jun 2022 15:45:50 +0000 (17:45 +0200)]
[API Implementation]: Expose `StopTheHostException` (#69404)
* Implement `HostAbortedException` proposal
* Apply suggestions
* Add solution file
Co-authored-by: Eric Erhardt <eric.erhardt@microsoft.com>
Fan Yang [Wed, 1 Jun 2022 15:16:04 +0000 (11:16 -0400)]
Enable mandelbrot-7 (#69915)