platform/upstream/dotnet/runtime.git
2 years agoDelete duplicated consts in XmlUTF8TextReader (#63367)
Stephen Toub [Sat, 8 Jan 2022 20:22:56 +0000 (15:22 -0500)]
Delete duplicated consts in XmlUTF8TextReader (#63367)

This has no impact on the compiled code, but it's unnecessary.

2 years agoDelete dead null check in XmlQueryRuntime.DocOrderDistinct (#63371)
Stephen Toub [Sat, 8 Jan 2022 20:12:29 +0000 (15:12 -0500)]
Delete dead null check in XmlQueryRuntime.DocOrderDistinct (#63371)

2 years agoDelete a dead null check in TransactionStateDelegatedBase.EnterState (#63361)
Stephen Toub [Sat, 8 Jan 2022 20:10:15 +0000 (15:10 -0500)]
Delete a dead null check in TransactionStateDelegatedBase.EnterState (#63361)

2 years agoFix debug-only tracing in PhysicalMemoryMonitor.SetLimit (#63342)
Stephen Toub [Sat, 8 Jan 2022 20:09:43 +0000 (15:09 -0500)]
Fix debug-only tracing in PhysicalMemoryMonitor.SetLimit (#63342)

2 years agoIncrease timeout on regex test (#63529)
Dan Moseley [Sat, 8 Jan 2022 17:02:19 +0000 (10:02 -0700)]
Increase timeout on regex test (#63529)

2 years agoAdd Running on FreeBSD Instructions (#63417)
Thefrank [Sat, 8 Jan 2022 04:45:32 +0000 (20:45 -0800)]
Add Running on FreeBSD Instructions (#63417)

2 years ago[wasm][tests] Fix, and simplify sample building on CI (#63429)
Ankit Jain [Sat, 8 Jan 2022 04:45:04 +0000 (23:45 -0500)]
[wasm][tests] Fix, and simplify sample building on CI (#63429)

1. Instead of hardcoding specific command lines for wasm samples in `sendtohelixhelp.proj`, generate a run script, which allows moving the execution commands to the respective projects.
2. this enables running the library tests additionally for v8, and browser, in case of `runtime-manual`. This was recently changed to run only for nodejs
3. And avoids running samples on debugger tests build

2 years agoDelay load winrt (#63196)
NN [Sat, 8 Jan 2022 03:26:02 +0000 (05:26 +0200)]
Delay load winrt (#63196)

2 years agoFix translation of Ping error codes (#63237)
Robin Lindner [Sat, 8 Jan 2022 02:59:38 +0000 (03:59 +0100)]
Fix translation of Ping error codes (#63237)

* Fix translation of Ping error codes

* Modify SendPingToExternalHostWithLowTtlTest

* Usage of TtlReassemblyTimeExceeded

* Revert "Usage of TtlReassemblyTimeExceeded"

This reverts commit 9194df0d64949abdaccd4008e672d66cda4cfb22.

* Eliminate branch and fall-back to default

* Style change: Usage of switch expressions

* Style change : Usage of switch expressions

* Revert "Modify SendPingToExternalHostWithLowTtlTest"

This reverts commit fd76e9d2a360c246213c53ef8c13d6a36259de2b.

2 years agoFix exception propagation over HW exception frame on macOS arm64 (#63482)
Jan Vorlicek [Sat, 8 Jan 2022 00:50:58 +0000 (01:50 +0100)]
Fix exception propagation over HW exception frame on macOS arm64 (#63482)

* Fix exception propagation over HW exception frame on macOS arm64

There is a bug in setting up the fake stack frame for
the PAL_DispatchExceptionWrapper. The FP and SP were not saved
to the stack frame and the FP of the context was not set to
match the fake prologue. That caused failure to unwind over the
PAL_DispatchExceptionWrapper, reaching an unrelated native
function.

This change fixes it.

* Add regression tests for the issue

* Real fix of the issue

Unifies the hardware exception frame unwinding with Linux,
it is necessary on arm64 to get correct and distinct LR and
PC in the frame of the hardware exception.

2 years agoShow test names in merged wrapper execution log (#63511)
Tomáš Rylek [Fri, 7 Jan 2022 23:18:48 +0000 (00:18 +0100)]
Show test names in merged wrapper execution log (#63511)

This is a stopgap measure to make merged test logs easier to read.
Jeremy considers a broader cleanup of the test wrapper generator
that may ultimately supersede or replace this change.

Thanks

Tomas

2 years agoFix NETStandard library using JSON source gen (#63472)
Eric StJohn [Fri, 7 Jan 2022 23:09:38 +0000 (15:09 -0800)]
Fix NETStandard library using JSON source gen (#63472)

* Fix NETStandard library using JSON source gen

NETStandard libraries using JSON source gen would fail to load on
.NETCore due to missing IsExternalInit in the assembly.

On .NETCore this is defined, whereas on .NETStandard JSON carries an
internal copy.  The compiler emits references to the internal type when
a NETStandard library calls init-only setters in JSON types, but these
references are not satisfied when the library runs on .NETCore.

Fix this by adding a type forward to JSON for the IsExternalInit type.

* Address feedback

* Update src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Tests/NETStandardContextTests.cs

Co-authored-by: Eric Erhardt <eric.erhardt@microsoft.com>
Co-authored-by: Eric Erhardt <eric.erhardt@microsoft.com>
2 years agoHttpConnectionPool improvements (#62935)
Geoff Kizer [Fri, 7 Jan 2022 23:00:39 +0000 (15:00 -0800)]
HttpConnectionPool improvements (#62935)

(1) Reduce contention on the pool lock. This is done mainly by (a) not calling TrySetResult on the queued waiter under the lock -- instead, do this outside the lock and retry as necessary for canceled requests; (b) avoid doing diagnostic logging under the lock.
(2) Improve handling of failed connection attempts so we don't fail requests unnecessarily.

2 years agoMove init-vs-env in test build script down (#63433)
Michal Strehovský [Fri, 7 Jan 2022 22:44:34 +0000 (07:44 +0900)]
Move init-vs-env in test build script down (#63433)

`init-vs-env.cmd` is going to set up the environment for x86 tools (the "VS Developer Command Prompt") and that messes with things if they run before we run vcvarsall to set the actual target architecture, so it's better not to have such window. We might not even run the vcvarsall line if native test build is skipped.

As an additional improvement, init-vs-env.cmd can also run vcvarsall and set up CMake, so I'm asking it to do it (done by passing an extra parameter to the script to specify which environment to activate).

I need this change for a subsequent change that is broken if we have x86 tools set up.

2 years agoClarify P/Invoke shims guidance for OOB assemblies (#63470)
Matt Kotsenas [Fri, 7 Jan 2022 20:31:55 +0000 (12:31 -0800)]
Clarify P/Invoke shims guidance for OOB assemblies (#63470)

* Clarify P/Invoke shims guidance for OOB assemblies

The discussion in PR #63421 clarified that System.Native shims for UNIX
APIs aren't appropriate for assemblies that don't ship as part of the
Microsoft.NETCore.App framework.

Updating the interop guidelines to capture that clarification.

* Update docs/coding-guidelines/interop-guidelines.md

Co-authored-by: Stephen Toub <stoub@microsoft.com>
Co-authored-by: Stephen Toub <stoub@microsoft.com>
2 years agoUpdate coverlet to 3.1.0 and reportgenerator to 5.0.2 (#63491)
Stephen Toub [Fri, 7 Jan 2022 19:54:47 +0000 (14:54 -0500)]
Update coverlet to 3.1.0 and reportgenerator to 5.0.2 (#63491)

2 years agoMake delegates unsupported by JsonSerializer (#63495)
Layomi Akinrinade [Fri, 7 Jan 2022 19:26:40 +0000 (14:26 -0500)]
Make delegates unsupported by JsonSerializer (#63495)

2 years agoFix Creating Cultures with Sort Names (#63386)
Tarek Mahmoud Sayed [Fri, 7 Jan 2022 18:36:11 +0000 (10:36 -0800)]
Fix Creating Cultures with Sort Names (#63386)

Co-authored-by: kasperk81 <83082615+kasperk81@users.noreply.github.com>
2 years ago[LoongArch64] Port libraries directory (#62888)
Qiao [Fri, 7 Jan 2022 16:24:34 +0000 (00:24 +0800)]
[LoongArch64] Port libraries directory (#62888)

Co-authored-by: qiaopengcheng <qiaopengcheng-hf@loongson.cn>
Co-authored-by: Jan Kotas <jkotas@microsoft.com>
2 years agoSign ILVerification.dll (#63471)
Julien Couvreur [Fri, 7 Jan 2022 16:23:23 +0000 (08:23 -0800)]
Sign ILVerification.dll (#63471)

2 years agoSuppress warnings about [Obsolete] member usage in JSON src-gen'd code (#63496)
Layomi Akinrinade [Fri, 7 Jan 2022 14:04:57 +0000 (09:04 -0500)]
Suppress warnings about [Obsolete] member usage in JSON src-gen'd code (#63496)

2 years agoBump Microsoft.CodeAnalysis.CSharp version to 4.0.1 (#63492)
Stephen Toub [Fri, 7 Jan 2022 11:57:33 +0000 (06:57 -0500)]
Bump Microsoft.CodeAnalysis.CSharp version to 4.0.1 (#63492)

2 years agoUse "read" to fetch misaligned 64bit values from bundle header (#63431)
Vladimir Sadov [Fri, 7 Jan 2022 03:54:44 +0000 (19:54 -0800)]
Use "read" to fetch misaligned 64bit values from bundle header (#63431)

* Use "read" to fetch misaligned 64bit values

* remove read_direct

* rename read() -> read_byte()

2 years agoSupport for specifying max depth of generic cycle (#63435)
Steve [Fri, 7 Jan 2022 03:33:08 +0000 (11:33 +0800)]
Support for specifying max depth of generic cycle (#63435)

2 years ago[Revert] Reverted change to global build job (#63483)
Nathan Ricci [Fri, 7 Jan 2022 03:19:13 +0000 (22:19 -0500)]
[Revert] Reverted change to global build job (#63483)

2 years agoJIT: save generics context for late devirtualization (#63420)
Andy Ayers [Thu, 6 Jan 2022 23:57:54 +0000 (15:57 -0800)]
JIT: save generics context for late devirtualization (#63420)

If we have a non-inline candidate call with generics context, save
the context so it's available for late devirtualization.

Fixes a missing devirtualization reported in #63283.

I am deliberately leaving `LateDevirtualizationInfo` more general than
necessary as it may serve as a jumping-off point for enabling late
inlining.

2 years ago[DRAFT][Perf][Mono] Enable llvm for arm perf runs (#63311)
Nathan Ricci [Thu, 6 Jan 2022 22:24:20 +0000 (17:24 -0500)]
[DRAFT][Perf][Mono] Enable llvm for arm perf runs (#63311)

Enable llvm for arm perf runs.

2 years ago[mono] Make some icalls pass/return object references using ObjectHandleOnStack/QCall...
Zoltan Varga [Thu, 6 Jan 2022 22:16:13 +0000 (17:16 -0500)]
[mono] Make some icalls pass/return object references using ObjectHandleOnStack/QCallTypeHandle (#62141)

* [mono] Make some icalls return objects using an extra ObjectHandleOnStack argument.

* Fix the passing of scalar vtypes on wasm.

* Convert RuntimeTypeHandle icalls to receive a QCallTypeHandle.

Also do some other cleanups:
* Convert some icalls which don't receive/return objects any more and don't
  return an error to NOHANDLES.
* Implement IsGenericVariable in managed code.
* Add a separate GetMetadataToken icall to avoid the REUSE_WRAPPER stuff.
* Sync the implementation of IsTypeDefinition with coreclr.

* Convert some RuntimeType icalls to use QCallTypeHandles/ObjectHandleOnStack.

* Fix RuntimeType.GetPacking () to work with dynamic types.

* Convert internal_from_name to use QCallTypeHandles/ObjectHandleOnStack.

* Convert more icalls.

* Update src/libraries/System.Private.CoreLib/src/System/Runtime/CompilerServices/QCallHandles.cs

Co-authored-by: Aleksey Kliger (λgeek) <akliger@gmail.com>
* Remove unused argument from RuntimeTypeHandle:internal_from_name ().

* Add support for FRAME_TYPE_IL_STATE to the metadata stack walker code.

* Update coding style in QCallTypeHandle:.ctor ().

* Revert "Convert more icalls."

* Convert some Delegate icalls.

* Convert some Enum icalls.

* Convert some Marshal icalls.

* Avoid creating RuntimeType objects while AOTing.

* Convert some RuntimeType icalls.

Co-authored-by: Aleksey Kliger (λgeek) <akliger@gmail.com>
2 years ago[DllImportGenerator] Remove DLLIMPORTGENERATOR_ENABLED define (#63464)
Elinor Fung [Thu, 6 Jan 2022 22:10:02 +0000 (17:10 -0500)]
[DllImportGenerator] Remove DLLIMPORTGENERATOR_ENABLED define (#63464)

2 years agoFix bugs with generation for ctor param default values (#62798)
Layomi Akinrinade [Thu, 6 Jan 2022 22:08:01 +0000 (17:08 -0500)]
Fix bugs with generation for ctor param default values (#62798)

* Fix bugs with generation for ctor param default values

* Address review feedback

* Address feedback

2 years agoConvert JIT/Methodical/Array/range Pri0 tests and hook up mobile testing (#62752)
Jeremy Koritzinsky [Thu, 6 Jan 2022 21:51:48 +0000 (13:51 -0800)]
Convert JIT/Methodical/Array/range Pri0 tests and hook up mobile testing (#62752)

Co-authored-by: Tomas <trylek@microsoft.com>
2 years ago[mono] Reorganize zlib dependency logic (#63365)
Aleksey Kliger (λgeek) [Thu, 6 Jan 2022 21:18:42 +0000 (16:18 -0500)]
[mono] Reorganize zlib dependency logic  (#63365)

* [mono] Add back HAVE_SYS_ZLIB support

In particular this re-enables embedded PDB support on iOS and Android

* [mono] Reorganize zlib dependency logic

Instead of deciding whether features are enabled based on the presence or
absense of zlib, add switches to control features (embedded PDB support, and
compressed log profiler output) and based on that require zlib.

On some platforms we use the in-tree copy of zlib from
src/native/external/zlib, otherwise we want to link against the system zlib.

Previously, if zlib was missing the build would quietly succeed, but the
feature support would be missing.  Now, if the feature isn't disabled but zlib
is missing, we fail the build.

If both features are disabled, don't depend on zlib at all.

* Fix typos

Co-authored-by: Adeel Mujahid <3840695+am11@users.noreply.github.com>
* Style nits

- reverse if() logic to avoid negation

- use cmakedefine without a value in config.h.in, same as CoreCLR

Co-authored-by: Adeel Mujahid <3840695+am11@users.noreply.github.com>
2 years agoFix stack overflow with X509Certificate FriendlyName
Kevin Jones [Thu, 6 Jan 2022 21:15:18 +0000 (16:15 -0500)]
Fix stack overflow with X509Certificate FriendlyName

A FriendlyName in Windows' length is a DWORD, an unsigned integer. We
however marshal it as a signed integer, so a friendly name with a
length greater than int.MaxValue would wrap around to negative. This
in turn would be "below" the stackalloc threshold, and attempt to stackalloc
a negative value. stackalloc treats this value as unsigned, so it results
in allocating too much on the stack.

2 years agoEnsure UserSecretsIdAttribute is added to assembly (#63415)
Eric Erhardt [Thu, 6 Jan 2022 20:54:23 +0000 (14:54 -0600)]
Ensure UserSecretsIdAttribute is added to assembly (#63415)

When Microsoft.Extensions.Configuration.UserSecrets is referenced transitively, for example through Extensions.Hosting, the UserSecretsIdAttribute isn't getting added to the built assembly. This is because the logic is contained in a `build` folder which is excluded by the dependency from Extensions.Hosting.

The fix is to move the logic to `buildTransitive`, so it gets picked up by NuGet. One wrinkle is that the logic now conflicts with the netstandard compatibility logic added by the library infrastructure. In order to make progress, disable that logic for this package and rely on its dependencies to raise the compat error.

Contributes to #63246

2 years agoRefactor DllImports in Microsoft.Extensions.Hosting.Systemd (#63421)
Matt Kotsenas [Thu, 6 Jan 2022 20:18:04 +0000 (12:18 -0800)]
Refactor DllImports in Microsoft.Extensions.Hosting.Systemd (#63421)

2 years agoFix time reporting for the merged tests (#63452)
Tomáš Rylek [Thu, 6 Jan 2022 20:13:47 +0000 (21:13 +0100)]
Fix time reporting for the merged tests (#63452)

In XUnitWrapperGenerator we need to initialize the stopwatch
variable using Stopwatch.StartNew(), not just new Stopwatch(),
otherwise the stopwatch never starts to run, that's why all the
test case times showed as zero. (Alternatively we could use
new Stopwatch() followed by stopwatch.Start() but I believe that
Stopwatch.StartNew() is generally considered to be more
performant.)

After applying this fix, some short test times started reporting
their running time in scientific notation (e.g. 5.5e-5) so I
modified the formatting to F6 - in the Methodical suite I see
a test running for 55 microseconds.

Thanks

Tomas

2 years agoMake DllImportGenerator unit tests' compilations use live refs (#63410)
Elinor Fung [Thu, 6 Jan 2022 19:36:54 +0000 (14:36 -0500)]
Make DllImportGenerator unit tests' compilations use live refs (#63410)

2 years ago[wasm] Fix test filtering for debugger tests on windows (#63380)
Ankit Jain [Thu, 6 Jan 2022 16:51:33 +0000 (11:51 -0500)]
[wasm] Fix test filtering for debugger tests on windows (#63380)

This caused the disabled ArrayTests to run on windows, causing the builds to fail. With this change, the tests should correctly get skipped on windows.

2 years agoInclude properties on records for (de)serialization in source-gen (#62668)
Layomi Akinrinade [Thu, 6 Jan 2022 16:01:27 +0000 (11:01 -0500)]
Include properties on records for (de)serialization in source-gen (#62668)

2 years ago[wasm][debugger] GetProperties broken on chrome (#63403)
Thays Grazia [Thu, 6 Jan 2022 07:33:43 +0000 (04:33 -0300)]
[wasm][debugger] GetProperties broken on chrome (#63403)

* Fixing how we test and the implementation after #62627

* Passing null to name.

2 years agoConvert SAL1 to SAL2 (#63333)
NN [Thu, 6 Jan 2022 06:49:08 +0000 (08:49 +0200)]
Convert SAL1 to SAL2 (#63333)

2 years agoArm64: Memory barrier improvements (#62895)
Kunal Pathak [Wed, 5 Jan 2022 23:37:43 +0000 (15:37 -0800)]
Arm64: Memory barrier improvements (#62895)

* Use ishst instead of ish

* Do not contain address of volatile fields

* Do not contain address only for Arm64

* Remove ishst

2 years agoJIT: refactor fields of GenTreeCall (#63402)
Andy Ayers [Wed, 5 Jan 2022 23:34:19 +0000 (15:34 -0800)]
JIT: refactor fields of GenTreeCall (#63402)

Move `gtStubCallStubAddr` out of the union it shares with class probe,
inline, and guarded devirt information, so that we no longer need to
save and restore the stub address when we want to probe, guardedly
devirtualize, or inline calls.

Delete all the code that did saving and restoring, and the field in the
inline info struct that held the saved copy.

2 years agoHandle race condition when HttpListener is stopped or closed (#63394)
Kevin Gosse [Wed, 5 Jan 2022 18:46:20 +0000 (19:46 +0100)]
Handle race condition when HttpListener is stopped or closed (#63394)

* Throw a HttpListenerException if the session is null

* Add similar check to BeginGetContext

* Address PR feedback

* Remove trailing spaces

2 years agoFix the MacOS remote unwinder for VS4Mac (#63378)
Mike McLaughlin [Wed, 5 Jan 2022 18:39:27 +0000 (10:39 -0800)]
Fix the MacOS remote unwinder for VS4Mac (#63378)

The wrong module was being passed to the remote unwinder because the load bias for shared modules
was being calculated incorrectly.

2 years agoFix MethodDesc::CbStackPop for string ctors on x86 (#63391)
Jan Vorlicek [Wed, 5 Jan 2022 16:19:16 +0000 (17:19 +0100)]
Fix MethodDesc::CbStackPop for string ctors on x86 (#63391)

This method was not taking into account the fact that string ctors
don't have dummy this argument after a recent change. Stack walking
in cases where prestub for the ctor was invoked resulted in a wrong
unwinding of ESP for ctors with more than one argument.

This change fixes it by removing "has this" flag from the signature
before getting the stack arguments size.

2 years agoDelete __SkipCrossgenFramework (#63390)
Michal Strehovský [Wed, 5 Jan 2022 14:18:40 +0000 (23:18 +0900)]
Delete __SkipCrossgenFramework (#63390)

This has been unused ever since crossgenning framework moved to build.proj.

2 years agoRemove some unnecessary duplicated checks (#63341)
Stephen Toub [Wed, 5 Jan 2022 11:42:27 +0000 (06:42 -0500)]
Remove some unnecessary duplicated checks (#63341)

* Remove unnecessary duplicate check in DeflateManagedStream ctor

* Remove duplicate null check in JsonSerializer.Deserialize

* Delete duplicate check in XmlSerializationWriterILGen.WriteQualifiedNameElement

* Delete duplicate rule check in XmlTreeGen.AutoGenerated

2 years agoSimplify condition in System.Private.CoreLib.Shared.projitems (#63388)
Jan Kotas [Wed, 5 Jan 2022 11:41:47 +0000 (03:41 -0800)]
Simplify condition in System.Private.CoreLib.Shared.projitems (#63388)

2 years agoRemove dead code in OdbcCommandBuilder.UnquoteIdentifier (#63363)
Stephen Toub [Wed, 5 Jan 2022 11:38:37 +0000 (06:38 -0500)]
Remove dead code in OdbcCommandBuilder.UnquoteIdentifier (#63363)

Exact same pattern was previously changed in OleDbCommandBuilder.

2 years ago[main] Update dependencies from dotnet/linker (#63336)
dotnet-maestro[bot] [Wed, 5 Jan 2022 10:53:59 +0000 (11:53 +0100)]
[main] Update dependencies from dotnet/linker (#63336)

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
2 years ago[main] Update dependencies from 6 repositories (#63252)
dotnet-maestro[bot] [Wed, 5 Jan 2022 10:53:30 +0000 (11:53 +0100)]
[main] Update dependencies from 6 repositories (#63252)

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
2 years agoReplace name with type and codepage in EncodingConversionOverflow exception (#62910)
Marek Safar [Wed, 5 Jan 2022 09:32:09 +0000 (10:32 +0100)]
Replace name with type and codepage in EncodingConversionOverflow exception (#62910)

2 years agoFix running WASM tests locally on Windows (#63334)
Marek Fišera [Wed, 5 Jan 2022 07:59:55 +0000 (08:59 +0100)]
Fix running WASM tests locally on Windows (#63334)

Set BROWSER_PATH variable only when HELIX_CORRELATION_PAYLOAD variable is set.

Fixes change in the https://github.com/dotnet/runtime/pull/62779.

2 years agoRemove dependency of type system tests on ILCompiler.ReadyToRun (#63323)
Michal Strehovský [Wed, 5 Jan 2022 06:15:52 +0000 (15:15 +0900)]
Remove dependency of type system tests on ILCompiler.ReadyToRun (#63323)

This is now shared unit test project that is not AOT/JIT specific.

The recently added MarshalUtilsTests.cs created a dependency on these.

2 years agoImplement IEquatable<T> on the runtime handle types. (#63358)
Theodore Tsirpanis [Wed, 5 Jan 2022 02:20:03 +0000 (04:20 +0200)]
Implement IEquatable<T> on the runtime handle types. (#63358)

2 years agoMove HttpRequestStream.{Begin}Read argument logging to after validation (#63362)
Stephen Toub [Wed, 5 Jan 2022 01:05:34 +0000 (20:05 -0500)]
Move HttpRequestStream.{Begin}Read argument logging to after validation (#63362)

It's after validation on the HttpResponseStream corresponding methods, and having it before the validation means it'll null ref if a null buffer is erroneously provided.

2 years agoFix null ref for null Stream input in Icon.Save (#63369)
Stephen Toub [Wed, 5 Jan 2022 01:05:12 +0000 (20:05 -0500)]
Fix null ref for null Stream input in Icon.Save (#63369)

2 years agoRemove unnecessary field writes in MimePart.SetContent (#63368)
Stephen Toub [Wed, 5 Jan 2022 01:04:35 +0000 (20:04 -0500)]
Remove unnecessary field writes in MimePart.SetContent (#63368)

2 years agoFix LazyMemberInfo.Equals to return false for null (#63372)
Stephen Toub [Wed, 5 Jan 2022 01:04:14 +0000 (20:04 -0500)]
Fix LazyMemberInfo.Equals to return false for null (#63372)

2 years agoUpdate Codespaces instructions for latest (#63376)
Eric Erhardt [Tue, 4 Jan 2022 23:58:26 +0000 (17:58 -0600)]
Update Codespaces instructions for latest (#63376)

2 years agoPass configuration as a parameter for local Apple mobile test runs (#63348)
Steve Pfister [Tue, 4 Jan 2022 20:57:06 +0000 (12:57 -0800)]
Pass configuration as a parameter for local Apple mobile test runs (#63348)

Reverts #62549 as the configuration parameter is needed to let xharness know where the iOS/tvOS/MacCatalyst test app is.

For example, a debug test app will be under Debug-iphoneos and a release one will be under Release-iphoneos. Xharness won't be able to tell unless provided the right info.

2 years agoclean up header collection property implementations (#63308)
Geoff Kizer [Tue, 4 Jan 2022 20:37:02 +0000 (12:37 -0800)]
clean up header collection property implementations (#63308)

Co-authored-by: Geoffrey Kizer <geoffrek@windows.microsoft.com>
2 years agoAdd comment about using source-generated p/invokes to interop guidelines (#63350)
Elinor Fung [Tue, 4 Jan 2022 20:29:44 +0000 (15:29 -0500)]
Add comment about using source-generated p/invokes to interop guidelines (#63350)

2 years agoEnable support for nint/nuint for Vector64/128/256<T> (#63329)
Tanner Gooding [Tue, 4 Jan 2022 20:02:37 +0000 (12:02 -0800)]
Enable support for nint/nuint for Vector64/128/256<T> (#63329)

* Enable support for nint/nuint for Vector64/128/256<T>

* Adding the additional Vector64/128/256<T> APIs required to support nint/nuint

* Removing the "NotSupported" tests for nint/nuint of Vector64/128/256<T>

2 years agoDisable console test for jitstressreg mode (#63349)
Dan Moseley [Tue, 4 Jan 2022 19:50:12 +0000 (12:50 -0700)]
Disable console test for jitstressreg mode (#63349)

* Revert "logging (#63326)"

This reverts commit 312c66f1fc2f749f56612999cb1adab9ca7fde59.

* disable test for jit stress regs

2 years agoFix order of line number/position arguments to XsltException ctor (#63344)
Stephen Toub [Tue, 4 Jan 2022 17:49:50 +0000 (12:49 -0500)]
Fix order of line number/position arguments to XsltException ctor (#63344)

2 years agoFix Instrument.ts_tags to be static in .NET Framework build (#63343)
Stephen Toub [Tue, 4 Jan 2022 17:33:13 +0000 (12:33 -0500)]
Fix Instrument.ts_tags to be static in .NET Framework build (#63343)

2 years agoDivide properties into: public, private, protected. (#62627)
Ilona Tomkowicz [Tue, 4 Jan 2022 15:12:26 +0000 (16:12 +0100)]
Divide properties into: public, private, protected. (#62627)

* Description of DebuggerBrowsable behavior.

* Added test for browse attributes.

* Corrected typos in the doc.

* Added Browse Never feature. Corrected Collapse test. ToDo: RootHidden.

* Draft of RootHidden solution.

* Added Array to test cases as it behaves differently than Collection.

* Added name concatenation to make array/list elemetns in debug window unique.

* Update docs/design/mono/debugger.md

Co-authored-by: Ankit Jain <radical@gmail.com>
* Applied PR review suggestions.

* Added a reference to regular Browsable attribute behavior in .net.

* Applied most of review suggestions.

* Stopping GetFieldsValue early.

* Remove unintentional change to the original code.

* Do not skip fields that don't have browsable attributes.

* Changing the expected behavior to match Console Application. EventHandlers are Browsable.Never by default.

* Changed the place of checking if objetc is an array.

* Update src/mono/wasm/debugger/DebuggerTestSuite/EvaluateOnCallFrameTests.cs

Co-authored-by: Ankit Jain <radical@gmail.com>
* Removed unused variables.

* Removing space and unused import.

* Draft - parameter for choosing sorted and unsorted returned value version.

* Working version.

* Added "protected internal" and "private protected" cases. Changed field name to be consistant with the value.

* Changed approach: placed sorting at the end of the function, not in the middle.

* Fix for tests that use GetProperties.

* Fixed most tests (31 failing).

* Removed whitespaces.

* Fixed CheckAccessorsOnObjectsWithCFO tests.

* Fix for InspectTypeInheritedMembers.

* Revert unnecessary indent change.

* Partially addressed @radical comments.

* Addressed the comment about extension instead of Union.

* Removed string cultural vunerability.

* Added Properties dictionary, the same as for fields.

* Fixed the bug I made by using dynamc.

* Applying @radical comments about refactoring.

* Corrected typo.

* Added tests for properties.

* Draft of changes for properties handling - never and root hidden failing.

* Fix for RootHidden properties.

* Added tests for static fields decorated with Browsable.

* Correct a typo.

* Undo merge unintentional changes.

* Changing expected behavior for MulticastDelegateTest - in Console Application EventHandler is Browsable.Never by default so we should not expect it to be visible in the debug window.

* Removing not relevant changes created after merge with main.

* Remove file added in merge with main.

* Revert "Removing not relevant changes created after merge with main."

This reverts commit b1acf8b546d1b95bea101290c25ec7f15cb78799.

* Revert.

* Revert revert.

* One broken test for custom getter.

* Ugly fix to make all the tests work.

* Refactored JArray aggregation to Dictionary.

* Better naming.

* Add skipped change from merge.

* Fix getters testing.

* Removed unnecessary doubled execution.

* Decreased complexity by replacing a loop with data aggregation.

* Replaced O(nm) Linq with O(n) loop through dictionary.

* Remove comment, flip conditions.

* Removed not intended comments and changes.

* Missing removal for previous commit.

* Added tests for protection levels.

Co-authored-by: Ankit Jain <radical@gmail.com>
2 years ago[DllImportGenerator] Update buffer size field for custom marshalling (#63316)
Elinor Fung [Tue, 4 Jan 2022 14:22:35 +0000 (09:22 -0500)]
[DllImportGenerator] Update buffer size field for custom marshalling (#63316)

2 years agologging (#63326)
Dan Moseley [Tue, 4 Jan 2022 06:37:56 +0000 (23:37 -0700)]
logging (#63326)

2 years agoAccelerate additional cross platform hardware intrinsics (#61649)
Tanner Gooding [Tue, 4 Jan 2022 03:56:15 +0000 (19:56 -0800)]
Accelerate additional cross platform hardware intrinsics (#61649)

* Updating Vector64/128/256.IsHardwareAccelerated to be treated as a constant and return true where supported

* Accelerate the CmpOpAll intrinsics

* Accelerate the CmpOpAny intrinsics

* Accelerate the ConverToDouble/Int32/Int64/Single/UInt32/UInt64 intrinsics

* Applying formatting patch

* Fixing ConvertToInt32 and ConvertToSingle to use the right intrinsic

* Fixing some issues and assert types are correct

* Updating ConvertToDouble and ConvertToSingle to have correct vectorized versions on x86/x64

* Ensure Vector<T>.ConvertToDouble/Single are accelerated

* Swap operands and invert immediate so the constant can be contained on blend

* Restrict ConvertToDouble(Vector128<UInt64>) tests to inputs no more than long.MaxValue

* Ensure that we create a long/ulong rather than a uint

2 years agoFix GetSpanDataFrom (#63306)
David Wrighton [Tue, 4 Jan 2022 03:22:00 +0000 (19:22 -0800)]
Fix GetSpanDataFrom (#63306)

- GC Protect the type parameter
- set data to value before asserting that it isn't NULL

Fixes #62285

Co-authored-by: Jan Kotas <jkotas@microsoft.com>
Co-authored-by: Aaron Robinson <arobins@microsoft.com>
2 years agoFix missing space in literal
Stephen Toub [Tue, 4 Jan 2022 02:24:22 +0000 (21:24 -0500)]
Fix missing space in literal

2 years agoAdd some diagnostics for EFS tests (#63243)
Dan Moseley [Tue, 4 Jan 2022 01:55:18 +0000 (18:55 -0700)]
Add some diagnostics for EFS tests (#63243)

* diagnostics

* make outerloop

* fix linux build

* space

* feedback

* Apply suggestions from code review

Co-authored-by: Stephen Toub <stoub@microsoft.com>
Co-authored-by: Stephen Toub <stoub@microsoft.com>
2 years agoRevert SafeBuffer change around pointer initialization (#63289)
Stephen Toub [Tue, 4 Jan 2022 01:38:58 +0000 (20:38 -0500)]
Revert SafeBuffer change around pointer initialization (#63289)

2 years agoA few minor tweaks to Regex source generator rendering (#63276)
Stephen Toub [Tue, 4 Jan 2022 01:38:43 +0000 (20:38 -0500)]
A few minor tweaks to Regex source generator rendering (#63276)

* Do addition for EndZ matching at compile time

* Tweak rendering of optional loops to say "Optional" rather than "Loop optionally"

* Remove "at least X" from loop description when X is 0

* Add a missing blank line at the beginning of a back reference

* Rename ReturnFalse to NoStartingPositionFound

* Delete stale comments

* Address PR feedback

2 years agoExtend case optimization in MatchCharacterClass to all chars that differ by one bit...
Stephen Toub [Tue, 4 Jan 2022 01:38:30 +0000 (20:38 -0500)]
Extend case optimization in MatchCharacterClass to all chars that differ by one bit (#63275)

2 years agoExtend CPU capabilities detection for osx-arm64 (#62832) (#62958)
neon-sunset [Tue, 4 Jan 2022 01:12:39 +0000 (03:12 +0200)]
Extend CPU capabilities detection for osx-arm64 (#62832) (#62958)

* Extend CPU capabilities detection for osx-arm64 (#62832)

* Revert uncoditional enable for dczva on osx-arm64

2 years agoRobustify a name resolution test (#63259)
Dan Moseley [Tue, 4 Jan 2022 01:05:10 +0000 (18:05 -0700)]
Robustify a name resolution test (#63259)

* fix TryGetAddrInfo_HostName_TryGetNameInfo()

* Fix network test

2 years agomake sure OpenSSL is initialized before Tls13Supported code runs (#62973)
Tomas Weinfurt [Tue, 4 Jan 2022 00:37:46 +0000 (16:37 -0800)]
make sure OpenSSL is initialized before Tls13Supported code runs (#62973)

* make sure OpenSSL is initialized before Tls13Supported code runs

* feedback from review

* Update src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Ssl.cs

Co-authored-by: Stephen Toub <stoub@microsoft.com>
Co-authored-by: Stephen Toub <stoub@microsoft.com>
2 years agoDelete ILCompiler.TypeSystem.ReadyToRun project (#63313)
Michal Strehovský [Tue, 4 Jan 2022 00:31:00 +0000 (09:31 +0900)]
Delete ILCompiler.TypeSystem.ReadyToRun project (#63313)

Replaced with a single ILCompiler.TypeSystem shared between crossgen2 and ilc.

2 years agoUpdate COM host to match RegAsm registration behavior (#63292)
Aaron Robinson [Mon, 3 Jan 2022 23:36:50 +0000 (15:36 -0800)]
Update COM host to match RegAsm registration behavior (#63292)

* Update COM host to match RegAsm registration behavior

2 years agoFixed ILVerify incorrectly flagging valid default interface implementations (#61185)
Benjamin Bartels [Mon, 3 Jan 2022 23:36:18 +0000 (23:36 +0000)]
Fixed ILVerify incorrectly flagging valid default interface implementations (#61185)

* Added logic for default interface method traversal to ILVerify method discovery

* Added Tests for DefaultImplFix

* Moved call to default interface impl resolution outside of ResolveInterfaceMethodTarget

2 years agotransform sgen_get_descriptor to parallel safe version in job_major_mod_union_preclea...
monojenkins [Mon, 3 Jan 2022 21:54:19 +0000 (16:54 -0500)]
transform sgen_get_descriptor to parallel safe version in job_major_mod_union_preclean (#63293)

Fixes mono/mono#21369
Related to https://github.com/xamarin/xamarin-android/issues/6546

job_major_mod_union_preclean can race with the tarjan bridge
implementation that changes the vtable pointer by settings the three
lower bits. this results in invalid loading of the vtable
(shifted by 7 bytes)  which in turn give a wrong desc to the scan
functions

This change is released under the MIT license.

Co-authored-by: tmijieux <tmijieux@users.noreply.github.com>
2 years agoDo not create non-null assertions from location nodes (#62743)
SingleAccretion [Mon, 3 Jan 2022 21:03:55 +0000 (00:03 +0300)]
Do not create non-null assertions from location nodes (#62743)

2 years agoUse SAL2 _In_, _Out_ to prevent conflicts (#63261)
NN [Mon, 3 Jan 2022 20:29:30 +0000 (22:29 +0200)]
Use SAL2 _In_, _Out_ to prevent conflicts (#63261)

2 years agoUnify threading between crossgen2 and ilc (#63282)
Michal Strehovský [Mon, 3 Jan 2022 20:00:43 +0000 (05:00 +0900)]
Unify threading between crossgen2 and ilc (#63282)

They don't have to differ in the `--parallelism` vs `--singlethreaded` argument.

2 years agoFix user => use typo in comments (#63288)
Stephen Toub [Mon, 3 Jan 2022 19:56:44 +0000 (14:56 -0500)]
Fix user => use typo in comments (#63288)

2 years agoUse pattern matching to reduce some duplication (#63278)
Stephen Toub [Mon, 3 Jan 2022 19:02:58 +0000 (14:02 -0500)]
Use pattern matching to reduce some duplication (#63278)

2 years ago[mono] Don't access MonoClassField:parent directly (#63081)
Aleksey Kliger (λgeek) [Mon, 3 Jan 2022 19:01:21 +0000 (14:01 -0500)]
[mono] Don't access MonoClassField:parent directly (#63081)

Rename it to parent_ and add m_field_get_parent / m_field_set_parent accessors.

(The intention is to borrow the bottom bit of the pointer for an EnC metadata
update flag)

2 years agoMark Go override as SkipLocalsInit if possible (#63277)
Stephen Toub [Mon, 3 Jan 2022 18:32:34 +0000 (13:32 -0500)]
Mark Go override as SkipLocalsInit if possible (#63277)

It can have so many locals that zero-initing is measurable.

2 years agoadd missing PTEST docs (#62122)
Clinton Ingram [Mon, 3 Jan 2022 18:17:32 +0000 (10:17 -0800)]
add missing PTEST docs (#62122)

2 years agoLast ILCompiler.TypeSystem <-> ILCompiler.TypeSystem.ReadyToRun diff (#63281)
Michal Strehovský [Mon, 3 Jan 2022 16:28:03 +0000 (01:28 +0900)]
Last ILCompiler.TypeSystem <-> ILCompiler.TypeSystem.ReadyToRun diff (#63281)

After this and dotnet/runtime#63280 there will be no differences between ILCompiler.TypeSystem and ILCompiler.TypeSystem.ReadyToRun and we can unify them.

2 years agoFix issues in PAL (#62625)
Andrii Kurdiumov [Mon, 3 Jan 2022 13:54:45 +0000 (19:54 +0600)]
Fix issues in PAL (#62625)

2 years ago[wasm][debugger] Add Browsable Attribute support. (#62045)
Ilona Tomkowicz [Mon, 3 Jan 2022 12:43:26 +0000 (13:43 +0100)]
[wasm][debugger] Add Browsable Attribute support. (#62045)

* Description of DebuggerBrowsable behavior.

* Added test for browse attributes.

* Corrected typos in the doc.

* Added Browse Never feature. Corrected Collapse test. ToDo: RootHidden.

* Draft of RootHidden solution.

* Added Array to test cases as it behaves differently than Collection.

* Added name concatenation to make array/list elemetns in debug window unique.

* Update docs/design/mono/debugger.md

Co-authored-by: Ankit Jain <radical@gmail.com>
* Applied PR review suggestions.

* Added a reference to regular Browsable attribute behavior in .net.

* Applied most of review suggestions.

* Stopping GetFieldsValue early.

* Remove unintentional change to the original code.

* Do not skip fields that don't have browsable attributes.

* Changing the expected behavior to match Console Application. EventHandlers are Browsable.Never by default.

* Changed the place of checking if objetc is an array.

* Update src/mono/wasm/debugger/DebuggerTestSuite/EvaluateOnCallFrameTests.cs

Co-authored-by: Ankit Jain <radical@gmail.com>
* Removed unused variables.

* Removing space and unused import.

* Partially addressed @radical comments.

* Addressed the comment about extension instead of Union.

* Removed string cultural vunerability.

* Added Properties dictionary, the same as for fields.

* Fixed the bug I made by using dynamc.

* Applying @radical comments about refactoring.

* Corrected typo.

* Added tests for properties.

* Draft of changes for properties handling - never and root hidden failing.

* Fix for RootHidden properties.

* Added tests for static fields decorated with Browsable.

* Correct a typo.

* Undo merge unintentional changes.

* Changing expected behavior for MulticastDelegateTest - in Console Application EventHandler is Browsable.Never by default so we should not expect it to be visible in the debug window.

* Removing not relevant changes created after merge with main.

* Remove file added in merge with main.

* Revert "Removing not relevant changes created after merge with main."

This reverts commit b1acf8b546d1b95bea101290c25ec7f15cb78799.

* Revert.

* Revert revert.

* One broken test for custom getter.

* Ugly fix to make all the tests work.

* Refactored JArray aggregation to Dictionary.

* Better naming.

* Remove not connected to PR file.

* Applied @thaystg suggestions.

* Removed comments.

Co-authored-by: Ankit Jain <radical@gmail.com>
2 years agoMove things from ILCompiler.TypeSystem to ILCompiler.Compiler (#63280)
Michal Strehovský [Mon, 3 Jan 2022 11:52:46 +0000 (20:52 +0900)]
Move things from ILCompiler.TypeSystem to ILCompiler.Compiler (#63280)

IL generation (stubs/thunks) is not part of the core type system and these files are not included in ILCompiler.TypeSystem.ReadyToRun. Somehow we accumulated them in ILCompiler.TypeSystem but they can be pretty cleanly moved to ILCompiler.Compiler (left one TODO for a subsequent cleanup since some of what's in Common\TypeSystem should actually be in ILCompiler.Compiler proper).

2 years ago[mono][wasm] Allow methods with finally clauses to be AOTed. (#63065)
Zoltan Varga [Mon, 3 Jan 2022 11:44:48 +0000 (06:44 -0500)]
[mono][wasm] Allow methods with finally clauses to be AOTed. (#63065)

* [mono][wasm] Allow methods with finally clauses to be AOTed.

This is implemented by running the finally clause with the interpreter.
Methods with clauses have additional code generated, which:
* Saves the IL state (pc+arguments+locals) into a MonoMethodILState
structure.
* Pushes an LMF frame on the LMF stack of type MONO_LMFEXT_IL_STATE.
  The LMF frame points to the il state.

During EH, if such an LMF frame is found, and the IL pc in the
il state points inside a clause, then an interpreted version
of the method is created, and the finally clause is ran using
the interpreter using the il state as the starting state.

* Disable a few test suites which now cause emscripten to OOM when building with AOT.

2 years ago[main] Update dependencies from dotnet/linker (#63166)
dotnet-maestro[bot] [Mon, 3 Jan 2022 10:31:41 +0000 (11:31 +0100)]
[main] Update dependencies from dotnet/linker (#63166)

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
2 years agoFix nullability annotations on ProcessModule.FileName/ModuleName (#63272)
Stephen Toub [Mon, 3 Jan 2022 09:32:09 +0000 (04:32 -0500)]
Fix nullability annotations on ProcessModule.FileName/ModuleName (#63272)