platform/upstream/dotnet/runtime.git
2 years agoJIT: remove loop if `lpTop` becomes unreachable (#70324)
Andy Ayers [Tue, 7 Jun 2022 20:56:31 +0000 (13:56 -0700)]
JIT: remove loop if `lpTop` becomes unreachable (#70324)

We may be able to prune the backedge of a middle-entry loop (one where
`lpEntry != lpTop`). Extend `optUpdateLoopsBeforeRemoveBlock` to handle
this case.

Fixes #69938.

2 years agoUpdate dependencies from https://github.com/dotnet/hotreload-utils build 20220606...
dotnet-maestro[bot] [Tue, 7 Jun 2022 19:51:11 +0000 (14:51 -0500)]
Update dependencies from https://github.com/dotnet/hotreload-utils build 20220606.2 (#70345)

Microsoft.DotNet.HotReload.Utils.Generator.BuildTool
 From Version 1.1.0-alpha.0.22281.2 -> To Version 1.1.0-alpha.0.22306.2

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
2 years ago[wasm] Fix Wasm.Build.Tests test failures on windows (#70328)
Ankit Jain [Tue, 7 Jun 2022 19:40:11 +0000 (15:40 -0400)]
[wasm] Fix Wasm.Build.Tests test failures on windows (#70328)

* [wasm] Workaround a python bug which can cause em* scripts to hang

Issue - https://github.com/emscripten-core/emscripten/pull/15146

Emscripten added a workaround enabled by setting
the environment variable - `EM_WORKAROUND_PYTHON_BUG_34780`.

* [wasm] Wasm.Build.Tests - use a local copy of `dotnet`

.. to avoid conflicting with other instances on helix.

* don't log output from robocopy

2 years agoJIT: Remove unneeded unconditional jumps (#69041)
Wraith [Tue, 7 Jun 2022 19:36:45 +0000 (20:36 +0100)]
JIT: Remove unneeded unconditional jumps (#69041)

* resolve merge conflict

* add checks for post-call jmp removal

* use emitIsLastInsCall() to preclude call,jmp pairs and simplfy emitRemoveJumpToNextInst
check for aligned instruction groups and skip them to preserve alignment
linearize emitRemoveJumpToNextInst, add safety asserts for ordering and comment the requirement, add debug output explaining decisions

* address feedback

* change instruction omit to use code size zero

* address feedback

* add assertion info dump

* address feedback

* address feedback

* remove end loop cleanup. cleanup jitdump messages and add early out flag.

* address feedback, formatting

* update variable naming and clarify comments

* more feedback

* add last instruction check and group flag set in emitSavIG

* more feedback

* fix jitdump output and make removal candidate printing optional

* remove emitDispJumpList parameter

* change overall size calculation and allow 0 size align to be printed in dumps

* fix invorrect jmp check, remove inline for emitInstHasNoCode

* allow alignment printing even when zero

* remove debug printf and fix x86

* address feedback

2 years agoClarity atomicity guarantees in ECMA-335 (#70384)
Jan Kotas [Tue, 7 Jun 2022 19:07:23 +0000 (12:07 -0700)]
Clarity atomicity guarantees in ECMA-335 (#70384)

2 years agoUpdate shared code from linker (#70204)
Vitek Karas [Tue, 7 Jun 2022 18:41:39 +0000 (11:41 -0700)]
Update shared code from linker (#70204)

This brings in relatively recent version of the shared code from the dotnet/linker repo.
Main changes:
* ValueNode -> SingleValue - and the partial classes implementation for the values
* Adapt MethodBodyScanner to the SingleValue/MultiValue
  * Includes some fixes around array handling and unknown values
* Removal of ReflectionPatternContext
  * Partially replaced by DiagnosticContext
  * Partially removed (the checks that everything reports something are nto needed anymore)
* Use HandleCallAction and RequireDynamicallyAccessedMembersAction - this replaces most of the functionality in ReflectionMethodBodyScanner.

Formatting:
The files which are shared exactly from linker are kept as is (so tabs and so on)
The files which are AOT specific should follow the formatting of AOT projects

Testing:
Passes smoke tests and some additional validation done via linker tests which is not part of this change

Note: This is not up-to-date with linker but it's getting us much closer. Known "TODOs":
* CompilerGeneratedState - linker has a much newer and much more capable version. Port of that will come later (as it was in heavy development while I was doing this port, and it's not strictly necessary for current functionality)
* Type hierarchy marking - this needs work on the linker side as it's not yet part of the shared codebase
* Correctly handle RUC/RDC for all "reflection accesses" to methods - some of the change improve on this, but it's nowhere near where it needs to be. Future work item.

2 years agoKeep members on Int128 and Half for testing (#70332)
Michal Strehovský [Tue, 7 Jun 2022 18:36:40 +0000 (03:36 +0900)]
Keep members on Int128 and Half for testing (#70332)

I was hitting a lot of obscure failures in #70201 that look like this:

```
  [FAIL] System.Tests.Int128Tests.Parse_Span_Valid(value: "170141183460469231731687303715884105727", offset: 0, count:
  1, style: Integer, provider: null, expected: 1)
  System.ArgumentException : Object of type 'System.Int32' cannot be converted to type 'System.Int128'.
     at System.InvokeUtils.CheckArgument(Object, EETypePtr, InvokeUtils.CheckArgumentSemantics, BinderBundle, InvokeUti
  ls.ArgSetupState&) + 0x1c0
     at System.InvokeUtils.DynamicInvokeParamHelperCore(InvokeUtils.ArgSetupState&, RuntimeTypeHandle, InvokeUtils.Dyna
  micInvokeParamLookupType&, Int32&, InvokeUtils.DynamicInvokeParamType) + 0x228
     at System.InvokeUtils.DynamicInvokeParamHelperIn(InvokeUtils.ArgSetupState&, RuntimeTypeHandle) + 0x1b
     at System.Runtime.Tests!<BaseAddress>+0xffe015
     at System.InvokeUtils.CallDynamicInvokeMethod(Object, IntPtr, IntPtr, IntPtr, Object, Object[], BinderBundle, Bool
  ean, Boolean) + 0x14d
     at Internal.Runtime.Augments.RuntimeAugments.CallDynamicInvokeMethod(Object, IntPtr, IntPtr, IntPtr, Object, Objec
  t[], BinderBundle, Boolean, Boolean) + 0x3e
     at Internal.Reflection.Execution.MethodInvokers.StaticMethodInvoker.Invoke(Object, Object[], BinderBundle, Boolean
  ) + 0x4e
     at Internal.Reflection.Core.Execution.MethodInvoker.Invoke(Object, Object[], Binder, BindingFlags, CultureInfo) +
  0x45
     at System.Reflection.Runtime.MethodInfos.RuntimeMethodInfo.Invoke(Object, BindingFlags, Binder, Object[], CultureI
  nfo) + 0x58
```

This stack is showing a reflection invoke attempt by xunit (not by a test, but by xunit itself) to invoke a method taking Int128, but passing a boxed Int32 as an argument. The TestData is indeed doing that.

I was getting myself ready to debug xunit but I thought that maybe xunit has a custom binder that calls the operator methods using reflection to do the conversions. Sure enough the RD.XML fixed it, so the problem was with operators getting trimmed away.

2 years agoFix double to unlong conversions to handle NaN (#70331)
Michal Strehovský [Tue, 7 Jun 2022 18:36:25 +0000 (03:36 +0900)]
Fix double to unlong conversions to handle NaN (#70331)

This was apparently fixed in 2016 on CoreCLR but no tests were added.

The generic math tests are the first things that exercise this.

Doesn't fail in the CI because this helper is likely not needed on ARM64 and we only test libs with NativeAOT on ARM64.

Thought this was because of my local changes (because the CI was clean) but wasn't. Spent more time on this than I would be willing to admit.

2 years ago[main] Update dependencies from dotnet/linker (#69710)
dotnet-maestro[bot] [Tue, 7 Jun 2022 18:20:49 +0000 (11:20 -0700)]
[main] Update dependencies from dotnet/linker (#69710)

* 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

* Update dependencies from https://github.com/dotnet/linker build 20220601.1

Microsoft.NET.ILLink.Tasks
 From Version 7.0.100-1.22270.1 -> To Version 7.0.100-1.22301.1

* Update dependencies from https://github.com/dotnet/linker build 20220603.2

Microsoft.NET.ILLink.Tasks
 From Version 7.0.100-1.22270.1 -> To Version 7.0.100-1.22303.2

* Update dependencies from https://github.com/dotnet/linker build 20220606.1

Microsoft.NET.ILLink.Tasks
 From Version 7.0.100-1.22281.1 -> To Version 7.0.100-1.22306.1

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: Vitek Karas <10670590+vitek-karas@users.noreply.github.com>
2 years agoFix race condition in WASM crypto worker (#70185)
Eric Erhardt [Tue, 7 Jun 2022 18:09:33 +0000 (12:09 -0600)]
Fix race condition in WASM crypto worker (#70185)

When sending a message between LibraryChannel and ChannelWorker, there is a race condition where both threads are reading/writing to shared memory at the same time. This can cause message pages to be skipped.

To fix this, add a shared mutex lock so only one side is reading/writing to shared memory at the same time.

Fix #69806

2 years agoFix unwind info when fake-splitting; add job to runtime-jit-experimental (#69922)
Aman Khalid [Tue, 7 Jun 2022 17:47:31 +0000 (10:47 -0700)]
Fix unwind info when fake-splitting; add job to runtime-jit-experimental (#69922)

Fake-splitting currently breaks stack walks by not generating unwind
info for cold code. This commit implements unwind info on x86/64 when
fake-splitting by generating unwind info for the combined hot/cold
section just once, rather than generating unwind info for the separate
sections.

For reasons to be investigated, this implementation does not work when
the code sections are separated by an arbitrary buffer (such as the 4KB
buffer previously used). Thus, the buffer has been removed from the
fake-splitting implementation: Now, the hot and cold sections are
placed contiguously in memory, but the JIT continues to behave as if
they are arbitrarily far away (for example, by using long branches
between sections).

Following this fix, fake-splitting no longer requires the GC to be
suppressed by setting `COMPlus_GCgen0size=1000000`. A test job
has been added to `runtime-jit-experimental` to ensure
fake/stress-splitting does not regress.

2 years agoUse u8 in more places (#69995)
Stephen Toub [Tue, 7 Jun 2022 17:42:23 +0000 (13:42 -0400)]
Use u8 in more places (#69995)

* Use u8 in more places

Primarily replacing Encoding.UTF8/ASCII.GetBytes("literal") with "literal"u8.ToArray()

* Address PR feedback (and fix some vars)

2 years agoRemove complex marshalling support from crossgen2 (#70183)
Jeremy Koritzinsky [Tue, 7 Jun 2022 17:42:07 +0000 (10:42 -0700)]
Remove complex marshalling support from crossgen2 (#70183)

2 years agoFix trimmability of various System.Runtime tests (#70329)
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.

2 years agoDelete a few dependencies on field sequences (#69991)
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.

2 years agoOptimization for "~x + 1" to "-x" (#69003) (#69600)
Sychev Vadim [Tue, 7 Jun 2022 17:28:41 +0000 (20:28 +0300)]
Optimization for "~x + 1" to "-x" (#69003) (#69600)

2 years agoDelete `GT_INDEX` (#69917)
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.

2 years agoRe-enable the pause intrinsic test for x86/x64 CoreCLR (#70230)
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

2 years agoMop-up changes per Jakob's PR suggestions (#70180)
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

2 years agoUpdate testing-android.md (#70362)
Thays Grazia [Tue, 7 Jun 2022 16:15:13 +0000 (13:15 -0300)]
Update testing-android.md (#70362)

2 years agoDebuggerDisplay Stopwatch (#65753)
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>
2 years agoAdd bool and uint to documentation for RuntimeHelpers.CreateSpan (#70360)
Julien Couvreur [Tue, 7 Jun 2022 16:03:02 +0000 (09:03 -0700)]
Add bool and uint to documentation for RuntimeHelpers.CreateSpan (#70360)

2 years agoFix TZ Tests (#70309)
Tarek Mahmoud Sayed [Tue, 7 Jun 2022 15:48:13 +0000 (08:48 -0700)]
Fix TZ Tests (#70309)

2 years agoFix some scaling issues with the global queue in the thread pool (#69386)
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

2 years agoNonBacktracking inner matching loop optimizations (#70217)
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

2 years agohandle SECURITY_STATUS 0x80090016 (#69942)
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

2 years agoJIT ARM32: Fix passing odd sized structs from arbitrary sources (#70075)
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

2 years agoJIT: broaden cloning invariant checks (#70232)
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.

2 years agoFold more "OBJ(ADDR(LCL))" patterns in multi-reg morphing (#70207)
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.

2 years agoDo not use `LEA`s in HIR (#69992)
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

2 years agoFix linker ref param warnings (#70082)
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>
2 years ago[mono][wasm] Revert the gc_pin optimization changes. (#70234)
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.

2 years agoRename TarFormat to TarEntryFormat (#70313)
Carlos Sanchez [Tue, 7 Jun 2022 01:19:03 +0000 (18:19 -0700)]
Rename TarFormat to TarEntryFormat (#70313)

2 years agoRemove obsolete code from "gtSetMultiOpOrder" (#70216)
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.

2 years agoDo not retype SIMD nodes (#70265)
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

2 years agoAlways use portable tailcalling mechanism for delegate tailcalls (#70269)
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

2 years ago[wasm][debugger] Support new hot reload features (#70097)
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>
2 years ago[mono][jit] Emit a null check for ldobj. (#70308)
Zoltan Varga [Tue, 7 Jun 2022 00:13:47 +0000 (20:13 -0400)]
[mono][jit] Emit a null check for ldobj. (#70308)

2 years agoFixing the costing of GT_CNS_DBL and GT_CNS_VEC instructions (#70215)
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

2 years agoStop unnecessary exceptions from being thrown from crossgen when a reference is not...
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

2 years agoMove HostAbortedException to Abstractions (#70205)
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.

2 years ago[mono] Extend mono AOT compiler to ingest .mibc profiles (#70194)
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

2 years agoUpdate libraries' building docs for native components (#70284)
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>
2 years agoBug fixes from dead code elimination (#69897)
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

2 years agoFix lazy loop backtracking uncapture in compiled regexes (#70280)
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.

2 years agoImprove binaries filtering for PMI runs of SPMI collection (#70294)
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.

2 years agoDo not add x86 host to PATH on 64-bit machines (#69902)
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)

2 years ago[wasm] Properly handle trailing whitespace in the URL for the HttpClient (#70154)
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)

2 years agoDecouple TimeOnlyConverter from TimeSpanConverter (#70035)
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

2 years agoRemove unused code (#70282)
Steve Harter [Mon, 6 Jun 2022 16:08:09 +0000 (11:08 -0500)]
Remove unused code (#70282)

2 years agoAdd list of pre-requisities for Alpine (#70283)
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

2 years ago[wasm][debugger]Fix entrypoint breakpoint when it's an async method (#69856)
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>
2 years ago[iOS] Grab the default timezone using native API (#70149)
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.

2 years agoImplement DbDataSource (#70006)
Shay Rojansky [Mon, 6 Jun 2022 14:10:15 +0000 (17:10 +0300)]
Implement DbDataSource (#70006)

Closes #64812

2 years ago[wasm][debugger] Added Default Interface Method tests. (#70002)
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.

2 years agoImprove string.Format / {Value}StringBuilder.AppendFormat parsing throughput (#69757)
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?>`.

2 years agoGeneralize the "BOX(nullable) cmp null" opt (#69961)
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.

2 years agoEnable folding of struct indirs used by returns in local morph (#69947)
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.

2 years ago[wasm] Initial SIMD support (#70086)
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

2 years ago[Android] Fix app crash when using non-native HttpClientHandler (#69565)
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

2 years agoRemove ternary workaround for string.IsNullOrEmpty (#63095)
Huo Yaoyuan [Mon, 6 Jun 2022 08:43:54 +0000 (16:43 +0800)]
Remove ternary workaround for string.IsNullOrEmpty (#63095)

2 years agolimit retries of EPROTOTYPE on macOS (#69882)
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

2 years agoallow null TargetHost in SslClientAuthenticationOptions (#69071)
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

2 years agoIgnoring test for NativeAOT since GetCallingAssembly is unsupported (#70221)
Beau Gosse [Mon, 6 Jun 2022 07:24:37 +0000 (02:24 -0500)]
Ignoring test for NativeAOT since GetCallingAssembly is unsupported (#70221)

2 years agoAdd support for symbol stripping (#70233)
Adeel Mujahid [Mon, 6 Jun 2022 07:21:39 +0000 (10:21 +0300)]
Add support for symbol stripping (#70233)

2 years agoRe-disable `Runtime_56953` (#70258)
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

2 years agoDelete ENABLE_REFLECTION_TRACE (#70244)
Jan Kotas [Mon, 6 Jun 2022 00:57:23 +0000 (17:57 -0700)]
Delete ENABLE_REFLECTION_TRACE (#70244)

2 years ago[NativeAOT] Fold System.Private.Reflection.Metadata into Corelib (#70241)
Jan Kotas [Mon, 6 Jun 2022 00:55:59 +0000 (17:55 -0700)]
[NativeAOT] Fold System.Private.Reflection.Metadata into Corelib (#70241)

2 years ago[mono][interp] Fix performance regression (#70255)
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.

2 years agoDelete some dead util code (#70254)
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

2 years ago[Wasm] Restore _free default export for Emcc 3.1.7 or later (#70245)
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)

2 years agoFileSystem.Unix: CreateSymbolicLink: remove unused statement. (#70252)
Tom Deseyn [Sun, 5 Jun 2022 13:38:22 +0000 (15:38 +0200)]
FileSystem.Unix: CreateSymbolicLink: remove unused statement. (#70252)

2 years agoFix regex outerloop tests (#70246)
Stephen Toub [Sun, 5 Jun 2022 12:15:46 +0000 (08:15 -0400)]
Fix regex outerloop tests (#70246)

2 years agoSync shared code from aspnetcore (#70236)
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>
2 years agoMove Environment.iOS.cs under libraries (#70226)
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.

2 years agoRe-enable Runtime_56953 on ARM64 (#70237)
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.

2 years agoConsolidate morphing of local nodes (#69819)
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

2 years ago[Mono] Fix test skipping for mobile device runtime tests (#70023)
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>
2 years agoUtilize VN-based non-null knowledge better (#69808)
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.

2 years agoSafe size estimation for SymbolicRegexNode (#70139)
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.

2 years agoDelete a little more dead rationalizer code (#70218)
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.

2 years agoJIT: add missing cloning test case and fix jit dump (#70225)
Andy Ayers [Sat, 4 Jun 2022 01:35:15 +0000 (18:35 -0700)]
JIT: add missing cloning test case and fix jit dump (#70225)

2 years agoMake Cryptography.Pkcs.Tests pass when rsa+sha1 signing is not supported.
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>
2 years agoSimplify ReadyToRunCompilationGroupBase config (#70192)
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

2 years agoUpdate dependencies from https://github.com/dotnet/hotreload-utils build 20220531...
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>
2 years agoRemove unused winapi mimicking headers under PAL (#70153)
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

2 years agoJIT: fix invariant analysis for cloning (#70126)
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.

2 years agoSome cleanups in Native AOT suspension area (#69885)
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.

2 years agoConsider targets of delegates reflection-visible (#70198)
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).

2 years agoUpdate CentOS7 image (#69892)
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.

2 years agoDo not read position when tar archive stream is unseekable (#70178)
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.

2 years agoAdd {M}IBC to glossary (#68111)
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

2 years agoImprove Encoding.UTF8.GetMaxByte/CharCount perf (#69910)
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

2 years agoEnsure that GT_CNS_VEC is handled in LinearScan::isMatchingConstant (#70171)
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>
2 years agoRemove thumbprint allocation in ManagedCertificateFinder
Kevin Jones [Thu, 2 Jun 2022 22:27:31 +0000 (18:27 -0400)]
Remove thumbprint allocation in ManagedCertificateFinder

2 years agofix InstanceDataCollectionCollection_CopyTo by retrying on 0 values (#70119)
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

2 years agoFix crash on osx-arm64 with Vector3 (#70141)
Egor Bogatov [Thu, 2 Jun 2022 22:24:03 +0000 (01:24 +0300)]
Fix crash on osx-arm64 with Vector3 (#70141)

2 years agoEnable server-side OCSP stapling on Linux
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.

2 years agoUpdate updating-ref-source.md (#70169)
Aaron Robinson [Thu, 2 Jun 2022 20:54:51 +0000 (13:54 -0700)]
Update updating-ref-source.md (#70169)

Update flags for using GenAPI.

2 years agoWasm AOT micro optimizations (#69955)
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.