platform/upstream/dotnet/runtime.git
2 years ago[wasm][debugger] Fixing race condition (#64394)
Thays Grazia [Mon, 7 Feb 2022 17:24:29 +0000 (14:24 -0300)]
[wasm][debugger] Fixing race condition (#64394)

* Fixing race condition.

* Completely avoid race condition as @lewing suggested.

* keeping old name

* Addressing @radical comments

* Addressing @lewing comments.

* fix unrelated change

* Addressing @lewing comment offline.

2 years agoExplicit test for injecting scoped IServiceProvider (#63225) (#64558)
lord-executor [Mon, 7 Feb 2022 16:35:33 +0000 (17:35 +0100)]
Explicit test for injecting scoped IServiceProvider (#63225) (#64558)

2 years ago[mono] Remove OP_FCONV_TO_U opcode (#64618)
Ulrich Weigand [Mon, 7 Feb 2022 16:06:20 +0000 (17:06 +0100)]
[mono] Remove OP_FCONV_TO_U opcode (#64618)

* Emit OP_FCONV_TO_U8/U4 instead of OP_FCONV_TO_U.

* Remove OP_FCONV_TO_U implementations across all back ends.

* Remove duplicated mono_fconv_u8/u4 icall wrappers.

* Fixes https://github.com/dotnet/runtime/issues/64570

2 years agoBump coverlet version to 3.1.2 (#64875)
Marco Rossignoli [Mon, 7 Feb 2022 14:49:00 +0000 (15:49 +0100)]
Bump coverlet version to 3.1.2 (#64875)

2 years ago[mobile] Add extra HttpClientHandler linker substitution (#64818)
Steve Pfister [Mon, 7 Feb 2022 12:08:48 +0000 (04:08 -0800)]
[mobile] Add extra HttpClientHandler linker substitution (#64818)

Co-authored-by: Eric Erhardt <eric.erhardt@microsoft.com>
Co-authored-by: Steve Pfister <steve.pfister@microsoft.com>
2 years agoNormalize returns after optimizing returned indirs (#64881)
Jakob Botsch Nielsen [Mon, 7 Feb 2022 12:04:49 +0000 (13:04 +0100)]
Normalize returns after optimizing returned indirs (#64881)

This ensures we normalize returned indirs of locals, even when we fold
it into an access of a promoted local's field. This may change a signed
indir into access of an unsigned field, which may need a sign-extending
cast to be inserted.

It is not ideal that fgMorphRetInd can 'lose' this information, but
given that it is a specialized optimization it seems the simplest
solution is to just rely on the follow-up normalization.

Fix #61359

2 years agoImprovements for SpanHelpers.IndexOf (#64872)
Egor Bogatov [Mon, 7 Feb 2022 11:35:12 +0000 (14:35 +0300)]
Improvements for SpanHelpers.IndexOf (#64872)

2 years agoPropagate exception sets for assignments (#64882)
SingleAccretion [Mon, 7 Feb 2022 09:45:37 +0000 (12:45 +0300)]
Propagate exception sets for assignments (#64882)

* Propagate exception sets for block assignments

* Propagate exception sets for simple assignments

* Fix fgValueNumberCastHelper

To not rely on VNs of setup/placeholder args.

* Enable the checker

2 years agoDelete ReflectionModule::m_pCreatingAssembly and PEAssembly::m_creator (#64865)
Jan Kotas [Mon, 7 Feb 2022 06:53:40 +0000 (22:53 -0800)]
Delete ReflectionModule::m_pCreatingAssembly and PEAssembly::m_creator (#64865)

2 years agoJIT: clear lvMustInit from dependent locals (#64877)
Andy Ayers [Mon, 7 Feb 2022 04:59:24 +0000 (20:59 -0800)]
JIT: clear lvMustInit from dependent locals (#64877)

Their initialization is handled by the parent local.

Closes #64808.

2 years agoFix operator precedence consistency in ASCIIUtility.GetIndexOfFirstNonAsciiByte ...
Alexander Köplinger [Sun, 6 Feb 2022 22:04:17 +0000 (23:04 +0100)]
Fix operator precedence consistency in ASCIIUtility.GetIndexOfFirstNonAsciiByte (#64814)

The `&&` operator takes precedence over `||`, make it explicit by wrapping in parenthesis which also makes it consistent with other usages like https://github.com/dotnet/runtime/blob/57bfe474518ab5b7cfe6bf7424a79ce3af9d6657/src/libraries/System.Private.CoreLib/src/System/Text/Unicode/Utf8Utility.Transcoding.cs#L887

Sse2 implies little endian so the check only needs to apply to AdvSimd.

2 years agoMark promoted SIMD locals used by HWIs as DNER (#64855)
SingleAccretion [Sun, 6 Feb 2022 18:59:35 +0000 (21:59 +0300)]
Mark promoted SIMD locals used by HWIs as DNER (#64855)

As the added comment states, we must do this to get dependent
promotion, as otherwise the compiler does not support independent
promotion of structs not fully eliminated from the IR, save some
special cases (such as multi-reg structs).

We will only need to do this very rarely, as otherwise we mark
SIMD locals used by SIMDs/HWIs specially when creating those
nodes so as not to promote them.

This issue was revealed by forward substituion, where we had:

SIMD a = OBJ(ADDR(b)) // b is SIMD too
HWI(a)

And forward-substituted the promoted "b" into "HWI". Notably,
by the time we are forward-substituting, "we cannot really do
anything about it", as struct promotion has already run, and
by the time we get to morph, we too cannot do much save some
gymnastics with conjuring up a tree of inserts from individual
fields.

2 years agoFix link in readytorun-format.md (#64878)
Austin Wise [Sun, 6 Feb 2022 18:39:55 +0000 (10:39 -0800)]
Fix link in readytorun-format.md (#64878)

The link was not rendering correctly, as the link text and target were on separate lines.

2 years agoAdd support for `TYP_BYREF` `LCL_FLD`s to VN (#64501)
SingleAccretion [Sun, 6 Feb 2022 14:48:36 +0000 (17:48 +0300)]
Add support for `TYP_BYREF` `LCL_FLD`s to VN (#64501)

* Do not add a zero-offset FldSeq to LCL_FLD directly

"fgAddFieldSeqForZeroOffset"'s contract is that it is passed
an *address*. If that address is a LCL_FLD, we must use the
"zero-offset sequence map", not the sequence of LCL_FLD itself,
as that represents LCL_FLD's own value, not the value it produces
(LCL_FLD == IND(LCL_FLD_ADDR), and LCL_FLD's sequence is the one
attached to LCL_FLD_ADDR, not IND).

* Fix the same issue in "ChangeOper"

* Read zero-offset FldSeqs on LclFld in VN

2 years ago[mono] Add an 'allow-errors' AOT option. (#64640)
Zoltan Varga [Sun, 6 Feb 2022 11:59:44 +0000 (06:59 -0500)]
[mono] Add an 'allow-errors' AOT option. (#64640)

This can be used to avoid aborting the AOT process if a loader
error occurs. The methods which fail to load will not be AOTed and
the failures will happen at runtime.

Related:
https://github.com/dotnet/runtime/issues/63654

2 years agoJIT: contained memory safety analysis fixes and improvements (#64843)
Andy Ayers [Sun, 6 Feb 2022 06:42:03 +0000 (22:42 -0800)]
JIT: contained memory safety analysis fixes and improvements (#64843)

Fixes a couple of issues exposed by forward sub, where containment analysis
was allowing unsafe reordering of operands.

Closes #64828.

Generalize the safety check so that a store to a local not live into a handler
can be reordered with respect to node causing exceptions. Happily this leads
to almost uniformly better code despite the more stringent checking added above.

Add a workaround for the late callbacks into the containment checker made on
unlinked nodes. Assume these are always safe.

Also add extra checks; fast path early out; assertion in MakeSrcContained.

2 years ago[mono] Allow missing assemblies in llvmonly+interp mode. (#64294)
Zoltan Varga [Sun, 6 Feb 2022 06:23:48 +0000 (01:23 -0500)]
[mono] Allow missing assemblies in llvmonly+interp mode. (#64294)

Part of the fix for https://github.com/dotnet/runtime/issues/51961.

Co-authored-by: Ankit Jain <radical@gmail.com>
2 years agofix broken outerloop test (#64858)
Andy Ayers [Sat, 5 Feb 2022 23:25:50 +0000 (15:25 -0800)]
fix broken outerloop test (#64858)

2 years agoAdd ActivitySource support to DiagnosticsHandler (#64753)
Marie Píchová [Sat, 5 Feb 2022 20:17:17 +0000 (21:17 +0100)]
Add ActivitySource support to DiagnosticsHandler (#64753)

* Brought back changes from https://github.com/dotnet/runtime/pull/54437

* Fixed tests

* feedback

2 years agoSet up an analyzer exception filter to make intermittent failures more actionable...
Jeremy Koritzinsky [Sat, 5 Feb 2022 17:58:42 +0000 (09:58 -0800)]
Set up an analyzer exception filter to make intermittent failures more actionable. (#64836)

Update the Roslyn Testing SDK version and update the DllImportGenerator unit tests to crash in a way that produces a dump for some of our intermittent issues (https://github.com/dotnet/runtime/issues/60909, https://github.com/dotnet/runtime/issues/62223). This mechanism will crash the process during the "exception filter" phase, so it will still have the throwing frame on the stack (no unwinding). Hopefully this will enable us to get more actionable dumps to investigate these issues and determine if they're Roslyn bugs or GC holes.

2 years ago[wasm] Fix scenario specific tests (#64800)
Marek Fišera [Sat, 5 Feb 2022 09:44:06 +0000 (10:44 +0100)]
[wasm] Fix scenario specific tests (#64800)

- Fix including additional scenario test folders as HelixWorkItems.
- Disable `System.Net.WebSockets.Client.Tests` on NodeJS, before we fix NodeJS.
- Fix paths to echo and remote loop servers.

Co-authored-by: Ankit Jain <radical@gmail.com>
2 years agoMove 20H2 queues to server 2022 (#64827)
Santiago Fernandez Madero [Fri, 4 Feb 2022 23:38:38 +0000 (15:38 -0800)]
Move 20H2 queues to server 2022 (#64827)

2 years agoDelete Statement::m_compilerAdded . (#64506)
Sergey Andreenko [Fri, 4 Feb 2022 20:14:56 +0000 (15:14 -0500)]
Delete Statement::m_compilerAdded . (#64506)

2 years ago[wasm] Some cleanup of wasm jobs in runtime-extra-platforms (#64766)
Ankit Jain [Fri, 4 Feb 2022 19:18:01 +0000 (14:18 -0500)]
[wasm] Some cleanup of wasm jobs in runtime-extra-platforms (#64766)

* [wasm] Remove WBT from extra-platforms, as it runs in runtime, and runtime-staging

* [wasm] Run library tests on NodeJS for windows too

.. in `runtime-extra-platforms`.

* [wasm] runtime-extra-platforms: always run the helix step

2 years agomake sure failed SSL does not impact other sessions (#64256)
Tomas Weinfurt [Fri, 4 Feb 2022 18:52:04 +0000 (10:52 -0800)]
make sure failed SSL does not impact other sessions (#64256)

* make sure failed SSL does not imapct other sessions

* move innerError

* feedback from review

* remove try

* feedback from review

2 years agoImprove perf of Enumerable.Sum/Average/Max/Min for arrays and lists (#64624)
Stephen Toub [Fri, 4 Feb 2022 18:49:34 +0000 (13:49 -0500)]
Improve perf of Enumerable.Sum/Average/Max/Min for arrays and lists (#64624)

* Improve perf of Enumerable.Sum/Average/Max/Min for arrays and lists

It's very common to use these terminal functions for quick stats on arrays and lists of values.  Just the overhead of enumerating as an enumerable (involving multiple interface dispatch) per iteration is significant, and it's much faster to directly enumerate the contents of the array or the list.  In some cases, we can further use vectorization to speed up the processing.

This change:
- Adds a helper that does a fast check to see if it can extract a span from an enumerable that's actually an array or a list.  It could be augmented to detect other interesting types, but `T[]` and `List<T>` are the most relevant from the data I've seen, and we can fairly quickly do type checks to get the most benefit for a small amount of cost.
- Uses that helper in the int/long/float/double/decimal overloads of Sum/Average/Min/Max to add a span-based path.
- Vectorizes Sum for float and double
- Vectorizes Average for int, float, and double (the latter two via use of Sum)

* Address PR feedback

2 years agoHandle ((IAsyncResult)task).AsyncWaitHandle.Dispose better in task completion (#64627)
Stephen Toub [Fri, 4 Feb 2022 18:48:28 +0000 (13:48 -0500)]
Handle ((IAsyncResult)task).AsyncWaitHandle.Dispose better in task completion (#64627)

Task's IAsyncResult.AsyncWaitHandle implementation lazily creates a ManualResetEventSlim, which is then set as part of the Task completing.  That AsyncWaitHandle is exposed publicly out of the surface area.  If code (arguably erroneously) Dispose's of that WaitHandle before the Task has completed, the task's completion routine will incur an ObjectDisposedException, which will propagate out and potentially disrupt caller logic or even crash the process if allowed to propagate on a thread without user code to catch it.

This just adds a catch (ObjectDisposedException) block to eat such an exception in order to make the system more reliable in the face of such spooky action at a distance.

2 years agoTrack local var ranges for "interfering writes" LIR check (#64804)
Jakob Botsch Nielsen [Fri, 4 Feb 2022 18:00:25 +0000 (19:00 +0100)]
Track local var ranges for "interfering writes" LIR check (#64804)

For LIR we verify that we can really consider locals to be used at their
user by having a checker that looks for interfering stores to the same
locals. However, in some cases we may have "interfering"
GT_LCL_FLD/GT_STORE_LCL_FLD, in the sense that they work on the same
local but on a disjoint range of bytes. Add support to validate this.

This fixes #57919 which made the fuzzer jobs very noisy and made it easy
to miss actual new examples (e.g. #63720 was just merged even though
there were real examples found there).

Fix #57919

2 years ago[wasm] pass ExitStatus when calling quit_ (#64734)
Pavel Savara [Fri, 4 Feb 2022 17:42:30 +0000 (18:42 +0100)]
[wasm] pass ExitStatus when calling quit_ (#64734)

* pass ExitStatus when calling quit_
* set noExitRuntime
* fix double throw
* enable 64727 tests

2 years agoFix outerloop AcceptAsync_WithTooSmallReceiveBuffer_Failure test (#64758)
Stephen Toub [Fri, 4 Feb 2022 16:18:14 +0000 (11:18 -0500)]
Fix outerloop AcceptAsync_WithTooSmallReceiveBuffer_Failure test (#64758)

* Fix outerloop AcceptAsync_WithTooSmallReceiveBuffer_Failure test

* Remove [Outerloop] per PR feedback

2 years agomono_get_generic_info_from_stack_frame fix for default interface methods (#64566)
Bill Holmes [Fri, 4 Feb 2022 15:19:13 +0000 (10:19 -0500)]
mono_get_generic_info_from_stack_frame fix for default interface methods (#64566)

The context is a MonoMethodRuntimeGenericContext when the method is a
default interface method.

Also re-enable broken DIM tests.

Fixes dotnet/runtime #62334

2 years agoSplit out clr.tools unit tests (#64788)
Michal Strehovský [Fri, 4 Feb 2022 08:03:09 +0000 (17:03 +0900)]
Split out clr.tools unit tests (#64788)

Don't even build them as part of the clr subset, only on demand.

2 years ago[wasm] Disable failing tests (#64759)
Ankit Jain [Fri, 4 Feb 2022 06:26:40 +0000 (01:26 -0500)]
[wasm] Disable failing tests (#64759)

* [wasm][aot] Disable failing tests

`Microsoft.Extensions.HostFactoryResolver.Tests`: https://github.com/dotnet/runtime/issues/64724
`Microsoft.Extensions.Logging.Tests`: https://github.com/dotnet/runtime/issues/64725

* [wasm][aot] Disable `System.Text.Json.SourceGeneration.Roslyn3.11.Unit.Tests`

.. on linux.

Fixes https://github.com/dotnet/runtime/issues/64762 .
Real issue being tracked in https://github.com/dotnet/runtime/issues/61339

* disable failing nodejs samples

* [wasm] Disable more failing tests

System.Linq.Tests: https://github.com/dotnet/runtime/issues/64774
System.Text.Json.Tests: https://github.com/dotnet/runtime/issues/64775

* Disable System.Text.RegularExpressions.Tests due to issue#64769

2 years agoExpose Comment in ZipArchive and ZipArchiveEntry (#59442)
Carlos Sanchez [Fri, 4 Feb 2022 03:35:38 +0000 (19:35 -0800)]
Expose Comment in ZipArchive and ZipArchiveEntry (#59442)

Co-authored-by: Adam Sitnik <adam.sitnik@gmail.com>
2 years agofix some test for FreeBSD (#64426)
Tomas Weinfurt [Fri, 4 Feb 2022 01:40:45 +0000 (17:40 -0800)]
fix some test for FreeBSD (#64426)

* fix some test for FreeBSD

* remove changes in IPGlobalPropertiesTest

* disable AddLongHeader_DoesNotThrow

* update description for skip

2 years agoFix issue in r2rdump where conflicting generic instantiations can cause the r2rdump...
David Wrighton [Fri, 4 Feb 2022 00:56:51 +0000 (16:56 -0800)]
Fix issue in r2rdump where conflicting generic instantiations can cause the r2rdump process to fail (#64772)

- This fix ignores the problem, and will produce somewhat wrong results when looking at the PGO data of an R2R binary, but it will at least permit the R2R file to be looked at

Fixes #64291

2 years agoJIT: simple forward substitution pass (#63720)
Andy Ayers [Fri, 4 Feb 2022 00:45:07 +0000 (16:45 -0800)]
JIT: simple forward substitution pass (#63720)

Extend ref counting done by local morph so that we can determine
single-def single-use locals.

Add a phase that runs just after local morph that will attempt to
forward single-def single-use local defs to uses when they are in
adjacent statements.

Fix or work around issues uncovered elsewhere:
* `gtFoldExprCompare` might fold "identical" volatile subtrees
* `fgGetStubAddrArg` cannot handle complex trees
* some simd/hw operations can lose struct handles
* some calls cannot handle struct local args
* morph expects args not to interfere
* fix arm; don't forward sub no return calls
* update debuginfo test (we may want to revisit this)
* handle subbing past normalize on store assignment
* clean up nullcheck of new helper

Addresses #6973 and related issues. Still sorting through exactly
which ones are fixed, so list below may need revising.

Fixes #48605.
Fixes #51599.
Fixes #55472.

Improves some but not all cases in #12280 and #62064.

Does not fix #33002, #47082, or #63116; these require handling multiple
uses or bypassing statements.

2 years agoMitigate #60154 (#63357)
Egor Chesakov [Thu, 3 Feb 2022 22:14:29 +0000 (14:14 -0800)]
Mitigate #60154 (#63357)

Disable intrinsics tests that throw NotSupportedPlatformException on the corresponding platforms:

* Add JIT/HardwareIntrinsics/** to ExcludeList on Arm32 in src/tests/issues.targets

* Add JIT/HardwareIntrinsics/General/Vector256/** to ExcludeList on Arm64 in src/tests/issues.targets

* Add JIT/HardwareIntrinsics/X86/** to ExcludeList on Arm64 in src/tests/issues.targets

* Add JIT/HardwareIntrinsics/General/Vector64/** to ExcludeList on X64 in src/tests/issues.targets

* Add JIT/HardwareIntrinsics/Arm/** to ExcludeList on X64 in src/tests/issues.targets

* Add JIT/HardwareIntrinsics/General/Vector64/** to ExcludeList on X86 in src/tests/issues.targets

* Add JIT/HardwareIntrinsics/Arm/** to ExcludeList on X86 in src/tests/issues.targets

2 years ago[wasm][debugger] Fix some racy tests (#64712)
Ankit Jain [Thu, 3 Feb 2022 21:39:47 +0000 (16:39 -0500)]
[wasm][debugger] Fix some racy tests (#64712)

* re-enable some tests

* [wasm][debugger] Fix racy test - ExceptionTestAllWithReload

This test is set up to pause on all exceptions. So, it has some code to
hit `Debugger.resume` 100 times, hoping to skip all the non-user code
exceptions. But this can sometimes not be enough, and you might have
more exceptions which breaks rest of the test.

Instead, we try to resume till we won't get paused for a period of
10secs. And after that, we can call the user code, and execute rest of
the test.

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

* [wasm][debugger] Fix racy tests that use late loaded assemblies

`DebuggerTests.MiscTests.DebugLazyLoadedAssemblyWithEmbeddedPdb`
`DebuggerTests.BreakpointTests.BreakpointInAssemblyUsingTypeFromAnotherAssembly_BothDynamicallyLoaded`

These tests load assemblies dynamically, and depend on breakpoints in
those assemblies being resolved. But the tests don't wait for that to
happen. So, they can some times fail when the managed method is invoked
before the breakpoint being resolved.

Fixes https://github.com/dotnet/runtime/issues/62823
Fixes https://github.com/dotnet/runtime/issues/62667

2 years agoDeduplicate class names under JIT/Methodical/cctor (#64710)
Tomáš Rylek [Thu, 3 Feb 2022 21:35:34 +0000 (22:35 +0100)]
Deduplicate class names under JIT/Methodical/cctor (#64710)

In this particular class of tests deduplicating tests via
namespace names is not useful as they use common modules
expecting the namespaces to match.

Thanks

Tomas

2 years agoUse ordinal comparison for known header values (#64702)
Miha Zupan [Thu, 3 Feb 2022 21:33:02 +0000 (13:33 -0800)]
Use ordinal comparison for known header values (#64702)

* Use ordinal comparison for known header values

* Match 'text/html; charset=UTF-8' again

2 years agoDeduplicate single-assembly vs. multi-assembly stringintern tests (#64709)
Tomáš Rylek [Thu, 3 Feb 2022 21:32:36 +0000 (22:32 +0100)]
Deduplicate single-assembly vs. multi-assembly stringintern tests (#64709)

This is an interesting special example of deduplication where each of the tests (Test1, Test2, Test4)
runs alternatively in a single-assembly or multiple-assembly mode (compiled together with the
dependent source files teststr.cs / testgenstr.cs vs. using them via dependent projects
teststr.csproj / testgenstr.csproj).

As the actual content of the test source code is the same in both cases and just Roslyn-compiles
slightly differently based on the project structure, I have come to the conclusion that in this particular
case the least amount of churn can be achieved via a preprocessor define that is used to variate the
class name in the main test source files.

The tests were originally building in three flavors - "in-assembly", "cross-assembly" and "cross-module".
I have deleted the "cross-module" variants as I believe that they are identical to "cross-assembly".

Thanks

Tomas

2 years agoMove explicit coverage entry points into separate public classes (#64708)
Tomáš Rylek [Thu, 3 Feb 2022 21:31:34 +0000 (22:31 +0100)]
Move explicit coverage entry points into separate public classes (#64708)

Previously I refactored these tests by moving the entrypoints from
the shared body_xxx source files into the test-specific expl_*
and seq_* source files but I didn't realize I'd also need to put
them into new uniquely named classes as we clearly cannot distinguish
30 methods named AA.TestEntrypoint().

Thanks

Tomas

2 years agoClean up remaining tests under JIT/Methodical using Environment.Exit (#64706)
Tomáš Rylek [Thu, 3 Feb 2022 21:28:38 +0000 (22:28 +0100)]
Clean up remaining tests under JIT/Methodical using Environment.Exit (#64706)

2 years agoUpdate mac Helix queues (#64565)
Andy Gocke [Thu, 3 Feb 2022 20:57:20 +0000 (12:57 -0800)]
Update mac Helix queues (#64565)

* Update mac Helix queues

* Adjust test to account for Mac RID changes

* Disable DllImport probing test on Mac

* Disable profiler.multiple on Mac

2 years agoRefactor fgValueNumberBlockAssignment (#64110)
SingleAccretion [Thu, 3 Feb 2022 20:56:38 +0000 (23:56 +0300)]
Refactor fgValueNumberBlockAssignment (#64110)

"fgValueNumberBlockAssignment" had a very interesting oddity:
it re-VNs the source tree of the assignment. This is unnecessary,
and is in fact a pessimization, as it means we will fail to VN
assignments from sources it does not understand. This change
fixes that, bringing along some positive diffs from numbering
stores from field indirections.

"fgValueNumberBlockAssignment" also needs to maintaint the
invariant that a location's VN will always match its type.
It was failing to do that in cases where the assignment's
source was not local. This change fixes that.

Finally, this change unifies the code common to numbering
"CopyBlk" and "InitBlk" cases. There is no need for them to
be different.

2 years agoBump up visibility for several helper types under JIT/Methodical (#64716)
Tomáš Rylek [Thu, 3 Feb 2022 19:51:14 +0000 (20:51 +0100)]
Bump up visibility for several helper types under JIT/Methodical (#64716)

This change converts a small number of special tests to use the
[Fact] style. These tests are atypical in using various internal
types declared in their source code as fields in the test class;
bumping up test class visibility to public requires transitive
modifications to visibility of the helper types.

Thanks

Tomas

2 years agoPass IV through cipher resets for OpenSSL and Android
Kevin Jones [Thu, 3 Feb 2022 19:13:55 +0000 (14:13 -0500)]
Pass IV through cipher resets for OpenSSL and Android

2 years agoValidate behavior of ProcessInfo command before and after suspension point (#63382)
John Salem [Thu, 3 Feb 2022 18:12:18 +0000 (10:12 -0800)]
Validate behavior of ProcessInfo command before and after suspension point (#63382)

This only applies to CoreCLR Unix processes.

2 years agoLogging Source Generator - Adds support to `@` signed prefixed parameters (#64663)
Maryam Ariyan [Thu, 3 Feb 2022 17:58:47 +0000 (09:58 -0800)]
Logging Source Generator - Adds support to `@` signed prefixed parameters (#64663)

* Adds support to `@` signed prefixed parameters

Fixes #60968

* Move repetitive logic to a new property

* Remove NeedsAtSign

2 years agoUpdate dependencies from https://github.com/dotnet/linker build 20220131.3 (#64615)
dotnet-maestro[bot] [Thu, 3 Feb 2022 17:52:28 +0000 (18:52 +0100)]
Update dependencies from https://github.com/dotnet/linker build 20220131.3 (#64615)

Microsoft.NET.ILLink.Tasks
 From Version 7.0.100-1.22078.1 -> To Version 7.0.100-1.22081.3

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
2 years ago[main] Update dependencies from dotnet/icu dotnet/arcade dotnet/emsdk dotnet/roslyn...
dotnet-maestro[bot] [Thu, 3 Feb 2022 17:48:21 +0000 (18:48 +0100)]
[main] Update dependencies from dotnet/icu dotnet/arcade dotnet/emsdk dotnet/roslyn-analyzers (#64678)

* Update dependencies from https://github.com/dotnet/icu build 20220201.1

Microsoft.NETCore.Runtime.ICU.Transport
 From Version 7.0.0-preview.2.22081.1 -> To Version 7.0.0-preview.2.22101.1

* Update dependencies from https://github.com/dotnet/roslyn-analyzers build 20220201.5

Microsoft.CodeAnalysis.NetAnalyzers
 From Version 7.0.0-preview1.22081.3 -> To Version 7.0.0-preview1.22101.5

* Update dependencies from https://github.com/dotnet/arcade build 20220130.1

Microsoft.DotNet.XUnitConsoleRunner , Microsoft.DotNet.CodeAnalysis , Microsoft.DotNet.Build.Tasks.Workloads , Microsoft.DotNet.Build.Tasks.Templating , Microsoft.DotNet.Build.Tasks.TargetFramework.Sdk , Microsoft.DotNet.Build.Tasks.Packaging , Microsoft.DotNet.Build.Tasks.Installers , Microsoft.DotNet.Build.Tasks.Feed , Microsoft.DotNet.Build.Tasks.Archives , Microsoft.DotNet.Arcade.Sdk , Microsoft.DotNet.ApiCompat , Microsoft.DotNet.XUnitExtensions , Microsoft.DotNet.GenAPI , Microsoft.DotNet.VersionTools.Tasks , Microsoft.DotNet.GenFacades , Microsoft.DotNet.SharedFramework.Sdk , Microsoft.DotNet.RemoteExecutor , Microsoft.DotNet.PackageTesting , Microsoft.DotNet.Helix.Sdk
 From Version 2.5.1-beta.22075.6 -> To Version 2.5.1-beta.22080.1

* Update dependencies from https://github.com/dotnet/emsdk build 20220202.3

Microsoft.NET.Workload.Emscripten.Manifest-7.0.100
 From Version 7.0.0-alpha.2.22078.1 -> To Version 7.0.0-alpha.2.22102.3

* Update dependencies from https://github.com/dotnet/roslyn-analyzers build 20220202.1

Microsoft.CodeAnalysis.NetAnalyzers
 From Version 7.0.0-preview1.22081.3 -> To Version 7.0.0-preview1.22102.1

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: Viktor Hofer <viktor.hofer@microsoft.com>
2 years agoDisable some library tests on ARMv6 architecture due to failures (#64733)
Maxim Lipnin [Thu, 3 Feb 2022 17:13:52 +0000 (20:13 +0300)]
Disable some library tests on ARMv6 architecture due to failures (#64733)

Related issues:

[mono][arm6][linux] System.Net.Ping.Functional.Tests failed #64673
[mono][arm6][linux] System.Net.Tests.ServicePointManagerTest.FindServicePoint_Collectible failed. #64674
[mono][arm6][linux] System.Reflection.Tests.ModuleTests.GetField failed #64675

Co-authored-by: Adeel Mujahid <3840695+am11@users.noreply.github.com>
2 years agoThrow PNSE if insufficient privileges when custom Ping payload was specified (#64625)
Radek Zikmund [Thu, 3 Feb 2022 16:53:52 +0000 (17:53 +0100)]
Throw PNSE if insufficient privileges when custom Ping payload was specified (#64625)

2 years agoUpdate Maui Workload Install Process for Perf (#64692)
Parker Bibus [Thu, 3 Feb 2022 16:34:33 +0000 (10:34 -0600)]
Update Maui Workload Install Process for Perf  (#64692)

*  Add dotnet install and run to test if new dotnet version can be installed similar to how it is done in the Maui repo.

* Download and use local dotnet version.

* Use updated dotnet for more of the pipeline.

* Test with made runtime packs and and add ios arm pack substitution.

* Try building instead of publishing.

* Reenable everything for full test run.

* Package name now seems to default to lower case, at least for maui.

2 years agoWorkaround permission issue on Android API30 emulators when pulling test results...
Alexander Köplinger [Thu, 3 Feb 2022 15:52:54 +0000 (16:52 +0100)]
Workaround permission issue on Android API30 emulators when pulling test results (#64744)

See https://github.com/dotnet/xharness/issues/385, we use the cache dir instead on API 30.

Also add `a:exported="true"` which is required when targetting a newer minSdkVersion.

2 years agoPrefer "mov reg, wzr" over "mov reg, #0" (#64740)
Egor Bogatov [Thu, 3 Feb 2022 15:41:01 +0000 (18:41 +0300)]
Prefer "mov reg, wzr" over "mov reg, #0" (#64740)

2 years agoConsume renamed TargetFramework package (#64670)
Viktor Hofer [Thu, 3 Feb 2022 14:32:50 +0000 (15:32 +0100)]
Consume renamed TargetFramework package (#64670)

* Consume renamed TargetFramework package

* Rename CoreLibs generator parent dir

Projects under src/libraries/ which are located under a "gen" directory
are automatically treated as source generator projects. Because the
CoreLib generator was placed under a different directory "generators",
it was treated as a RuntimeAssembly which gets binplaced into the
runtime path. The runtime tests then take the assemblies from there and
copy them into their CORE_ROOT directory.

Renaming the CoreLib source generators parent directory fixes that so
that it is treated as source generator and it brings consistency into
src/libraries.

2 years ago#55822 Disable CanRecurseFrom root for andoid (#64682)
Meri Khamoyan [Thu, 3 Feb 2022 13:33:37 +0000 (17:33 +0400)]
#55822 Disable CanRecurseFrom root for andoid (#64682)

2 years agoJIT: Import string.Empty as "" (#64530)
Egor Bogatov [Thu, 3 Feb 2022 12:07:51 +0000 (15:07 +0300)]
JIT: Import string.Empty as "" (#64530)

Co-authored-by: Jakob Botsch Nielsen <Jakob.botsch.nielsen@gmail.com>
2 years agoFix test build command in docs/workflow/building/coreclr/nativeaot.md (#64690)
Michał Zegan [Thu, 3 Feb 2022 11:35:43 +0000 (12:35 +0100)]
Fix test build command in docs/workflow/building/coreclr/nativeaot.md (#64690)

The command `src/tests/build[.cmd|.sh] nativeaot [Debug|Release] tree nativeaot` seems not to work as expected.
Namely it seems to build not only the nativeaot smoke tests.
Fixed to be `src\tests\build[.cmd|.sh] -nativeaot [Debug|Release] -tree:nativeaot`

2 years agoCheck for multicast delegate before comparing invocation lists (#64729)
Michal Strehovský [Thu, 3 Feb 2022 10:52:34 +0000 (19:52 +0900)]
Check for multicast delegate before comparing invocation lists (#64729)

Fixes issue discovered in https://github.com/dotnet/runtime/pull/64404#discussion_r797220167.

The existing code worked but there is an off chance that a different kind of delegate (not multicast) could be storing a number in `m_extraFunctionPointerOrData` that matches the length of this delegate (length is stored in `m_extraFunctionPointerOrData`), making us fail with `InvalidCast`. We should only compare invocation lists once we know both delegates are multicast.

2 years agoAdd `--jitpath` parameter to ILC (#64731)
Michal Strehovský [Thu, 3 Feb 2022 10:50:38 +0000 (19:50 +0900)]
Add `--jitpath` parameter to ILC (#64731)

Matches crossgen2.

2 years agofixup more helix pools (#64718)
Larry Ewing [Thu, 3 Feb 2022 07:42:52 +0000 (01:42 -0600)]
fixup more helix pools (#64718)

2 years ago[wasm] Enable WasmTemplateTests on CI (#64589)
Ankit Jain [Thu, 3 Feb 2022 07:14:40 +0000 (02:14 -0500)]
[wasm] Enable WasmTemplateTests on CI (#64589)

2 years agoImprove metadata generation resiliency (#64715)
Michal Strehovský [Thu, 3 Feb 2022 05:44:02 +0000 (14:44 +0900)]
Improve metadata generation resiliency (#64715)

The compiler avoids dealing with things that don't resolve and we have handling for those in place to turn them into runtime exceptions.

We hit a situation when it doesn't kick in:

* We're working with a nested type that is fine, but it's owning type is not (it implements an interface that doesn't resolve).
* The protections within the compiler kick in and avoid bringing the containing type into compilation.
* Once we're done compiling, we need to generate native reflection metadata for the nested type and that requires generating native metadata for the owning type. We don't have protections there because it's too late to do anything about it.

I'm adding code that skips problematic parts of the metadata.

This is a slight compat problem because doing a `typeof(NestedType).DeclaringType` would throw on JIT-based CoreCLR, but will now succeed on NativeAOT-based CoreCLR. The returned type will have an empty interface list. The compat in this corner case probably doesn't matter much.

2 years ago[wasm][debugger] Fix racy page reload test (#64695)
Ankit Jain [Thu, 3 Feb 2022 04:03:36 +0000 (23:03 -0500)]
[wasm][debugger] Fix racy page reload test (#64695)

* [wasm][debugger] Fix racy page reload test

`BreakpointTests.CreateGoodBreakpointAndHitGoToWasmPageWithoutAssetsComeBackAndHitAgain`

1. the test loads the regular app page
2. then it reloads the page by calling `load_wasm_page_without_assets()`
   a. then waits for 1 sec
3. then it reloads again by calling `reload_wasm_page()`
   a. then `insp.WaitFor(Inspector.READY)`

the READY notification after the second reload is never read. Instead,
it tries to wait for the notification after the third reload, but that
immediately returns because of the second one, instead of waiting for a
new one.

Fix is to correctly wait for a READY after the second reload.

Another way to do this might be to clear the notifications when a new
page gets loaded (`executionContextCreated`?), but that would be a bit
magical, and isn't needed by any test right now.

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

* [wasm][debugger] Fix racy test - ExceptionTestAllWithReload

This test is set up to pause on all exceptions. So, it has some code to
hit `Debugger.resume` 100 times, hoping to skip all the non-user code
exceptions. But this can sometimes not be enough, and you might have
more exceptions which breaks rest of the test.

Instead, we try to resume till we won't get paused for a period of
10secs. And after that, we can call the user code, and execute rest of
the test.

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

* Revert "[wasm][debugger] Fix racy test - ExceptionTestAllWithReload"

This reverts commit 10d40720dec3410bc9944d159d374223a53f7d67.

2 years ago[wasm] Emscripten 2.0.34 bump (#62499)
Radek Doulik [Thu, 3 Feb 2022 04:02:19 +0000 (05:02 +0100)]
[wasm] Emscripten 2.0.34 bump (#62499)

* Initial changes for emscripten 2.0.34

* Use emcc-link.rsp in build targets

* Use updated docker images

* Fix compiler warnings

Co-authored-by: Zoltan Varga <vargaz@gmail.com>
* Put `--profiling-funcs` to `_EmccLinkFlags`

* Fix build

    src/mono/mono/mini/mini-runtime.c:3407:25: error: ‘invoke’ undeclared (first use in this function); did you mean ‘revoke’?
       3407 |                         invoke = mono_marshal_get_runtime_invoke_dynamic ();

* Add shell to the environment

Environment setting https://github.com/emscripten-core/emscripten/blob/2.0.34/src/settings.js#L616-L641

From emscripten 2.0.25 release notes

    - Support for the 'shell' environment is now disabled by default.  Running under
      `d8`, `js`, or `jsc` is not something that most emscripten users ever want to
      do, so including the support code is, more often than not, unnecessary.  Users
      who want shell support can enable it by including 'shell' in `-s ENVIRONMENT`
      (#14535).

Example of the the size increase for bench sample:

    -a---          12/10/2021  3:35 PM         382113 dotnet.js
    -a---          12/13/2021 10:37 AM         383589 dotnet.js

* Add emcc-link.rsp to PlatformManifestFileEntry

* Feedback

https://github.com/emscripten-core/emscripten/blob/2fda25eea756c78c8cb024aa5b6c2b188bf7990f/src/settings.js#L1173-L1176

-s EXPORT_ES6 is link option

* Use new Emscripten workload

* Remove unused variable

* Add the emcc-link.rsp

* Bump dotnet icu

* Feedback

* Do not add linker flags to compilation

* Split `_EmccLDFlags`

To avoid these errors:

WasmApp.Native.targets(342,5): error : Failed to compile .../Microsoft.CodeAnalysis.CSharp.dll.bc -> /datadisks/disk1/work/B9F209B7/w/B1710A2F/e/wasm_build/obj/wasm/for-build/Microsoft.CodeAnalysis.CSharp.dll.o
WasmApp.Native.targets(342,5): error : emcc: warning: linker setting ignored during compilation: 'TOTAL_MEMORY' [-Wunused-command-line-argument]
WasmApp.Native.targets(342,5): error : emcc: warning: linker setting ignored during compilation: 'ERROR_ON_UNDEFINED_SYMBOLS' [-Wunused-command-line-argument]

* Bump emscripten workload

* Update windows helix queues

* [wasm] Fix WBT running with nodejs

When running with nodejs, the managed app would exit with code 42, but
node would exit with 1. Use `process.exit` for node, instead of
`mono_wasm_exit`.

Co-authored-by: Radek Doulik <radekdoulik@google.com>
Co-authored-by: Zoltan Varga <vargaz@gmail.com>
Co-authored-by: Larry Ewing <lewing@microsoft.com>
Co-authored-by: Ankit Jain <radical@gmail.com>
Co-authored-by: Steve Pfister <steve.pfister@microsoft.com>
2 years agoUpdate windows helix queues (#64699)
Steve Pfister [Wed, 2 Feb 2022 23:04:24 +0000 (15:04 -0800)]
Update windows helix queues (#64699)

2 years agoAdd notes about ignored checks to sperpmi-asmdiffs and enterprise-linux pipelines...
Přemek Vysoký [Wed, 2 Feb 2022 20:22:24 +0000 (21:22 +0100)]
Add notes about ignored checks to sperpmi-asmdiffs and enterprise-linux pipelines (#64685)

2 years agoBegin using the xplat hardware intrinsics in BitArray (#63722)
Tanner Gooding [Wed, 2 Feb 2022 19:54:56 +0000 (11:54 -0800)]
Begin using the xplat hardware intrinsics in BitArray (#63722)

* Change the BitArray(bool[]) constructor to use the xplat intrinsics

* Change the And, Or, Xor, and Not methods to use the xplat intrinsics

2 years ago[wasm][debugger] Fix some flaky tests (#64652)
Ankit Jain [Wed, 2 Feb 2022 19:25:10 +0000 (14:25 -0500)]
[wasm][debugger] Fix some flaky tests (#64652)

2 years agoDelete InternalModuleBuilder and InternalAssemblyBuilder (#64662)
Jan Kotas [Wed, 2 Feb 2022 18:33:07 +0000 (10:33 -0800)]
Delete InternalModuleBuilder and InternalAssemblyBuilder (#64662)

* Delete InternalAssemblyBuilder
* Delete InternalModuleBuilder

These wrapper types were required for CAS (Code Access Security). They should not be needed anymore. Mono does not have them either.

2 years agoMember resolving fix for derived attributes (#62937) (#63837)
Kloizdena [Wed, 2 Feb 2022 18:26:14 +0000 (19:26 +0100)]
Member resolving fix for derived attributes (#62937) (#63837)

* Member resolving fix for derived attributes (#62937)

* Added property with simple [Required] attribute

2 years ago[wasm][debugger] Implement support to Set Next Instruction Pointer. (#64114)
Thays Grazia [Wed, 2 Feb 2022 17:35:59 +0000 (14:35 -0300)]
[wasm][debugger] Implement support to Set Next Instruction Pointer. (#64114)

* Implement Set Next Instruction Pointer.

* Addressing @radical comments.

* Checking if the line number is inside the same function.
Adding test for it.
Adding test for moving the IP to a line that has already a breakpoint.

* Creating tests in async function and lambda as suggested by @radical

* Addressing @radical comments.

* Addressing @radical comments offline

* Adding comment to explain dual invocations.

* Removing unnecessary code.

* Addressing @radical comments.

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

Co-authored-by: Ankit Jain <radical@gmail.com>
* Addressing @radical comments.

* Apply suggestions from code review

Co-authored-by: Ankit Jain <radical@gmail.com>
* Removing unnecessary code.Addressing @radical comments.

* Addressing @radical comments.

* Added test as suggested offline by @radical

* Creating tests as suggested by @radical.

* Adding test as suggested by @radical.
Fixing behavior of this new test: moving IP to a nested function.

* Changing order in test.

* Creating new test suggested by @radical.

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

Co-authored-by: Ankit Jain <radical@gmail.com>
* Addressing @radical comments.

* Addressing @radical comments.

Co-authored-by: Ankit Jain <radical@gmail.com>
2 years agoRemove extra blank space with generated code (#64666)
Maryam Ariyan [Wed, 2 Feb 2022 17:26:53 +0000 (09:26 -0800)]
Remove extra blank space with generated code (#64666)

2 years agoRevert emscripten bump temporarily (#64664)
Larry Ewing [Wed, 2 Feb 2022 16:36:37 +0000 (10:36 -0600)]
Revert emscripten bump temporarily (#64664)

2 years agoAdd tests for `ref` field overlap with OBJECTREF and non-aligned `ref` fields. (...
Aaron Robinson [Wed, 2 Feb 2022 16:27:09 +0000 (08:27 -0800)]
Add tests for `ref` field overlap with OBJECTREF and non-aligned `ref` fields. (#64643)

* Add tests for `ref` field overlap with OBJECTREF and non-aligned `ref` fields.

2 years agoFix some nullability warnings in NativeAOT CoreLib (#64404)
Andrii Kurdiumov [Wed, 2 Feb 2022 13:56:18 +0000 (19:56 +0600)]
Fix some nullability warnings in NativeAOT CoreLib (#64404)

I fix only most trivial where I fully understand what's going on.
I will take a look at other too, maybe in subsequent PRs.
This is related to https://github.com/dotnet/runtimelab/issues/106

2 years agoAvoid downcasting NewSize (#64661)
Andrew Au [Wed, 2 Feb 2022 13:13:04 +0000 (05:13 -0800)]
Avoid downcasting NewSize (#64661)

2 years agoChange message for uncompilable methods (#64669)
Michal Strehovský [Wed, 2 Feb 2022 13:09:49 +0000 (22:09 +0900)]
Change message for uncompilable methods (#64669)

The method itself is not unresolved - there's something wrong within the method body.

2 years agoDisable a few ECKeyFileTests on Android 31 and later (#64533)
Alexander Köplinger [Wed, 2 Feb 2022 12:46:14 +0000 (13:46 +0100)]
Disable a few ECKeyFileTests on Android 31 and later (#64533)

They fail there, see https://github.com/dotnet/runtime/issues/64446

2 years agoStop using `CLS_VAR` for "boxed statics" (#63845)
SingleAccretion [Wed, 2 Feb 2022 10:52:25 +0000 (13:52 +0300)]
Stop using `CLS_VAR` for "boxed statics" (#63845)

* Number GTF_STATIC_BOX_PTR INDs as VNF_PtrToStatic

This allows us to recognize loads made through indirections
off of locals to which these addresses are assigned.

There is an interesting regression here: VNs for addresses that
represent symbolically different fields with the same physical
offset will now be numbered differently. Fortunately, it does not
seem like this is a widespread problem.

The next step towards deleting CLS_VAR.

* Add VNF_PtrToStatic support to store numbering

This is needed because we can see cases where code
refers to the same field both via the VNF_PtrToStatic
mechanism and the "IsFieldAddr" mechanism, causing
mismatches along the way (since the VNF_PtrToStatic
path does use "first field maps").

* Use INDs for boxed statics

Some diffs for this change: they're caused by the fact
we sometimes have inlining or source code refer to the
same static both via "ldsflda" (which was numbered with
an address for the box) and "ldsfld" (which used CLS_VAR
and the handle).

* Remove handling of CLS_VAR boxed statics

No longer needed.

No diffs.

* Do not add NRE sets for VNF_PtrToStatic addresses

This solves some of the bad regressions where we now have
VNF_PtrToStatic addresses instead of ADD(NonNullInd, Const).

In principle, this should be done for all VNFuncs known to
not be null, but that is a larger change which leads to lots
of regressions, so the special casing will have to do for now.

2 years agoIgnore exit code returned from the merged wrappers (#64651)
Tomáš Rylek [Wed, 2 Feb 2022 09:06:26 +0000 (10:06 +0100)]
Ignore exit code returned from the merged wrappers (#64651)

JanV noticed that crash in one of the merged wrappers automatically
fails the test execution script so that subsequent wrappers and
the legacy xUnit wrappers don't get run. This simple change fixes
the issue by ignoring the wrapper exit code.

Thanks

Tomas

2 years agoDisable Vector256 tests which are timing out (#64653)
Sven Boemer [Wed, 2 Feb 2022 05:04:36 +0000 (21:04 -0800)]
Disable Vector256 tests which are timing out (#64653)

* Disable Vector256 tests which are timing out

* Exclude recursively with **

2 years agoAdd xarch `andn` (#64350)
Wraith [Wed, 2 Feb 2022 02:26:58 +0000 (02:26 +0000)]
Add xarch `andn` (#64350)

* basic functionality implemented

* add instruction format to list checked in AreFlagsSetToZeroCmp
comment and tidy

* review feedback and clarify instruction flags

* change op local check to result containment

* add memory op formats and update comments

2 years agoNativeAOT: ICustomMarshaller (#62921)
Andrii Kurdiumov [Wed, 2 Feb 2022 02:24:11 +0000 (08:24 +0600)]
NativeAOT: ICustomMarshaller (#62921)

* NativeAOT: ICustomMarshaller

This is https://github.com/dotnet/runtimelab/pull/1723/files without issues.targets change

* Fix all newly added tests

* Make TypeLoadException more consistent with CoreCLR

* Do not enable Interop/ICustomMarshaler/Primitives/ICustomMarshaler_TargetWindows

* Mark tests according to the passing status

* Add proper feature check

* Rename SupportsComInterop to SupportsExceptionInterop

Co-authored-by: Michal Strehovský <MichalStrehovsky@users.noreply.github.com>
2 years agoWriteup on OSR Details and Debugging (#64428)
Andy Ayers [Wed, 2 Feb 2022 02:17:26 +0000 (18:17 -0800)]
Writeup on OSR Details and Debugging (#64428)

Information about how to think about OSR and to debug jit and runtime
when OSR is enabled.

2 years agoRemove unused variable, fix typos (#64542)
yowl [Wed, 2 Feb 2022 01:15:14 +0000 (20:15 -0500)]
Remove unused variable, fix typos (#64542)

This PR just cleans up an unused variable and some typos, found when adding the IL scanner to the LLVM backend.

2 years agoAvoid an assert in ves_icall_RuntimeFieldInfo_SetValueInternal (#64214)
Bill Holmes [Wed, 2 Feb 2022 01:01:28 +0000 (20:01 -0500)]
Avoid an assert in ves_icall_RuntimeFieldInfo_SetValueInternal (#64214)

When the field is a valuetype and the value being assigned to the field
is a reference type, throw an ArgumentException. Without this change the
call to mono_object_handle_pin_unbox will assert and kill the process.

This can occur when de-serializing an object and the field types have
changed.

2 years agoFixes two logging source gen bugs - when using "in" or "ref" modifier / when dealing...
Maryam Ariyan [Wed, 2 Feb 2022 00:58:32 +0000 (16:58 -0800)]
Fixes two logging source gen bugs - when using "in" or "ref" modifier / when dealing with constraints (#64593)

* Fixes some logging source gen bugs:

- Supports usage of "in" modifier
- Improves support for generic constraints

Fixes #58550, #62644

* Apply PR feedback

* Add another test

2 years agoAllow use of overloaded methods when using LoggerMessage (#64573)
Jake Yallop [Wed, 2 Feb 2022 00:55:38 +0000 (00:55 +0000)]
Allow use of overloaded methods when using LoggerMessage (#64573)

* Compute unique method names for generated code

Calculates and assigns a unique LoggerMethod name as required, and uses
this new unique name for generating types in the source generator. This
allows using the LoggerMessageAttribute on methods that share the same
name but have different method signatures.

Fix #61814

* Rename MethodOverloadTestExtensions to OverloadTestExtensions

Also resolves other PR feedback, an extra blank line and incorrect use
of an implicit type.

* Remove un-needed overload tests

2 years agoFix debugger initialization (#64523)
Tom McDonald [Wed, 2 Feb 2022 00:35:50 +0000 (19:35 -0500)]
Fix debugger initialization (#64523)

* Fix debugger initialization

* Revert "Fix debugger initialization"

This reverts commit 9a1f7db69ab64c275ba98a0731e6b4601c814814.

* Update DomainAssembly and PEAssembly to use DPTR

2 years agoWith `build -subset help` output "macro" subset components (#64578)
Bruce Forstall [Tue, 1 Feb 2022 23:14:53 +0000 (15:14 -0800)]
With `build -subset help` output "macro" subset components (#64578)

Remove `clr.spmi` from default list; it's already there due to `clr.native`.

2 years ago[wasm] Remove USE_ZLIB=1 on windows, as we are already including the … (#64628)
Ankit Jain [Tue, 1 Feb 2022 23:08:45 +0000 (18:08 -0500)]
[wasm] Remove USE_ZLIB=1 on windows, as we are already including the … (#64628)

Co-authored-by: Alexander Köplinger <alex.koeplinger@outlook.com>
2 years agoFix generic method resolution in composite R2R images (#64247)
Tomáš Rylek [Tue, 1 Feb 2022 21:56:54 +0000 (22:56 +0100)]
Fix generic method resolution in composite R2R images (#64247)

According to my recent investigation, worse perf in the presence
of composite R2R images is due to the inability to resolve certain
generic methods in them; I believe the problem was caused by
inconsistent caching of the component assemblies. In particular,
DecodeModuleFromIndex uses the native metadata assembly ref cache
to resolve component assemblies but DecodeModuleFromIndexIfLoaded
doesn't consult it and direct load of an arbitrary assembly that
is a component to the composite image also doesn't set the cache
entry. This change fixes these deficiencies.

Thanks

Tomas

2 years agoDelete NS2x runtime specific impls (#64610)
Viktor Hofer [Tue, 1 Feb 2022 21:51:32 +0000 (22:51 +0100)]
Delete NS2x runtime specific impls (#64610)

* Remove .NETStandard runtime implementations

Remove the remaining ten .NETStandard runtime specific implementations.
For reasoning please see https://github.com/dotnet/runtime/issues/64536.

* Remove infra support for NS platform specific tfms

Also cleaning-up some logic and stop disabling AppendTargetFramework.

2 years ago[Mono] Add incremental build instructions when ... (#64396)
Fan Yang [Tue, 1 Feb 2022 21:01:19 +0000 (16:01 -0500)]
[Mono] Add incremental build instructions when ... (#64396)

... you need to need to run library tests or run HelloWorld sample with your change to mono.

2 years agoDisable some PerformanceCounter tests on more platforms (#64633)
Sven Boemer [Tue, 1 Feb 2022 20:37:48 +0000 (12:37 -0800)]
Disable some PerformanceCounter tests on more platforms (#64633)

These tests were disabled in https://github.com/dotnet/runtime/pull/61101
due to random failures like https://github.com/dotnet/runtime/issues/60933.

We are continuing to see these failures on x86 as well.

2 years agoRoll out board automation for Jeremy & Levi (#64617)
Eirik Tsarpalis [Tue, 1 Feb 2022 20:29:51 +0000 (20:29 +0000)]
Roll out board automation for Jeremy & Levi (#64617)