platform/upstream/dotnet/runtime.git
2 years agoAdd some tests that validate debug info through ETW events (#61962)
Jakob Botsch Nielsen [Wed, 24 Nov 2021 13:48:50 +0000 (14:48 +0100)]
Add some tests that validate debug info through ETW events (#61962)

Validate the debug mappings generated by the JIT using the
MethodILToNative event. Unfortunately we can not use EventListener as
the event there does not contain the actual mappings (#12678) so this
reuses some of the facilities from the tracing tests to use EventPipe
and TraceEvent.

This only adds the infrastructure and a small number of tests, but
at least this should make it easier to add more tests in this area in
the future.

There are some more limitations, for example we cannot validate the
CALL_INSTRUCTION mappings generated for the managed return value feature
because the debugger filters them out of the table reported. I am hoping
we can change these mappings to be included as normal in the future.

The tests themselves are added by adding a method to tests.il with an
ExpectedILMappings attribute that allows specifying a subset of IL
offsets that we expect mappings to be generated for, with separate
subsets under Debug and when optimizing. This was the best way I could
think of to be able to refer to the right IL offsets.

2 years agoAdd RequiresDynamicCodeAttribute to runtime (#61956)
Tlakaelel Axayakatl Ceja [Wed, 24 Nov 2021 11:53:01 +0000 (03:53 -0800)]
Add RequiresDynamicCodeAttribute to runtime (#61956)

* Add RequiresDynamicCodeAttribute to runtime

* Delete nullable enable

* Add test file to compilation for RequiresDynamicCode and RequiresAssemblyFiles

* Fix RequiresAssemblyFiles tests

2 years agoFix Android crypto asserts (#61827)
Kevin Jones [Wed, 24 Nov 2021 11:48:22 +0000 (06:48 -0500)]
Fix Android crypto asserts (#61827)

This fixes three asserts that were started occurring in the native Android cryptographic primitives.

- One shot hashing now tolerates empty/null input.
- Hashing and HMAC will now no-op if the append is empty.
- RSA encryption now tolerates empty/null input.

2 years agoUse separate partials for iOS&tvOS instead of UnknowUnix in System.Diagnostics.Proces...
Maxim Lipnin [Wed, 24 Nov 2021 11:36:32 +0000 (14:36 +0300)]
Use separate partials for iOS&tvOS instead of UnknowUnix in System.Diagnostics.Process (#61871)

2 years agoClean up test intermediates when clean test rebuild is requested (#62001)
Tomáš Rylek [Wed, 24 Nov 2021 09:25:16 +0000 (10:25 +0100)]
Clean up test intermediates when clean test rebuild is requested (#62001)

I hit this problem locally when working on the test merging
- I made a change in Jeremy's Roslyn generator logic adding a hard
FailFast and the tests continued building normally even when
specifying the rebuild option because the XUnitWrapperGenerator
project remained in the intermediate test folder and didn't get
actually rebuilt.

Thanks

Tomas

2 years agoMake more extensive use of lvaGetDesc() (#61494)
Bruce Forstall [Wed, 24 Nov 2021 04:31:05 +0000 (20:31 -0800)]
Make more extensive use of lvaGetDesc() (#61494)

Including the version with a `GenTreeLclVarCommon*` overload.

I mostly replaced `&lvaTable[varNum]` and `lvaTable + varNum`
expressions, leaving `lvaTable[varNum].xxx`.

Made many resulting `varDsc*` const.

Removed unused `lvaRefCount`.

Simplifies code, and centralizes assert checking.

Added new `lvaGetLclNum(LclVarDsc*)` function to map back to a varNum.

This deletes many `noway_assert` in favor of the lvaGetDesc `assert`;
I'm not worried about removing asserts from the Release build.

2 years agoprevent concurrent access to IO buffers on macOS (#61723)
Tomas Weinfurt [Wed, 24 Nov 2021 03:59:48 +0000 (19:59 -0800)]
prevent concurrent access to IO buffers on macOS (#61723)

2 years ago[wasm] Misc CI/test run improvements (#61937)
Ankit Jain [Wed, 24 Nov 2021 01:17:09 +0000 (01:17 +0000)]
[wasm] Misc CI/test run improvements (#61937)

- Update chrome+chromedriver for helix tests to latest stable (`96.0.4664.45`)
- Enable library tests to run on Windows, for manual runs

- Disable windows/AOT builds completely due to https://github.com/dotnet/runtime/issues/61721
- Disable failing WBT tests on windows due to https://github.com/dotnet/runtime/issues/61725
- Disable JS interop tests failing with new chrome - https://github.com/dotnet/runtime/issues/61945

Co-authored-by: Radek Doulik <radek.doulik@gmail.com>
2 years ago[mono] Remove support for Classic Xamarin for the Selector.GetHandle optimization...
Rolf Bjarne Kvinge [Wed, 24 Nov 2021 01:13:23 +0000 (02:13 +0100)]
[mono] Remove support for Classic Xamarin for the Selector.GetHandle optimization, and add newer platforms. (#61989)

We haven't supported Classic mode for Xamarin for quite a few years now
(monotouch, MonoMac), so that code is not needed anymore. However, we've added
support for more platforms (tvOS, Mac Catalyst), so add support for those.

2 years agoDelete dead code from InferStructOpSizeAlign (#61880)
SingleAccretion [Wed, 24 Nov 2021 00:02:14 +0000 (03:02 +0300)]
Delete dead code from InferStructOpSizeAlign (#61880)

The method's only caller is InferOpSizeAlign.

That is in turn only used in LCL_FLD stress, which
only looks at locals with non-struct types.

And "fgInitArgInfo", which only allows 3 nodes with
TYP_STRUCT: OBJ, LCL_VAR and MKREFANY.

Thus, this code is dead. Not surprising, considering
it was looking for the old GT_COPYBLK representation.

2 years agoCheck for time-sensitive work when worker thread starvation is ongoing (#61930)
Koundinya Veluri [Tue, 23 Nov 2021 23:16:46 +0000 (15:16 -0800)]
Check for time-sensitive work when worker thread starvation is ongoing (#61930)

- Otherwise timer callbacks may not run when worker threads are continually starved
- Fix for https://github.com/dotnet/runtime/issues/61804 in main

2 years agoStabilize host's UpgradeCode and ProviderKey (#61810)
Nikola Milosavljevic [Tue, 23 Nov 2021 18:38:01 +0000 (10:38 -0800)]
Stabilize host's UpgradeCode and ProviderKey (#61810)

2 years agoremoved argument requestId from loopbackserver.cs (#58678)
Anudeep Gunukula [Tue, 23 Nov 2021 18:20:27 +0000 (23:50 +0530)]
removed argument requestId from loopbackserver.cs (#58678)

* removed argument requestId

* removed requestId in LoopbackServer.cs

* Update src/libraries/Common/tests/System/Net/Http/GenericLoopbackServer.cs

Co-authored-by: Karel Zikmund <karelz@microsoft.com>
* commit after changes

* removed requestId from LoopbackServer

* removed requestId from Http2 and Http3 LoopbackConnection

* removed requestId from HttpClientHandlerTest.Http2.cs

* commit after modifying http2 test

* created new function in http2

* Update src/libraries/Common/tests/System/Net/Http/Http2LoopbackConnection.cs

Co-authored-by: Katya Sokolova <esokolov@microsoft.com>
* Update src/libraries/Common/tests/System/Net/Http/Http2LoopbackConnection.cs

Co-authored-by: Karel Zikmund <karelz@microsoft.com>
* Update src/libraries/Common/tests/System/Net/Http/Http2LoopbackConnection.cs

Co-authored-by: Karel Zikmund <karelz@microsoft.com>
* Update src/libraries/Common/tests/System/Net/Http/Http2LoopbackConnection.cs

Co-authored-by: Karel Zikmund <karelz@microsoft.com>
* removed async keyword

Co-authored-by: Karel Zikmund <karelz@microsoft.com>
Co-authored-by: Katya Sokolova <esokolov@microsoft.com>
2 years ago[mono] Don't use recursion in mono_ssa_rename_vars (#61677)
Radek Doulik [Tue, 23 Nov 2021 16:23:27 +0000 (17:23 +0100)]
[mono] Don't use recursion in mono_ssa_rename_vars (#61677)

Implements https://github.com/dotnet/runtime/issues/60266

Avoid deep recursion in `mono_ssa_rename_vars`, change the way we traverse
dominated bb's. Instead of using recursion, use stack-like array to
store information about stack history and the traversal.

The performance remains the same (or is slightly better) than before.
Times for the compilation of repro from https://github.com/dotnet/runtime/issues/57141
(JIT time minimum from 5 runs):

Before:

    LLVM output file: './Uno.UI.FluentTheme.dll.bc.tmp'.
    JIT time: 4810 ms, Generation time: 2040 ms, Assembly+Link time: 2 ms.

After:

    LLVM output file: './Uno.UI.FluentTheme.dll.bc.tmp'.
    JIT time: 4781 ms, Generation time: 2017 ms, Assembly+Link time: 2 ms.

* Fix assignment

* Apply suggestions from code review

Co-authored-by: imhameed <imhameed@microsoft.com>
* Remove casts we don't need

Co-authored-by: imhameed <imhameed@microsoft.com>
2 years agoDisable several GenericMath tests on iOS/tvOS (#61922)
Steve Pfister [Tue, 23 Nov 2021 16:21:35 +0000 (11:21 -0500)]
Disable several GenericMath tests on iOS/tvOS (#61922)

The tests were failing on iOS/tvOS device runs.  https://github.com/dotnet/runtime/issues/61920 was created to track them.

Co-authored-by: Steve Pfister <steve.pfister@microsoft.com>
2 years agoEnvironment variable should override property for gcServer. (#61950)
Aaron Robinson [Tue, 23 Nov 2021 15:50:53 +0000 (08:50 -0700)]
Environment variable should override property for gcServer. (#61950)

Add tests for the scenario.

2 years agoFileSystem.Unix: Directory.Delete: remove per item syscall. (#59520)
Tom Deseyn [Tue, 23 Nov 2021 14:51:37 +0000 (15:51 +0100)]
FileSystem.Unix: Directory.Delete: remove per item syscall. (#59520)

* FileSystem.Unix: Directory.Delete: remove per item syscall.

By recursing using FileSystemEnumerable we know the file type and
can omit the stat calls made by DirectoryInfo.Exists.

For the top level path, we can omit the call also and handle
non-directories when rmdir errno is ENOTDIR.

For the recursive case we can avoid recursion when the top level path rmdir
succeeds immediately.

FileSystemEntry is updated so IsSymbolicLink remembers the file is symbolic link
and does not make a syscall for it.

2 years ago[System.Text.Json] Move inline throw statements to `ThrowHelper` (#61746)
Eirik Tsarpalis [Tue, 23 Nov 2021 12:44:34 +0000 (12:44 +0000)]
[System.Text.Json] Move inline throw statements to `ThrowHelper` (#61746)

* Replace occurrences of inlined throws with ThrowHelper calls

* remove NoInlining from ThrowHelpers.Throw* methods

* address feedback

* remove NoInlining attribute from local throw method

* Incorporate changes from #61608

2 years ago[wasm] workaround test results corruption (#61841)
Pavel Savara [Tue, 23 Nov 2021 10:43:10 +0000 (11:43 +0100)]
[wasm] workaround test results corruption (#61841)

* xharness bump
* more logging in unit test

2 years agoUpdate Proxy-Support check to be case insensitive (#61446)
Chris Wood [Tue, 23 Nov 2021 09:39:14 +0000 (09:39 +0000)]
Update Proxy-Support check to be case insensitive (#61446)

RFC4559 does not specify that the Proxy-Support header value used to
determine if the proxy server will honour client server authentication
integrity is case sensitive. Updating the check to be case insensitive
to prevent failures when value is supplied using differences in case.

Fix #61414

2 years agoAdded AsReadOnly extension methods for IDictionary<T, U> and IList<T> (#61172)
Mrxx99 [Tue, 23 Nov 2021 09:15:37 +0000 (10:15 +0100)]
Added AsReadOnly extension methods for IDictionary<T, U> and IList<T> (#61172)

* added AsReadOnly extension methods for IDictionary and IList (not compiling)

* added AsReadOnly methods to ref assembly

* revert changes in MatchingRefApiCompatBaseline.txt

* fixed spelling

* added notnull constraint for TKey on AsReadOnly on IDictionary, fixed typo

* Move ReadOnlyDictionary from System.ObjectModel to System.Private.CoreLib

* Add TypeForwards

* Added XML-Doc comments

* added tests for null arguments to AsReadOnly extensions

* added parameter names to null argument tests

Co-authored-by: mrxx99 <mrxx99@gmail.com>
Co-authored-by: Eirik Tsarpalis <eirik.tsarpalis@gmail.com>
2 years agoAdd Clear() to MemoryCache (#57631)
Adam Sitnik [Tue, 23 Nov 2021 08:26:24 +0000 (09:26 +0100)]
Add Clear() to MemoryCache (#57631)

Co-authored-by: Eric Erhardt <eric.erhardt@microsoft.com>
2 years agoUse GeneratedDllImport in Microsoft.Extensions.Hosting.WindowsServices, System.Drawin...
Elinor Fung [Tue, 23 Nov 2021 07:10:45 +0000 (00:10 -0700)]
Use GeneratedDllImport in Microsoft.Extensions.Hosting.WindowsServices, System.Drawing.Primitives, System.Management, System.Security.Cryptography.ProtectedData, System.Speech, System.Windows.Extensions (#61949)

2 years agoDisable changing align nop padding to breakpoints for arm64 under jit stress (#61951)
Andy Ayers [Tue, 23 Nov 2021 06:42:08 +0000 (22:42 -0800)]
Disable changing align nop padding to breakpoints for arm64 under jit stress (#61951)

* Disable converting nop padding to breakpoints for arm64 under jit stress.

Workaround for issue #61944.

* disable differently

* fix

2 years agoLocalized file check-in by OneLocBuild Task: Build definition ID 679: Build ID 148215...
dotnet bot [Tue, 23 Nov 2021 04:19:02 +0000 (20:19 -0800)]
Localized file check-in by OneLocBuild Task: Build definition ID 679: Build ID 1482158 (#61858)

2 years agoAdd backtracking loops, backreferences, and if-then-else constructs to Regex "simplif...
Stephen Toub [Tue, 23 Nov 2021 03:51:55 +0000 (22:51 -0500)]
Add backtracking loops, backreferences, and if-then-else constructs to Regex "simplified" code gen (#61906)

* Add a few tests for captures inside various constructs

* Slightly optimize creation of multis that don't participate in case conversion

* Add simple codegen support for backtracking Loops

* Add simple codegen support for backreferences

* Add simple codegen support for if-then-else backreference conditionals

* Add simple codegen support for if-then-else expression conditionals

* Flip default on MarkLabel emitting semicolon

Labels need to be followed by something other than a closing brace.  Previously I was trying to opt labels in to emitting a semi-colon, but it's too error prone.  Instead, we now by default emit a semicolon, and only skip it from call sites that opt-out because it's obvious they'll always be followed by code.

* Add simple codegen support for balancing groups

* Address PR feedback

2 years agoFix regression in IsPrefix / IsSuffix benchmarks (#61935)
Elinor Fung [Mon, 22 Nov 2021 23:17:59 +0000 (16:17 -0700)]
Fix regression in IsPrefix / IsSuffix benchmarks (#61935)

Mark EndsWith and StartsWith as NoInlining

2 years agoAdding support for the X86Base.Pause intrinsic on Mono (#61707)
Tanner Gooding [Mon, 22 Nov 2021 22:42:34 +0000 (14:42 -0800)]
Adding support for the X86Base.Pause intrinsic on Mono (#61707)

* Adding support for the X86Base.Pause intrinsic on Mono

* Re-enable the pause hwintrinsic test on Mono

2 years agoUpdate list of analyzer diagnostics with JSON entries (#61809)
Layomi Akinrinade [Mon, 22 Nov 2021 22:30:09 +0000 (14:30 -0800)]
Update list of analyzer diagnostics with JSON entries (#61809)

2 years agoExtract ECAlgorithm from ECDsa and ECDiffieHellman
Kevin Jones [Mon, 22 Nov 2021 21:32:43 +0000 (16:32 -0500)]
Extract ECAlgorithm from ECDsa and ECDiffieHellman

2 years agoAdd a JsonWriterOptions.MaxDepth property (#61608)
Eirik Tsarpalis [Mon, 22 Nov 2021 20:11:44 +0000 (20:11 +0000)]
Add a JsonWriterOptions.MaxDepth property (#61608)

* Add a JsonWriterOptions.MaxDepth property

* remove depth checks from the converter layer

* Revert "remove depth checks from the converter layer"

This reverts commit 0e430928c8d84288e0b2cb2e1d1726087f905ae8.

2 years agoDon't special case "Experimental" projects (#60641)
Eric StJohn [Mon, 22 Nov 2021 20:00:38 +0000 (12:00 -0800)]
Don't special case "Experimental" projects (#60641)

* Don't special case "Experimental" projects

We only have one experimental project, System.Runtime.Experimental and
we want it to behave like any other package.

* Make coreclr packages use `IsShipping`

2 years agoUse correct VN relation kind for redundant relop opts (#61912)
Jakob Botsch Nielsen [Mon, 22 Nov 2021 18:45:42 +0000 (19:45 +0100)]
Use correct VN relation kind for redundant relop opts (#61912)

We could overwrite the candidate VN relation kind with one from an
earlier tree that did not necessarily end up as a candidate.

Fix #61908

2 years agoDelete Regex timeout tests with RegexOptions.Debug (#61888)
Stephen Toub [Mon, 22 Nov 2021 18:33:27 +0000 (13:33 -0500)]
Delete Regex timeout tests with RegexOptions.Debug (#61888)

We don't need these tests (the Debug flag is only compiled into Debug builds and is there for diagnostic purposes), and it seems these have been taking too long sporadically.
Closes https://github.com/dotnet/runtime/issues/61794

2 years agoVectorize SpanHelpers<T>.IndexOf (#60974)
Alex Covington [Mon, 22 Nov 2021 18:21:26 +0000 (10:21 -0800)]
Vectorize SpanHelpers<T>.IndexOf (#60974)

Co-authored-by: Günther Foidl <gue@korporal.at>
Co-authored-by: Dan Moseley <danmose@microsoft.com>
2 years agoDo not explicitly pass type to `VNForMapStore` (#61882)
SingleAccretion [Mon, 22 Nov 2021 18:07:11 +0000 (21:07 +0300)]
Do not explicitly pass type to `VNForMapStore` (#61882)

* Fix type checks in fgValueNumberArrIndexAssign

The code was trying to obtain the value of the location to store
to from the updated map for the element. This is simply incorrect
for all but the trivial case of an empty field sequence.

* Do not explicitly pass type to VNForMapStore

It must always be equal to the type of the map being updated,
not having redundancy eliminates the possibility for mistakes.

2 years agoMake S.S.C.X509Certificates compliant with interop guidelines - part 3
Badre BSAILA [Mon, 22 Nov 2021 18:03:33 +0000 (19:03 +0100)]
Make S.S.C.X509Certificates compliant with interop guidelines - part 3

2 years agoRevert "[Mono] Skip flaky android tests (#61460)" (#61771)
Simon Rozsival [Mon, 22 Nov 2021 17:48:14 +0000 (18:48 +0100)]
Revert "[Mono] Skip flaky android tests (#61460)" (#61771)

This reverts commit 8ad84e88d86fb7845187ae0aa17be48ed1a46c97.

2 years agoSkip eventpipe_readevents for arm32 (#58545)
Gleb Balykov [Mon, 22 Nov 2021 17:20:49 +0000 (20:20 +0300)]
Skip eventpipe_readevents for arm32 (#58545)

Originally there was only one eventpipe test, and eventpipe_readevents was added in https://github.com/dotnet/runtime/pull/37002.
Both should be skipped for the same reason.

2 years agoJIT: refactor to allow OSR to switch to optimized (#61851)
Andy Ayers [Mon, 22 Nov 2021 17:11:31 +0000 (09:11 -0800)]
JIT: refactor to allow OSR to switch to optimized (#61851)

When OSR is enabled, the jit may still need to switch to optimized codegen if
there is something in the method that OSR cannot handle. Examples include:
* localloc
* loops in handlers
* reverse pinvoke (currently bypasses Tiering so somewhat moot)
* tail. prefixes (currently tolerated as Tiering should suffice)

When OSR is enabled, rework the "switch to optimize logic" in the jit to check
for these cases up front before we start importing code.

When both QuickJitForLoops and OnStackReplacement are enabled, this should ensure
that if we can't transition out of long-running Tier0 code (via OSR) then we will
instead optimize the method. Very few methods overall should opt-out of Tier0.

Note some of these unhandled constructs can eventually be handled by OSR, with
additional work.

For explicit tail calls:  this should replicate the current logic where we always optimize
methods with explicit tail calls unless we're instrumenting them.

To make this work with OSR we simply won't put patchpoints in methods with explicit
tail calls, instead trusting that tiering can get us to optimized versions.

2 years agoDefault BuildTargetFramework to NetCoreAppCurrent so that the ref is (#61760)
Santiago Fernandez Madero [Mon, 22 Nov 2021 16:23:51 +0000 (08:23 -0800)]
Default BuildTargetFramework to NetCoreAppCurrent so that the ref is (#61760)

2 years agoMake System.DirectoryServices.AccountManagement use GeneratedDllImport (#61805)
Elinor Fung [Mon, 22 Nov 2021 16:23:34 +0000 (09:23 -0700)]
Make System.DirectoryServices.AccountManagement use GeneratedDllImport (#61805)

2 years agoRename CORINFO_FLG_CONTAINS_STACK_PTR to CORINFO_FLG_BYREF_LIKE (#61907)
Jan Kotas [Mon, 22 Nov 2021 15:34:51 +0000 (07:34 -0800)]
Rename CORINFO_FLG_CONTAINS_STACK_PTR to CORINFO_FLG_BYREF_LIKE (#61907)

The current name is causing confusion

2 years ago[HTTP] Scavange fix (#61530)
Marie Píchová [Mon, 22 Nov 2021 14:07:04 +0000 (15:07 +0100)]
[HTTP] Scavange fix (#61530)

* Guard pool scavenging callback from parallel execution when it takes longer than the timer interval gets triggered

* Dispose connection from the pool in a serate task to not to block the caller (scavenge timer callback)

* feedback

2 years agoFix XXHash for stripe size (#61881)
Stefan [Mon, 22 Nov 2021 11:41:33 +0000 (12:41 +0100)]
Fix XXHash for stripe size (#61881)

2 years agoMark PLINQ as enabled in WASM and make browser compat changes (#58227)
Katelyn Gadd [Mon, 22 Nov 2021 10:25:46 +0000 (02:25 -0800)]
Mark PLINQ as enabled in WASM and make browser compat changes (#58227)

Co-authored-by: Jeff Handley <jeffhandley@users.noreply.github.com>
2 years agoFix a few special cases of projects with command line arguments (#61758)
Tomáš Rylek [Mon, 22 Nov 2021 09:37:33 +0000 (10:37 +0100)]
Fix a few special cases of projects with command line arguments (#61758)

* Remove CLRTestExecutionArguments from OOMException01

Test entrypoint is parameterless and so it ignores the argument

* The test entrypoint for 347011 is parameterless so the property is ignored

* Remove project-driven command line arguments from the polyrec test

The test just passes a pair of integers that are used as internal
parameters for the test. Refactor the test so that the entrypoint
accepts the parameters as arguments and call it once from Main
the way we used to do based on the CLRTestExecutionArguments.

Thanks

Tomas

2 years agoActually use TargetOS=AnyOS in the build-test-job (Try 2) (#61801)
Jeremy Koritzinsky [Mon, 22 Nov 2021 05:13:05 +0000 (21:13 -0800)]
Actually use TargetOS=AnyOS in the build-test-job (Try 2) (#61801)

2 years agoDo not devirtualize if optimizations disabled (#61868)
Michal Strehovský [Sat, 20 Nov 2021 16:23:58 +0000 (01:23 +0900)]
Do not devirtualize if optimizations disabled (#61868)

We started doing devir in unoptimized builds. I assume that was an unintended consequence of #61453.

2 years agoUse reflection or a compile-time only shim assembly to reference unexposed corelib...
Jeremy Koritzinsky [Sat, 20 Nov 2021 03:28:42 +0000 (19:28 -0800)]
Use reflection or a compile-time only shim assembly to reference unexposed corelib types. (#61802)

Co-authored-by: Aaron Robinson <arobins@microsoft.com>
2 years agoUpdate `GetPinnableReference()` usage in multi-step custom type marshalling (#61539)
Jeremy Koritzinsky [Sat, 20 Nov 2021 02:16:07 +0000 (18:16 -0800)]
Update `GetPinnableReference()` usage in multi-step custom type marshalling (#61539)

* Update GetPinnableReference() usage in multi-step custom tyep marshalling

Change GetPinnableReference() on a marshaller type to be used as a side effect when marshalling in all cases when a fixed() statement is usable.

Use the Value property getter to get the value to pass to native in all cases.

Update our marshallers and tests to follow this design update.

* Apply suggestions from code review

Co-authored-by: Aaron Robinson <arobins@microsoft.com>
* Don't emit the assingment to the Value property in the Unmarshal stage when using [Out]

* Fix the unmarshalling conditions

* Fix Utf16StringMarshaller to correctly handle the "null pointer" case now that we're using spans internally for storage in all cases.

Co-authored-by: Aaron Robinson <arobins@microsoft.com>
2 years agoMake intrinsic nodes multi op (aka delete `GT_LIST`) (#59912)
SingleAccretion [Sat, 20 Nov 2021 02:13:35 +0000 (05:13 +0300)]
Make intrinsic nodes multi op (aka delete `GT_LIST`) (#59912)

* Introducing GenTreeMultiOp

* Rewrite gtNewSIMDNode

* Rewrite gtNewSIMDVectorZero

* Rewrite gtNewHWIntrinsicNode

* Rewrite GenTreeSIMD::OperIsMemoryLoad

* Rewrite GenTreeHWIntrinsic::OperIsMemoryLoad

* Rewrite GenTreeHWIntrinsic::OperIsMemoryStore

* Rewrite GenTree::IsIntegralConstVector

* Rewrite GenTree::NullOp1Legal

* Rewrite GenTree::IsSIMDZero

* Rewrite GenTree::isCommutativeSIMDIntrinsic

* Rewrite GenTree::isCommutativeHWIntrinsic

* Rewrite GenTree::isContainableHWIntrinsic

* Rewrite GenTree::isRMWHWIntrinsic

* Rewrite GenTreeVisitor

* Rewrite GenTreeUseEdgeIterator

* Rewrite GenTree::VisitOperands

* Rewrite GenTree::TryGetUse

* Rewrite gtGetChildPointer

* Rewrite gtHasRef

* Rewrite fgSetTreeSeqHelper

* Rewrite GenTree::NumChildren

* Rewrite GenTree::GetChild

* Rewrite GenTree::Compare

* Rewrite gtCloneExpr

* Rewrite gtSetEvalOrder

* Rewrite gtHashValue

* Rewrite gtDispTree

* Rewrite fgDebugCheckFlags

* Add genConsumeMultiOpOperands

* Rewrite genConsumeRegs

* Rewrite HWIntrinsic::HWIntrinsic

* Rewrite HWIntrinsic::InitializeOperands

* Delete HWIntrinsicInfo::lookupNumArgs

* Delete HWIntrinsicInfo::lookupLastOp

* Rewrite HWIntrinsicImmOpHelper ARM64

* Rewrite inst_RV_TT_IV

* Rewrite inst_RV_RV_TT

* Rewrite genSIMDIntrinsic XARCH

* Rewrite genSIMDIntrinsicInit XARCH

* Rewrite genSIMDIntrinsicInitN XARCH

* Rewrite genSIMDIntrinsicUnOp XARCH

* Rewrite genSIMDIntrinsic32BitConvert XARCH

* Rewrite genSIMDIntrinsic64BitConvert XARCH

* Rewrite genSIMDIntrinsicWiden XARCH

* Rewrite genSIMDIntrinsicNarrow XARCH

* Rewrite genSIMDIntrinsicBinOp XARCH

* Rewrite genSIMDIntrinsicRelOp XARCH

* Rewrite genSIMDIntrinsicShuffleSSE2 XARCH

* Rewrite genSIMDIntrinsicUpperSave XARCH

* Rewrite genSIMDIntrinsicUpperRestore XARCH

* Rewrite genSIMDIntrinsic ARM64

* Rewrite genSIMDIntrinsicInit ARM64

* Rewrite genSIMDIntrinsicInitN ARM64

* Rewrite genSIMDIntrinsicUnOp ARM64

* Rewrite genSIMDIntrinsicWiden ARM64

* Rewrite genSIMDIntrinsicNarrow ARM64

* Rewrite genSIMDIntrinsicBinOp ARM64

* Rewrite genSIMDIntrinsicUpperSave ARM64

* Rewrite genSIMDIntrinsicUpperRestore ARM64

* Rewrite genHWIntrinsic_R_RM XARCH

* Rewrite genHWIntrinsic_R_RM_I XARCH

* Rewrite genHWIntrinsic_R_R_RM XARCH

* Rewrite genHWIntrinsic_R_R_RM_I XARCH

* Rewrite genHWIntrinsic_R_R_RM_R XARCH

* Rewrite genHWIntrinsic_R_R_R_RM XARCH

* Rewrite genHWIntrinsic XARCH

* Rewrite genBaseIntrinsic XARCH

* Rewrite genX86BaseIntrinsic XARCH

* Rewrite genSSEIntrinsic XARCH

* Rewrite genSSE2Intrinsic XARCH

* Rewrite genSSE41Intrinsic XARCH

* Rewrite genSSE42Intrinsic XARCH

* Rewrite genAvxOrAvx2Intrinsic XARCH

* Rewrite genBMI1OrBMI2Intrinsic XARCH

* Rewrite genFMAIntrinsic XARCH

* Rewrite genLZCNTIntrinsic XARCH

* Rewrite genPOPCNTIntrinsic XARCH

* Rewrite genXCNTIntrinsic XARCH

* Rewrite genHWIntrinsic ARM64

* Rewrite insertUpperVectorSave

* Rewrite insertUpperVectorRestore

* Rewrite getKillSetForHWIntrinsic

* Rewrite BuildSIMD XARCH

* Rewrite BuildOperandUses/BuildDelayFreeUses

* Rewrite BuildSIMD ARM64

* Rewrite BuildHWIntrinsic XARCH

* Rewrite LowerSIMD XARCH

* Rewrite ContainCheckSIMD XARCH

* Rewrite LowerHWIntrinsicCC XARCH

* Rewrite LowerFusedMultiplyAdd XARCH

* Rewrite LowerHWIntrinsic XARCH

* Rewrite LowerHWIntrinsicCmpOp XARCH

* Rewrite LowerHWIntrinsicGetElement XARCH

* Rewrite LowerHWIntrinsicWithElement XARCH

* Rewrite LowerHWIntrinsicCreate XARCH

* Rewrite LowerHWIntrinsicDot XARCH

* Rewrite LowerHWIntrinsicToScalar XARCH

* Rewrite IsContainableHWIntrinsicOp XARCH

* Rewrite ContainCheckHWIntrinsic XARCH

* Rewrite IsValidConstForMovImm ARM64

* Rewrite LowerHWIntrinsic ARM64

* Rewrite LowerHWIntrinsicFusedMultiplyAddScalar ARM64

* Rewrite LowerHWIntrinsicCmpOp ARM64

* Rewrite LowerHWIntrinsicCreate ARM64

* Rewrite LowerHWIntrinsicDot ARM64

* Rewrite ContainCheckStoreLoc ARM64

* Rewrite ContainCheckSIMD ARM64

* Rewrite ContainCheckHWIntrinsic ARM64

* Rewrite DecomposeHWIntrinsicGetElement X86

* Rewrite DecomposeHWIntrinsic X86

* Rewrite Rationalizer::RewriteNode

* Rewrite optIsCSEcandidate

* Rewrite fgValueNumberTree

* Rewrite fgValueNumberSimd

* Rewrite fgValueNumberHWIntrinsic

* Rewrite GetVNFuncForNode

* Rewrite fgMorphTree & fgMorphSmpOpOptional

* Rewrite fgMorphFieldToSimdGetElement/fgMorphField

* Rewrite fgMorphOneAsgBlockOp

* Rewrite impInlineFetchArg

* Rewrite impSIMDRelOp

* Rewrite impSIMDIntrinsic

* Rewrite impBaseIntrinsic XARCH

* Rewrite impAvxOrAvx2Intrinsic XARCH

* Rewrite impSpecialIntrinsic ARM64

* Fix SSA Builder comments

* Delete GT_LIST

* Support GTF_REVERSE_OPS for GenTreeMultiOp

It turns out that in the time this change has been
sitting there, 3 new methods in the SPMI benchmarks
collection appeared, and it turns out they regress
because of the lack of GTF_REVERSE_OPS.

So, implement support for it....

This makes me quite sad, but it does make this change
a pure zero-diff one, which is good.

* Fix Linux x86 build break

* Fix formatting

* Improve readability through the use of a local

* Support external operand arrays in GenTreeMultiOp

* Fix formatting

* Tweak a constructor call

2 years ago[wasm] Run AOT, and Wasm.Build.Tests on windows (#59479)
Ankit Jain [Sat, 20 Nov 2021 01:19:19 +0000 (01:19 +0000)]
[wasm] Run AOT, and Wasm.Build.Tests on windows (#59479)

Adds two new jobs to runtime-staging for Windows - AOT, and Wasm.Build.Tests.

AOT - runs with the same conditions as the one in runtime
Wasm.Build.Tests - run for rolling builds, or when a narrow set of paths related to wasm build change
And do this for corresponding job in runtime for linux

Co-authored-by: Alexander Köplinger <alex.koeplinger@outlook.com>
2 years ago[wasm] Disable System.Text.RegularExpressions.Tests for AOT (#61803)
Ankit Jain [Sat, 20 Nov 2021 00:23:53 +0000 (00:23 +0000)]
[wasm] Disable System.Text.RegularExpressions.Tests for AOT (#61803)

2 years agoUpdate area-owners to reflect Libraries Area Pod changes (#61642)
Jeff Handley [Fri, 19 Nov 2021 23:43:05 +0000 (15:43 -0800)]
Update area-owners to reflect Libraries Area Pod changes (#61642)

* Update area-owners to reflect Libraries Area Pod changes

* Swap area leads between 2 libraries pods

* Remove Anipik from area ownership

Co-authored-by: Jeff Handley <1031940+jeffhandley@users.noreply.github.com>
2 years ago[Group 4] Enable nullable annotations for `Microsoft.Extensions.Configuration.Command...
Maksym Koshovyi [Fri, 19 Nov 2021 20:58:30 +0000 (22:58 +0200)]
[Group 4] Enable nullable annotations for `Microsoft.Extensions.Configuration.CommandLine` (#57432)

* Annotate

* Add net6 to parent projects

* DisableImplicitAssemblyReferences

* NetCoreAppMinimum

* configureSource is nullable

* Add NetCoreAppMinimum to System.Runtime and System.Collections

* Revert "Add NetCoreAppMinimum to System.Runtime and System.Collections"

This reverts commit fbfb3ba2b936588215b5ea45cdc50fd6cd861d8c.

* Fix NetCoreAppMinimum build

Co-authored-by: Eric Erhardt <eric.erhardt@microsoft.com>
2 years agoCreate empty zip files (#61828)
Kunal Pathak [Fri, 19 Nov 2021 18:43:54 +0000 (10:43 -0800)]
Create empty zip files (#61828)

2 years agoAllow runtimeconfig StartupHooks and Environment StartupHooks to both be present...
Tom de Goede [Fri, 19 Nov 2021 16:59:10 +0000 (17:59 +0100)]
Allow runtimeconfig StartupHooks and Environment StartupHooks to both be present (#61461)

Allow both env. variable `DOTNET_STARTUP_HOOKS` and the `.runtimeconfig.json` property `STARTUP_HOOKS` to be specified at the same time. The new behavior is to concatenate the two lists, with the env. variable content going first.

2 years agoEnable DD117522 test (#61585)
Michal Strehovský [Fri, 19 Nov 2021 14:30:46 +0000 (23:30 +0900)]
Enable DD117522 test (#61585)

Caught my attention because this is disabled outside issues.targets. This is apparently blocked on https://github.com/dotnet/runtime/issues/5907 which is a crossgen bug. I tried to /p:PublishReadyToRun=true this test locally and it seems to work fine with crossgen2.

2 years agoIntegration of changes in shared files from runtimelab/NativeAOT (#61655)
Michal Strehovský [Fri, 19 Nov 2021 14:29:38 +0000 (23:29 +0900)]
Integration of changes in shared files from runtimelab/NativeAOT (#61655)

2 years agoSwitch IP mapping lists to use jitstd::list (#61822)
Jakob Botsch Nielsen [Fri, 19 Nov 2021 13:09:56 +0000 (14:09 +0100)]
Switch IP mapping lists to use jitstd::list (#61822)

We may want to change the logic around how IP mappings are reported to
the EE, and the manually maintained singly-linked lists made it hard to
understand the logic that goes on here. Switch to jitstd::list which
allows us to simplify the logic by directly removing the mappings we do
not want to emit.

There are two small behavior changes here:
1. The previous logic would record superfluous IL offset 0 mappings
   under the assumption that the previous mapping was the prolog; this
   is not always the case, so check this explicitly
2. The previous logic would record _all_ CALL_INSTRUCTION mappings and
   would not use these to check whether to remove NO_MAP mappings.  This
   is superfluous as well, if we have a regular mapping at a native
   offset it does not give any information to add a NO_MAP mapping at
   the same native offset.

All diffs therefore look like the following. Case 1:
-IP mapping count : 7
+IP mapping count : 6
 IL offs PROLOG : 0x00000000 ( STACK_EMPTY )
 IL offs 0x0000 : 0x00000009 ( STACK_EMPTY )
 IL offs 0x0000 : 0x000000F4 ( STACK_EMPTY )
-IL offs 0x0000 : 0x000000F4 ( STACK_EMPTY )
 IL offs NO_MAP : 0x00000114 ( STACK_EMPTY )
 IL offs EPILOG : 0x0000011D ( STACK_EMPTY )
 IL offs 0x0000 : 0x00000124 ( STACK_EMPTY )

Case 2:
 IL offs 0x0000 : 0x000000D7 ( STACK_EMPTY )
 IL offs 0x0001 : 0x000000DE ( CALL_INSTRUCTION )
-IL offs NO_MAP : 0x000000E9 ( STACK_EMPTY )
 IL offs 0x000B : 0x000000E9 ( CALL_INSTRUCTION )
 IL offs NO_MAP : 0x000000F7 ( STACK_EMPTY )

2 years agoExpand One/Notone/Setlazy support to Lazy (#61784)
Stephen Toub [Fri, 19 Nov 2021 12:06:58 +0000 (07:06 -0500)]
Expand One/Notone/Setlazy support to Lazy (#61784)

The logic added in a recent PR to support simplified code generation for a Regex with {One/Notone/Set}lazy nodes is almost sufficient to support Lazy as well.  This fills the gap.  It also deletes an erroneous optimization added in .NET 5 that removed top-level Atomic nodes; the idea behind it was that such nodes are meaningless as, at the top-level, nothing can backtrack in anyway, but it then means that any node which is paying attention to whether its parent is Atomic may no longer find it (and that's needed by Lazy).

2 years agoReduce allocations for CreateDirectory (#61777)
Adam Sitnik [Fri, 19 Nov 2021 12:02:26 +0000 (13:02 +0100)]
Reduce allocations for CreateDirectory (#61777)

* introduce an overload that accepts ROS<char> instead of a string

* remove dead code

* avoid string allocations

* remove List<int> allocation

* Apply suggestions from code review

Co-authored-by: Stephen Toub <stoub@microsoft.com>
2 years agoDisable several failing tests on iOSSimulator arm64 (#61826)
Steve Pfister [Fri, 19 Nov 2021 11:45:18 +0000 (03:45 -0800)]
Disable several failing tests on iOSSimulator arm64 (#61826)

* Disable several failing tests on iOSSimulator arm64

A few tests popped up as failures on the rolling build due to parts of System.Diagnostics.Process throwing PNSE.  Disabled the functional tests from running on arm64 as mlaunch can't detect the return code.

* Update src/libraries/System.Runtime.Extensions/tests/System/EnvironmentTests.cs

Co-authored-by: Steve Pfister <steve.pfister@microsoft.com>
Co-authored-by: Alexander Köplinger <alex.koeplinger@outlook.com>
2 years agoInclude arch specific headers in standalone JITs (#61800)
Jakob Botsch Nielsen [Fri, 19 Nov 2021 10:52:00 +0000 (11:52 +0100)]
Include arch specific headers in standalone JITs (#61800)

Change CMake build for JIT to include headers and arch-specific headers
in the same way as sources. This makes arch-specific headers appear in
the correct standalone jit (clrjit_universel_arm64_x64 etc.) projects.

2 years agoTry to skip pause_* tests again (#61793)
Andy Gocke [Fri, 19 Nov 2021 08:04:46 +0000 (00:04 -0800)]
Try to skip pause_* tests again (#61793)

Fix typo

2 years agoSkip System.Diagnostics.TextWriterTraceListenerTests.XmlWriterTraceListenerTests...
Maxim Lipnin [Fri, 19 Nov 2021 02:57:31 +0000 (05:57 +0300)]
Skip System.Diagnostics.TextWriterTraceListenerTests.XmlWriterTraceListenerTests on iOS/tvOS (#61807)

This marks System.Diagnostics.TextWriterTraceListenerTests.XmlWriterTraceListenerTests withSkipOnPlatform attribute for iOS/tvOS as those tests try to create a process info, which throws PNSE after S.D.Process API's around libproc have been excluded in #61590.

2 years agoImprove superpmi-asmdiffs AzDO pipeline robustness (#61819)
Bruce Forstall [Fri, 19 Nov 2021 02:15:49 +0000 (18:15 -0800)]
Improve superpmi-asmdiffs AzDO pipeline robustness (#61819)

* Improve superpmi-asmdiffs AzDO pipeline robustness

1. When git fetching origin/main, use `--depth=500` to try to ensure
there is enough context to allow finding a JIT change in the history.
2. Add some error checking in pipeline setup so failures in setting
up the pipeline should fail the jobs early.

* Remove unneeded `success` variable from jitrollingbuild.py

2 years ago[DllImportGenerator] Don't flag methods with known unsupported UnmanagedType (#61808)
Elinor Fung [Fri, 19 Nov 2021 01:56:00 +0000 (18:56 -0700)]
[DllImportGenerator] Don't flag methods with known unsupported UnmanagedType (#61808)

2 years agoAdd JitDisasmWithDebugInfo (#61780)
Jakob Botsch Nielsen [Fri, 19 Nov 2021 00:49:21 +0000 (01:49 +0100)]
Add JitDisasmWithDebugInfo (#61780)

Add COMPlus_JitDisasmWithDebugInfo. When set and in verbose/disasm mode,
JIT will display inline comments with debug information before the
instructions that debug info applies to. Change superpmi with
--debuginfo to use this mode. Also small change to dotnet-pgo flow graph
dump to write offsets in the same format.

2 years ago[Group 4] Enable nullable annotations for `Microsoft.Extensions.Configuration.Environ...
Maksym Koshovyi [Fri, 19 Nov 2021 00:23:27 +0000 (02:23 +0200)]
[Group 4] Enable nullable annotations for `Microsoft.Extensions.Configuration.EnvironmentVariables` (#57433)

* Annotate

* Add net6 to parent projects

* Prefix can be null in AddEnvironmentVariables

* DisableImplicitAssemblyReferences

* Address PR feedback

- Add necessary TFMs
- Make configureSource action nullable

Co-authored-by: Eric Erhardt <eric.erhardt@microsoft.com>
2 years agoApply BuiltInComInterop feature switch to managed code (#54056)
Marek Safar [Thu, 18 Nov 2021 23:26:48 +0000 (00:26 +0100)]
Apply BuiltInComInterop feature switch to managed code (#54056)

* Apply BuiltInComInterop feature switch to managed code

* Feedback

* Remove two more

2 years agoJIT: support OSR for synchronized methods (#61712)
Andy Ayers [Thu, 18 Nov 2021 23:04:27 +0000 (15:04 -0800)]
JIT: support OSR for synchronized methods (#61712)

OSR methods share the "monitor acquired" flag with the original method.
The monitor acquired flag is s bit of non-IL live state that must be
recorded in the patchpoint.

Also, OSR methods only need to release the monitor as acquisition can
only happen in the original method.

2 years agoConvert System.Net.* over to GeneratedDllImport (#61765)
Aaron Robinson [Thu, 18 Nov 2021 22:12:52 +0000 (15:12 -0700)]
Convert System.Net.* over to GeneratedDllImport (#61765)

2 years agoFix building DllImportGeneratorSample (#61806)
Elinor Fung [Thu, 18 Nov 2021 20:14:11 +0000 (13:14 -0700)]
Fix building DllImportGeneratorSample (#61806)

2 years agoFix the only ilproj test that uses multiple command-line variants (#61750)
Tomáš Rylek [Thu, 18 Nov 2021 19:51:52 +0000 (20:51 +0100)]
Fix the only ilproj test that uses multiple command-line variants (#61750)

I believe that despite its singular nature this is worth a separate
review to make sure we're in agreement regarding the conversion
principles. There are several things worth noting here:

1) According to the current plan we're continuously documenting in
https://github.com/dotnet/runtime/issues/54512 we want to remove
command-line parameters from all test entrypoints. Variant tests
driven by command-line parameters should be turned into multiple
test cases marked with separate [Fact] attributes.

2) For ilproj tests, to facilitate local debugging, our current plan
is to keep them runnable as standalone executables. This implies that
ilproj tests comprising several [Fact] test entrypoints require a
new entrypoint that just calls into the individual test cases.

3) The Roslyn-generated merged wrapper for the tests won't care about
the "composite" main (that is for local debugging only), it will
directly identify and use the individual test cases marked with
[Fact] attributes.

4) In accordance with this scheme, such composite ILPROJ tests are
specific in not having their entrypoint method itself marked with
the [Fact] attribute.

5) Funnily enough this example nicely demonstrates the implied
cleanup - the entire command-line machinery is only used for a
handwritten switch to choose one of the three variants; moreover
we only exercised two out of the three variants, possibly due to
an authoring bug when creating the variant test, potentially caused
by previous complexity of such endeavor.

Thanks

Tomas

2 years agoRevert "Actually use TargetOS=AnyOS in the build-test-job. (#61745)" (#61799)
Jeremy Koritzinsky [Thu, 18 Nov 2021 19:33:25 +0000 (11:33 -0800)]
Revert "Actually use TargetOS=AnyOS in the build-test-job. (#61745)" (#61799)

2 years agoAdd tests verifying fast-path semantics for nullable structs (#61711)
Layomi Akinrinade [Thu, 18 Nov 2021 19:28:00 +0000 (11:28 -0800)]
Add tests verifying fast-path semantics for nullable structs (#61711)

2 years agoAdd ThrowIfNull overload for pointers (#61633)
Stephen Toub [Thu, 18 Nov 2021 19:16:51 +0000 (14:16 -0500)]
Add ThrowIfNull overload for pointers (#61633)

2 years agoActually use TargetOS=AnyOS in the build-test-job. (#61745)
Jeremy Koritzinsky [Thu, 18 Nov 2021 17:43:05 +0000 (09:43 -0800)]
Actually use TargetOS=AnyOS in the build-test-job. (#61745)

2 years ago[Group 4] Enable nullable annotations for `Microsoft.Extensions.Configuration.Binder...
Maksym Koshovyi [Thu, 18 Nov 2021 16:55:30 +0000 (18:55 +0200)]
[Group 4] Enable nullable annotations for `Microsoft.Extensions.Configuration.Binder` (#57418)

* Annotate

* Update Microsoft.Extensions.Configuration.Binder.csproj

* DisableImplicitAssemblyReferences

* Nullablity fix

* configureOptions are non-nullable

* Revert "configureOptions are non-nullable"

This reverts commit 5dac6136c32714414c964ce0445b5e31b3c78ead.

* NetCoreAppMinimum TFM

* Revert non-nullable changes

* Remove not needed project references

* Refactor while

* Revert non-nullable changes

* Fix up csproj files to build for necessary TFMs

Co-authored-by: Eric Erhardt <eric.erhardt@microsoft.com>
2 years ago[iOS] Follow up changes for 61590 (#61670)
Maxim Lipnin [Thu, 18 Nov 2021 16:29:32 +0000 (19:29 +0300)]
[iOS] Follow up changes for 61590 (#61670)

This is a follow up PR for #61590.

It includes:

 - additional UnsupportedOSPlatform annotations for some System.Diagnostics.Process APIs throwing PNSE on iOS/tvOS (they started doing so after excluding some managed logic around librpoc )

 - fixing a bit ugly workaround for CS0649 (see https://github.com/dotnet/runtime/pull/61590/files#r749525127) - used a local pragma in the ThreadInfo class.

 - skipping the respective S.D.P. tests ( it will address [iOS/tvOS] System.Diagnostics.Tests.ProcessTests.TestGetProcesses fails on devices #60588 as well)

2 years agoRemove duplicate checks (#61766)
Andrii Kurdiumov [Thu, 18 Nov 2021 14:46:46 +0000 (20:46 +0600)]
Remove duplicate checks (#61766)

These checks appears to be redundant.

2 years agoUpdate Area Owners for System.Data (#61748)
Cheena Malhotra [Thu, 18 Nov 2021 14:45:06 +0000 (06:45 -0800)]
Update Area Owners for System.Data (#61748)

2 years agoAdd single char lazy loop support to simplified Regex code gen (#61698)
Stephen Toub [Thu, 18 Nov 2021 14:30:24 +0000 (09:30 -0500)]
Add single char lazy loop support to simplified Regex code gen (#61698)

* Reduce atomic single char lazy loops

* Add single char lazy loop support to simplified code gen

2 years agoAdd support for dumping and using precise debug info (#61735)
Jakob Botsch Nielsen [Thu, 18 Nov 2021 13:31:41 +0000 (14:31 +0100)]
Add support for dumping and using precise debug info (#61735)

* In the JIT, add support for dumping the precise debug info out through
  an environment variable `DOTNET_JitDumpPreciseDebugInfoFile` in a
  simple JSON format. This is a stopgap until we expose the extra
  information through ETW events.

* In dotnet-pgo, add an argument --precise-debug-info-file which can
  point to the file produced by the JIT. When used, dotnet-pgo will get
  native<->IL mappings from this file instead of through ETW events.

* In dotnet-pgo, add support for attributing samples to inlinees when
  that information is present. This changes the attribution process a
  bit: previously, we would group all LBR data/samples and then
  construct the profile from all the data. We now do it in a more
  streaming way where there is a SampleCorrelator that can handle
  individual LBR records and individual samples.

* In dotnet-pgo, add an argument --dump-worst-overlap-graphs-to which
  can be used in the compare-mibc command to dump out a .dot file
  containing the flow graph of the methods with the worst overlap
  measures, and showing the relative weight count on each basic block
  and edge for the two profiles being compared. This is particular
  useful to find out where we are producing incorrect debug mappings, by
  comparing spgo.mibc and instrumented.mibc files.

2 years agoFileStatus.Unix/Process.Unix: align caching of user identity. (#60160)
Tom Deseyn [Thu, 18 Nov 2021 13:26:58 +0000 (14:26 +0100)]
FileStatus.Unix/Process.Unix: align caching of user identity. (#60160)

* FileStatus.Unix/Process.Unix: align implementation.

Process: remove the user identity caching and extend the logic
to avoid retrieving the identity in most cases by checking
if all x-bits are set or not set.

FileStatus: use same group check as Process.

FileStatus: cache the read only flag instead of caching the
identity.

2 years agoFileSystemEntry.Unix: ensure properties are available when file is deleted. (#60214)
Tom Deseyn [Thu, 18 Nov 2021 09:28:27 +0000 (10:28 +0100)]
FileSystemEntry.Unix: ensure properties are available when file is deleted. (#60214)

* FileSystemEntry.Unix: ensure attributes are available when file is deleted.

When the file no longer exists, we create attributes based on what we know.

The test for this was passing because it cached the attributes before the
item was deleted due to enumerating with skipping FileAttributes.Hidden.

* GetLength: fix reading from uninitialized cache.

2 years agoCreateDirectory: eliminate some syscalls. (#58799)
Tom Deseyn [Thu, 18 Nov 2021 09:22:54 +0000 (10:22 +0100)]
CreateDirectory: eliminate some syscalls. (#58799)

2 years agoReduce the output from tests. (#61593)
Marek Fišera [Thu, 18 Nov 2021 06:31:24 +0000 (07:31 +0100)]
Reduce the output from tests. (#61593)

- Do not printout exceptions from failing task tests.
- Remove default MONO_LOG_MASK=gc from debug configuration.

2 years agoUse GeneratedDllImport in System.Data.Odbc, System.IO.Ports, System.ServiceProcess...
Elinor Fung [Thu, 18 Nov 2021 06:00:20 +0000 (23:00 -0700)]
Use GeneratedDllImport in System.Data.Odbc, System.IO.Ports, System.ServiceProcess.ServiceController (#61741)

2 years agoConvert Crypto P/Invokes to GeneratedDllImport. (#61742)
Aaron Robinson [Thu, 18 Nov 2021 05:44:13 +0000 (22:44 -0700)]
Convert Crypto P/Invokes to GeneratedDllImport. (#61742)

* Convert Crypto P/Invokes to GeneratedDllImport.

2 years agoUpdate DNNE version (#61738)
Elinor Fung [Thu, 18 Nov 2021 02:57:42 +0000 (19:57 -0700)]
Update DNNE version (#61738)

2 years agoCreate runtime clone to manually kick off full test runs (#61641)
Steve Pfister [Thu, 18 Nov 2021 02:51:40 +0000 (18:51 -0800)]
Create runtime clone to manually kick off full test runs (#61641)

This change allows devs to manually kick off full test runs on the configurations that only execute smoke tests per PR.

To kick things off, you can run /azp run runtime-manual

2 years agoHide 'align' instruction behind jmp (#60787)
Kunal Pathak [Thu, 18 Nov 2021 02:13:59 +0000 (18:13 -0800)]
Hide 'align' instruction behind jmp (#60787)

* Hide align behind a jmp

fix the alignBytesRemoved

Some fixes and working model

Some fixes and redesign

Some more fixes

more fixes

fix

Add the check  for fgFirstBB

misc changes

code cleanup + JitHideAlignBehindJmp switch

validatePadding only if align are before the loop IG

More cleanup, remove commented code

jit format

* Fix a problem where curIG==0 and loop might be emitted in curIG, adjust the targetIG to prevIG

Add IGF_REMOVED_ALIGN flag for special scenarios

* Add stress mode to emit int3 for xarch

* Add stress mode to emit bkpt for arm64

* Add a loop align instruction placement phase

* review comments

* Change from unsigned short to unsigned

* review comments around cleanup

* emitForceNewIG

* Remove emitPrevIG

* Revert change to forceNewIG for align instruction

* Use loopAlignCandidates

* Use loopHeadIG reference

* jit format

* Remove unneeded method

* Misc changes

* Review feedback

* Do not include align behind Jmp in PerfScore calculation

* jit format and fix a bug

* fix the loopCandidates == 0 scenario

* Add unmarkLoopAlign(), add check for fgFirstBB

* merge conflict fix

* Add missing }

* Grammar nit

Co-authored-by: Bruce Forstall <brucefo@microsoft.com>
Co-authored-by: Bruce Forstall <brucefo@microsoft.com>
2 years agoRemove race condition from DllImportGenerator build (#61695)
Jeremy Koritzinsky [Thu, 18 Nov 2021 02:10:56 +0000 (18:10 -0800)]
Remove race condition from DllImportGenerator build (#61695)

2 years ago[wasm][debugger] Tie sdb agent lifetime to the ExecutionContext and simplify the...
Larry Ewing [Thu, 18 Nov 2021 02:01:20 +0000 (20:01 -0600)]
[wasm][debugger] Tie sdb agent lifetime to the ExecutionContext and simplify the api (#61392)

* Make SMonoSdbHelper part of the execution context

2 years agoUpload dasm files as artifacts for "asmdiffs pipeline" (#61700)
Kunal Pathak [Thu, 18 Nov 2021 01:57:07 +0000 (17:57 -0800)]
Upload dasm files as artifacts for "asmdiffs pipeline" (#61700)

* Temp change to disable align loop

* download specific artifacts

to squash:

* Upload .dasm files

* fix the build id

* Add ci_run and retainOnlyTopFiles

* Rename ci_run to retainOnlyTop

* Disable struct promo to test asmdiff

* Revert "Disable struct promo to test asmdiff"

This reverts commit 3ef7adb931c703e46628881335150ad3a6fa8bd8.

* fix the parameter retainOnlyTopFiles

* add missing -

* Revert "Temp change to disable align loop"

This reverts commit b1de5c4f9c15a6a61eba070908d2b6eb796fd8b1.

* Revert "download specific artifacts"

This reverts commit db3de57ef952137eb3eec24cf4ff73d6a1968762.

* Review comments

2 years agoRemove `DisableImplicitNamespaceImports_DotNet` (#61656)
Michal Strehovský [Thu, 18 Nov 2021 01:15:48 +0000 (10:15 +0900)]
Remove `DisableImplicitNamespaceImports_DotNet` (#61656)

Global usings no longer means "global breaking" after RC1.

2 years agosrc/tests tree test xunit-based source generated runner (#60846)
Jeremy Koritzinsky [Wed, 17 Nov 2021 23:50:34 +0000 (15:50 -0800)]
src/tests tree test xunit-based source generated runner (#60846)

Co-authored-by: Alexander Köplinger <alex.koeplinger@outlook.com>
Co-authored-by: Jan Kotas <jkotas@microsoft.com>
Co-authored-by: Santiago Fernandez Madero <safern@microsoft.com>
Co-authored-by: Tomas <trylek@microsoft.com>