platform/upstream/dotnet/runtime.git
3 years agoBaggage and Tags for activity tracking options (#46571) (#48722)
Marc Sallin [Fri, 12 Mar 2021 17:36:53 +0000 (18:36 +0100)]
Baggage and Tags for activity tracking options (#46571) (#48722)

Co-authored-by: Sallin Marc, I212 <marc.sallin@post.ch>
3 years ago[wasm][debugger] Detect exception/error when calling runtime_invoke (#49498)
Thays Grazia [Fri, 12 Mar 2021 17:17:46 +0000 (14:17 -0300)]
[wasm][debugger] Detect exception/error when calling runtime_invoke (#49498)

* Related to #49206.
When we call runtime_invoke on wasm the exception always returns NULL and the error returns OK.
This was a problem because we were trying to get value of this new static property in DateTime type:
private static ReadOnlySpan<byte> DaysInMonth365 => new byte[] { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
As we don't know that we were getting an exception, the value that returns to the test was wrong.
The goal of this PR is detect that we got an exception when running runtime_invoke and return the expected value to debugger.
This is a temporary solution, I think the final solution is to fix runtime_invoke to return exception correctly on WASM.
We also need to support it: https://github.com/dotnet/runtime/blob/b3411852caa6a3de8ab9fa27f7860c76ef43e384/src/mono/mono/metadata/object.c#L6298

* Fix compilation error

* Update src/mono/mono/mini/mini-wasm-debugger.c

Co-authored-by: Aleksey Kliger (λgeek) <akliger@gmail.com>
* Adding comment as suggested by @lambdageek

Co-authored-by: Aleksey Kliger (λgeek) <akliger@gmail.com>
3 years ago[mono][debugger] Implementing mscordbi to support iCorDebug on mono runtime (#47639)
Thays Grazia [Fri, 12 Mar 2021 17:00:59 +0000 (14:00 -0300)]
[mono][debugger] Implementing mscordbi to support iCorDebug on mono runtime (#47639)

* Implementing mscordbi on mono to support icordebug

* Fix eval, fix step and cancel step, remove suspend status on mscordbi

* Using log from coreclr as mscordbi does

* Missing files

* Removing eglib from implementation

* Compiling on Mac

* Compiling and Working on windows.
Changing what @lambdageek suggested about mono_atomic_inc_i32

* Generating libmscordbi on mac

* Fix socket on mac

* Counting references, deleting objects, removing unecessary properties,
formating with cland-format, renaming properties to follow the used
pattern.

* Checking error when get reply from debugger

* Fix format, reuse regmeta from coreclr and try to fix compilation on
windows

* Dont build when target is android or ios or wasm

* Fix error unused variable

* Fixing error: 'CFUserNotificationDisplayAlert' is unavailable: not
available on macCatalyst

* Fix compilation error on Linux

* Fix function not found in maccatalyst
Fix warning as error of macro redefinition

* Dont compile mscordbi on maccatalyst

* Fix compilation on linux

* Fix compilation on android, ios and browser

* Fix compilation on linux

* Fix cross compiling

* Fix compilation x86 windows

* Fix x86 compilation

* Fix compilation on windows

* Fix cmake error

* Fix cmake

* Fix arm64 mac

* Fix windows compilation

* Fix memory leak

* Returning E_NOTIMPL where it was possible and it's not implemented as
suggested by @cshung

* Fix what @cshung

* Use only one ref count

* Adding ex_try everywhere that we could have an allocation failure.

* Implementing get class

* Apply suggestions from code review

Co-authored-by: Noah Falk <noahfalk@users.noreply.github.com>
* Fix what @noahfalk suggested in his review.

* Fixing what was suggested by @viniciusjarina

* Fix what was suggested by @viniciusjarina

* Changing what @noahfalk suggested

* Accept more than 1 stepper per thread

* Changing what was suggested by @noahfalk

* Using CORDB_ADDRESS to return addresses from debugged process

* Fix eval

* Update src/mono/mono/mini/debugger-agent.c

Co-authored-by: Aleksey Kliger (λgeek) <akliger@gmail.com>
* Using 1:1 with runtime for cordbtype and cordbclass

* Rnaming methods as suggested by @lambdageek

* Update src/mono/dbi/cordb-process.h

Co-authored-by: Aleksey Kliger (λgeek) <akliger@gmail.com>
* Update CMakeLists.txt

* Fix arm64 compilation

* Fix arm64 compilation

* Fix error cmake

* fix arm64 compilation

* Fix arm64 compilation

* Fix arm64 compilation

* Fix arm64 compilation

* Revert "Fix arm64 compilation"

This reverts commit 25f24bc7ac66966fe59805e54e4009c909608b2c.

* Revert "Fix arm64 compilation"

This reverts commit a8f0318881d7b3e6b5a69b1b56c17478a71fdb4f.

* Revert "fix arm64 compilation"

This reverts commit b5de06dcf00bf296f2c8f4b47aa2492afbd73acd.

* Revert "Fix error cmake"

This reverts commit 2aae4636499d073ca5aa6fb9319d84875be6e08e.

* Revert "Fix arm64 compilation"

This reverts commit ae5f701589c3bd8ca04b9d9369af2b285a5d9bd0.

* Revert "Fix arm64 compilation"

This reverts commit 94d957c7416a900c9e90dec53900a104572ea6a1.

* Removing arm64 compilation

* Remove arm64 compilation

Co-authored-by: Noah Falk <noahfalk@users.noreply.github.com>
Co-authored-by: Aleksey Kliger (λgeek) <akliger@gmail.com>
3 years ago[interp] Rework the allocation of offsets for variables (#49072)
Vlad Brezae [Fri, 12 Mar 2021 15:03:37 +0000 (17:03 +0200)]
[interp] Rework the allocation of offsets for variables (#49072)

* [interp] Cleanup get_interp_local_offset

Use it just for allocating an offset for a var, at the top of the locals space.

* [interp] Save the args inside call instructions

This will aid later optimizations, in order to easily detect the call args for an opcode. This is stored as a -1 terminated array of var indexes. Also change the structure of newobj_reg_map array, so it can reuse this format (newobj_reg_map should be killed at some point anyway).

* [interp] Pass target_ip in a normal var to MINT_CALLI_NAT_FAST

Making it consistent with other calli opcodes and simplifies a little bit the code generation path.

* [interp] Add explicit return for CallArgs opcodes

Before this change, calls used to receive a single special dreg argument. This was resolved to an offset. At this offset, the call could find all the parameters and the return value was also written at the same offset. With this change we move towards having an explicit dreg return. For calls, the last sreg must be of the special type MINT_CALL_ARGS_SREG. The var offset allocator should ensure all call args are allocated one after the other and that this special reg type is resolved to the offset where these args reside.

* [interp] Remove call args flag from code generation / optimization phases

This flag should only be relevant to the var offset allocator

* [interp] Add new local offset allocator

This change aims to simplify the handling of vars during optimizations. Before this change we had different types of vars : managed locals, var residing on the execution stack, vars that are the argument of a call. Multiple restrictions applied to vars residing on the execution stack and to call args. Following this change, all vars share the same semantics during optimizations passes. At the very end, we allocate offsets for them and we will end up with 3 types of vars : global vars (used from multiple bblocks), local vars (used in a single bblock) and call arg vars. Call arg vars are always local.

The first step of the allocator is to detect all global vars and allocate offsets for them by doing a full iteration over the code. They will reside in the first section of the stack frame and they are allocated one after the other in the order they are detected. The param area (containing call arg vars) will have to be allocated after the local var space, otherwise a call would overwrite vars in the calling method. These vars are allocated for one basic block at a time.

For simple local vars we do an initial iteration over the bblock instructions and we set the liveness information for each referenced var (live_start and live_end). We will maintain a list of active vars and the current top of stack. As a var becomes alive we allocate it at the current offset and add it to the active_vars array. As a var becomes dead, we remove entries from the active_vars array and update the current top of stack, if space has been freed at the end of the stack.

For call args, because we must control the offset at which these vars are allocated, in the initial pass we generate MOVs from the var to a new local var, if the call arg was initially global. Afterwards, call arg vars are allocated in a similar manner to normal local vars. The space for them is tied to the param area of the call, so the entire space is allocated at once. A call become active when any of its args is first written. The liveness of the call ends when the actual call is done, at which point we resolve the offset of every arg relative to the start of the param area of the method. Once all normal local vars are allocated, we will compute the final offset of the call arg vars.

* [interp] Improve dumping for call instructions

* [interp] Fix var type of valuetype this

* [interp] Re-enable copy propagation

* [interp] Rename MINT_NEWOBJ opcodes

* [interp] Disable tracking of offsets on the execution stack during codegen

They are no longer needed. We generate offsets for every var at the very end.

* [interp] Remove memmove of args during newobj

The offset allocator is allocating the vars at the right offset in the param area. We also used `push_types` to add the arguments back on the stack, which was allocating new vars for each argument. We no longer do this, so newobj_reg_map is not needed anymore.

* [interp] Re-enable inlining of constructors

For object ctors, MINT_NEWOBJ_INLINED allocates an object which will be used both as a `this` arg to the ctor as well as the return var from the newobj operation.

For valuetype ctors, we need to first inform the var offset allocator that the valuetype exists before the MINT_NEWOBJ_VT_INLINED invocation, which will take its address, which will be used as `this` arg to the inline method. We also need to dummy use the valuetype, so it never dies before the ctor is inlined, otherwise `this` points to garbage. We use this def/dummy_use mechanism in order to avoid promoting the valuetype to a global var, as it happens with normal vars that have their address taken (via ldloca).

* [interp] Avoid optimization if newobj is guarded

MINT_NEWOBJ* should not store into a local if the ctor might throw, because we set the return value before the ctor starts executing, and a guarding clause can see this variable as being set.

* [interp] Refactor the active vars code a bit

* [interp] Add missing implicit conversion

When passing an argument or returning a value from a method. The stack contents are not necessarily matching the signature type, in which case we add conversions.

* [interp] Disable test using excessive stack space

This test was exceeding the stack limit even before the new offset allocator, it was just not reported.

3 years agoAddress flakey behavior testing COM lifetime cleanup. (#49266)
Aaron Robinson [Fri, 12 Mar 2021 15:00:19 +0000 (07:00 -0800)]
Address flakey behavior testing COM lifetime cleanup. (#49266)

* Address flakey behavior testing COM lifetime cleanup.

* Add new lifetime test for COM.

3 years ago[mono] Implement AdvSimd (#49260)
imhameed [Fri, 12 Mar 2021 14:57:08 +0000 (06:57 -0800)]
[mono] Implement AdvSimd (#49260)

This change adds AdvSimd and AdvSimd.Arm64 support to LLVM-enabled Mono.

Most aarch64 LLVM intrinsic functions are overloaded and have names determined
by an invariant base string prepended to a string representation of one or two
type parameters. Intrinsic functions used by an LLVM module must have a
declaration somewhere in memory when JITting or somewhere in the output bitcode
file when AOTing. Currently Mono maintains a hash table that maps internal
intrinsic IDs to LLVM intrinsic declarations. These IDs have been extended: a
simplified type representation is added to the key's upper bits. This
representation is not especially compact, and currently uses 9 bits to label 18
states, but it's easy to look at in a debugger. (A simple base-18 encoding
could encode three parameters in 13 bits.)

These overload-tagged IDs can be passed to
`OP_XOP_OVR{_,_SCALAR,_BYSCALAR}X_{X,X_X,X_X_X}`. The return type of the
intrinsic that generates these mini ops is used to derive the overload tag to
find the corresponding LLVM intrinsic function declaration.

`MonoLLVMModule::intrins_by_id` is removed, because LLVM intrinsic lookup keys
are no longer small contiguous integers. It only seemed to serve as a lookup
table for data already contained in a hash table.

The corresponding instructions for some of these .NET-level intrinsics take
immediate parameters. For some of these instructions, the LLVM IR code that
selects these immediate-argument instructions can emit a fallback for
non-constant parameters, either by using an equivalent instruction with a
register operand or by using a longer and less-efficient instruction sequence.
For the rest, a branching code sequence is emitted. Helper functions
(`immediate_unroll_begin` etc.) are added to make this a little less
repetitious.

Some operations take an immediate operand denoting a lane to select in a vector
before proceeding with another generic vector or scalar operation. These are
decomposed into a sequence of `OP_ARM64_SELECT_SCALAR` followed by the
non-lane-specific operation. LLVM can still optimize this to the lane-selecting
instruction when possible, and can generate fallback code for non-immediate
lane selection.

The tables describing the intrinsics supported by the runtime are extended to
support intrinsics with different target instructions for signed, unsigned and
floating point parameters. Whenever possible, .NET-level intrinsics that
correspond to a single LLVM intrinsic function are stored as a single entry in
these tables. Unfortunately many intrinsics need to be translated into a
sequence of LLVM IR operations; for these, new mini IR opcodes are added to
select the LLVM IR builder code that should run.

3 years agoAdd Libs.Pretest to make runtime (#48799)
Ryan Lucia [Fri, 12 Mar 2021 14:37:38 +0000 (09:37 -0500)]
Add Libs.Pretest to make runtime (#48799)

3 years agoDon't include mono-dtrace.h when generating offsets (#49482)
monojenkins [Fri, 12 Mar 2021 12:10:16 +0000 (07:10 -0500)]
Don't include mono-dtrace.h when generating offsets (#49482)

offsets-tool can run before mono-dtrace.h is generated which leads to a compiler error about the file missing.
This happened with the mac arm64 sdks build where we didn't disable dtrace like we do for iOS.

It was racy since it depends on whether we already built the target mono before we're building the cross compiler mono.

Co-authored-by: akoeplinger <akoeplinger@users.noreply.github.com>
3 years agoRemove DynamicDependency workaround (#49523)
Sven Boemer [Fri, 12 Mar 2021 08:20:50 +0000 (00:20 -0800)]
Remove DynamicDependency workaround (#49523)

The linker no longer needs these DynamicDependency attributes because it
can resolve the assemblies when it sees the strings passed to GetType.

3 years agoSupport Time Zone IANA Ids and Windows Ids in all platforms (#49412)
Tarek Mahmoud Sayed [Fri, 12 Mar 2021 04:29:04 +0000 (20:29 -0800)]
Support Time Zone IANA Ids and Windows Ids in all platforms (#49412)

* Support Time Zone IANA Ids <-> Windows Ids conversions

3 years ago[wasm][debugger] Replace Mono.Cecil with MetadataReader. (#49440)
Thays Grazia [Fri, 12 Mar 2021 03:18:11 +0000 (00:18 -0300)]
[wasm][debugger] Replace Mono.Cecil with MetadataReader. (#49440)

* Removing the usage of Mono.Cecil and using MetadataReader to read Assembly information and Pdb information.

* Fixing tests...
Having problems with async methods.

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

Co-authored-by: Larry Ewing <lewing@microsoft.com>
* Fix tests which calls async methods.

* Fix packaging of BrowserDebugHost.

Co-authored-by: Larry Ewing <lewing@microsoft.com>
3 years agoUpdate SDK's target version to 6.0 Preview 2 (#49509)
Viktor Hofer [Fri, 12 Mar 2021 02:57:41 +0000 (03:57 +0100)]
Update SDK's target version to 6.0 Preview 2 (#49509)

* Update target version of SDK to 6.0 preview 2

Not updating the minimum required version as that's considered a breaking change that needs to go through the monthly infra rollout.

* Remove msbuild hack in Tools.props

* Remove sendtohelixhelp hack with P1 SDK

3 years ago[wasm] Turn off canonization of NaNs. It doesn't seem to be needed, and it causes...
Zoltan Varga [Fri, 12 Mar 2021 02:05:38 +0000 (21:05 -0500)]
[wasm] Turn off canonization of NaNs. It doesn't seem to be needed, and it causes test failures. (#49475)

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

3 years agoExclude out of range fp test on arm32 (#49519)
David Wrighton [Fri, 12 Mar 2021 01:52:57 +0000 (17:52 -0800)]
Exclude out of range fp test on arm32 (#49519)

3 years agoRemove a few more unnecessary StringBuilders (#49488)
Stephen Toub [Fri, 12 Mar 2021 01:42:00 +0000 (20:42 -0500)]
Remove a few more unnecessary StringBuilders (#49488)

3 years agoTweak Process.GetEnvironmentVariablesBlock (#49484)
Stephen Toub [Fri, 12 Mar 2021 01:41:32 +0000 (20:41 -0500)]
Tweak Process.GetEnvironmentVariablesBlock (#49484)

* Tweak Process.GetEnvironmentVariablesBlock

Mostly a cleanup (e.g. the comment refers to Windows 2000), but removes some interface dispatch as part of simplifying the code.

* Update src/libraries/System.Diagnostics.Process/src/System/Diagnostics/Process.Windows.cs

Co-authored-by: Jan Kotas <jkotas@microsoft.com>
Co-authored-by: Jan Kotas <jkotas@microsoft.com>
3 years agoFix polling on https connections in HttpConnectionPool (#49474)
Stephen Toub [Fri, 12 Mar 2021 01:41:07 +0000 (20:41 -0500)]
Fix polling on https connections in HttpConnectionPool (#49474)

* Fix polling on https connections in HttpConnectionPool

Avoid performing read-aheads on such connections, which can result in long-pinned buffers and unnecessary faulted tasks when the connections are torn down.

* Update src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/HttpConnectionPool.cs

Co-authored-by: Cory Nelson <phrosty@gmail.com>
Co-authored-by: Cory Nelson <phrosty@gmail.com>
3 years agoTry to upload collections from successful partition (#49496)
Kunal Pathak [Fri, 12 Mar 2021 01:24:35 +0000 (17:24 -0800)]
Try to upload collections from successful partition (#49496)

If SPMI collection of few partitions fail, try best attempt to merge
the successful partition and upload them to azure. However, if none
of the partition succeeded, `merge-mch` would fail and we should skip
upload step.

3 years ago[marshal] Fix VARIANT marshaling in structs (#49451)
monojenkins [Fri, 12 Mar 2021 00:33:10 +0000 (19:33 -0500)]
[marshal] Fix VARIANT marshaling in structs (#49451)

Partial revert of mono/mono#8732

If a managed struct is declared as

        public struct StructWithVariant
        {
            [MarshalAs (UnmanagedType.Struct)]
            public object data;
        };

Then the `data` field should be marshalled as a VARIANT.

The fix checks that the field's type is `object` and uses VARIANT for marshaling, otherwise it continues as in mono/mono#8732 and uses MONO_MARSHAL_CONV_OBJECT_STRUCT.

---

Also added tests for BSTR marshaling inside structs.  This actually works on mono master thanks to https://github.com/mono/mono/pull/19701 but there was no test covering this case.

Co-authored-by: lambdageek <lambdageek@users.noreply.github.com>
3 years agoRemote unwinder's put_unwind_info function needs to cleanup for FEATURE_USE_SYSTEM_LI...
Mike McLaughlin [Fri, 12 Mar 2021 00:27:25 +0000 (16:27 -0800)]
Remote unwinder's put_unwind_info function needs to cleanup for FEATURE_USE_SYSTEM_LIBUNWIND (#49444)

Fixes issue: https://github.com/dotnet/runtime/issues/42561

3 years agoApple Silicon coreclr runtime tests (#49447)
Steve MacLean [Fri, 12 Mar 2021 00:14:56 +0000 (19:14 -0500)]
Apple Silicon coreclr runtime tests (#49447)

* Apple Silicon coreclr runtime tests

Create SetPathVars_coreclr_AppleSilicon for enabling limited PR runtime testing

Enable coreclr runtime tests on Apple Silicon for isFullMatrix & SetPathVars_coreclr_AppleSilicon.containsChange

* Fix did not find alphanumeric

* Enable OSX.1100.ARM64.Open for PR triggers

3 years agodisable buildwasmapps for resource reasons (#49517)
Larry Ewing [Fri, 12 Mar 2021 00:11:02 +0000 (18:11 -0600)]
disable buildwasmapps for resource reasons (#49517)

3 years agoAdd Fedora 35 RID (#48200)
Omair Majid [Fri, 12 Mar 2021 00:07:36 +0000 (19:07 -0500)]
Add Fedora 35 RID (#48200)

Fedora rawhide now uses the fedora.35-x64 RID:

    $ podman run -it registry.fedoraproject.org/fedora:rawhide /bin/bash -c 'cat /etc/os-release'
    NAME=Fedora
    VERSION="35 (Container Image Prerelease)"
    ID=fedora
    VERSION_ID=35
    VERSION_CODENAME=""
    PLATFORM_ID="platform:f35"
    PRETTY_NAME="Fedora 35 (Container Image Prerelease)"
    ANSI_COLOR="0;38;2;60;110;180"
    LOGO=fedora-logo-icon
    CPE_NAME="cpe:/o:fedoraproject:fedora:35"
    HOME_URL="https://fedoraproject.org/"
    DOCUMENTATION_URL="https://docs.fedoraproject.org/en-US/fedora/rawhide/system-administrators-guide/"
    SUPPORT_URL="https://fedoraproject.org/wiki/Communicating_and_getting_help"
    BUG_REPORT_URL="https://bugzilla.redhat.com/"
    REDHAT_BUGZILLA_PRODUCT="Fedora"
    REDHAT_BUGZILLA_PRODUCT_VERSION=rawhide
    REDHAT_SUPPORT_PRODUCT="Fedora"
    REDHAT_SUPPORT_PRODUCT_VERSION=rawhide
    PRIVACY_POLICY_URL="https://fedoraproject.org/wiki/Legal:PrivacyPolicy"
    VARIANT="Container Image"
    VARIANT_ID=container

3 years agoRemove a few StringBuilder uses from TraceListener (#49485)
Stephen Toub [Thu, 11 Mar 2021 22:35:15 +0000 (17:35 -0500)]
Remove a few StringBuilder uses from TraceListener (#49485)

3 years ago[wasm] Allow assemblies to be skipped for AOTMode=AotInterp (#49446)
Ankit Jain [Thu, 11 Mar 2021 22:34:16 +0000 (17:34 -0500)]
[wasm] Allow assemblies to be skipped for AOTMode=AotInterp (#49446)

* [wasm] reduce visibility of `[AOT] /foo/bar.dll`  messages

* [wasm] Quote assembly path when invoking mono-aot-cross

* [wasm] WasmApp.*: Use the msbuild equivalent of `Path.Combine` in

.. the targets/props .

* [wasm] WasmApp.targets: Simplify emcc invocations a bit

* [wasm] WasmApp.targets: quote paths correctly

* [wasm] Add `%(WasmAssembliesToBundle._InternalForceInterpret)`

.. to allow skipping AOT, per assembly.

* [wasm] don't copy dotnet.* to appbundle unnecessarily

This was added earlier to support blazor workload which only uses AOT.
But that has since been fixed to correctly use
`WasmBuildApp`+`@(WasmNativeAsset)`, so this can be removed.

* [wasm] Add new `$(WasmNativeDebugSymbols)` that to get symbols with

.. dotnet.wasm . It defaults to `true`.

* [wasm] Check that EMSDK_PATH is set when building native files

* [wasm] Rename `@(_WasmAssemblies)` -> `@(_WasmAssembliesInternal)`

* [wasm] Fix sample build

* [wasm] Fix tests on helix - typo

* Address review feedback

* fix a missing quote

Co-authored-by: Larry Ewing <lewing@microsoft.com>
3 years agofix invariant linking error (#49492)
Larry Ewing [Thu, 11 Mar 2021 22:23:21 +0000 (16:23 -0600)]
fix invariant linking error (#49492)

Disable the conditional inclusion to fix #48847 until we have a solution.

3 years agoUse hosted pools to send libraries tests to helix to ease out our build pools (#49497)
Santiago Fernandez Madero [Thu, 11 Mar 2021 22:13:59 +0000 (14:13 -0800)]
Use hosted pools to send libraries tests to helix to ease out our build pools (#49497)

3 years agoUse the .noRC2 cert variants in the System.Net tests when on a platform that does...
Jeremy Koritzinsky [Thu, 11 Mar 2021 22:02:56 +0000 (14:02 -0800)]
Use the .noRC2 cert variants in the System.Net tests when on a platform that does not support RC2. (#49461)

3 years agoChange prejit instrumentation default back to block profiling (#49441)
Andy Ayers [Thu, 11 Mar 2021 19:48:42 +0000 (11:48 -0800)]
Change prejit instrumentation default back to block profiling (#49441)

Both crossgen1 and crossgen2 currently reject schemas that contain edge profile
counters. Change the jit defaults back to block profiling when prejitting.

See notes in #49267.

3 years agoSPMI: add pgo data fingerprint to method identity (#49416)
Andy Ayers [Thu, 11 Mar 2021 19:47:42 +0000 (11:47 -0800)]
SPMI: add pgo data fingerprint to method identity (#49416)

This ensures that pgo and non-pgo machine contexts for the same method with
otherwise identical jit flags won't get merged, and likewise for pgo contexts
with different counter values.

3 years agoRemoved .dylib from Libraries.AppleCryptoNative literal (#49401)
Vladimir Sadov [Thu, 11 Mar 2021 19:27:56 +0000 (11:27 -0800)]
Removed .dylib from Libraries.AppleCryptoNative literal (#49401)

3 years ago[AndroidCrypto] Enable using X.509 certs with DSA (#49394)
Jeremy Koritzinsky [Thu, 11 Mar 2021 18:58:45 +0000 (10:58 -0800)]
[AndroidCrypto] Enable using X.509 certs with DSA (#49394)

* [AndroidCrypto] Enable using X.509 certs with DSA

* Refactor key pair creation.

* Only PinAndClear X.

* Update src/libraries/System.Security.Cryptography.X509Certificates/src/Internal/Cryptography/Pal.Android/X509Pal.cs

Co-authored-by: Jeremy Barton <jbarton@microsoft.com>
* Alphabetize the sources in the csproj.

* Add missing include.

* Add missing parameter

* Add missing DuplicateHandle call.

Co-authored-by: Jeremy Barton <jbarton@microsoft.com>
3 years agoFix incomplete dumps generated by createdump (#49468)
Mike McLaughlin [Thu, 11 Mar 2021 18:48:02 +0000 (10:48 -0800)]
Fix incomplete dumps generated by createdump (#49468)

* Fix incomplete dumps generated by createdump

Issue: https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1277488?src=WorkItemMention&src-action=artifact_link

* Code review feedback

3 years agoRemove serialization field from HashSet (#49483)
Stephen Toub [Thu, 11 Mar 2021 18:39:24 +0000 (13:39 -0500)]
Remove serialization field from HashSet (#49483)

Same as the approach taken in Dictionary.

3 years agoAdd Task.WaitAsync methods (#48842)
Stephen Toub [Thu, 11 Mar 2021 17:11:15 +0000 (12:11 -0500)]
Add Task.WaitAsync methods (#48842)

3 years agoFix silent bad codegen VSD possible tailcall converted to normal call (#49256)
Bruce Forstall [Thu, 11 Mar 2021 17:01:30 +0000 (09:01 -0800)]
Fix silent bad codegen VSD possible tailcall converted to normal call (#49256)

The problem was when a VSD interface call returning a multi-byte struct
in registers was initially considered to be a tailcall, but the tailcall
was abandoned in morph due to not enough stack space to store outgoing
arguments, in which case we create a new call return local to store the
return struct, and re-morph the call. In doing so, we forget that we had
already added VSD non-standard args, and re-add them, leaving the originally
added arg as a "normal" arg that shouldn't be there.

So, in summary, for a call A->B, to see this failure, we need:
1. The call is considered a potential tailcall (by the importer)
2. The call requires non-standard arguments that add call argument IR in
   fgInitArgInfo() (e.g., VSD call -- in this case, a generic interface call)
3. We reject the tailcall in fgMorphPotentialTailCall() (e.g., not enough
   incoming arg stack space in A to store B's outgoing args), in this case
   because the first arg is a large struct. We can't reject it earlier,
   due to things like address exposed locals -- we must get far enough
   through the checks to have called fgInitArgInfo() to add the extra
   non-standard arg.
4. B returns a struct in multiple registers (e.g., a 16-byte struct in
   Linux x64 ABI)

The fix is to remove the previously-added non-standard VSD argument IR when
we are preparing to re-morph a call.

There was one other location that was already doing this. I'm a little
worried that there are other places where the non-standard added IR is
not being considered when we clear out the arg info before remorphing.
It seems like there is some risk here. Probably, we should consider a
better way of handling the non-standard arg IR given the need in some
cases to re-morph calls.

I commented out a few cases of:
```
assert(!fgCanFastTailCall(call, nullptr));
```
because this function can call `fgInitArgInfo` which can alter the IR.
That seems dangerous in an assert, which should have any side-effects
like modifying the IR.

Fixes #49078

No SPMI asm diffs.

3 years agosuperpmi.py: Add support for Azure CLI authentication (#49272)
Bruce Forstall [Thu, 11 Mar 2021 17:00:05 +0000 (09:00 -0800)]
superpmi.py: Add support for Azure CLI authentication (#49272)

Azure CLI authentication is currently disabled (the current
unauthenticated mode will be used).

To use SuperPMI collections and JIT rolling builds after Azure
authentication is enabled, you will need to install the Azure CLI from:

https://docs.microsoft.com/en-us/cli/azure/install-azure-cli

and then log in using `az login` before running any superpmi.py
commands.

3 years agoAdd iOS functional test for invariant culture only mode. (#49057)
Maxim Lipnin [Thu, 11 Mar 2021 15:17:39 +0000 (18:17 +0300)]
Add iOS functional test for invariant culture only mode. (#49057)

Contributes to #43865

1. ./build.sh mono+libs -os iOS -arch x64 -c Release
2. ./dotnet.sh build /t:Test src/tests/FunctionalTests/iOS/Simulator/InvariantCultureOnlyMode /p:TargetOS=iOS /p:TargetArchitecture=x64 /p:Configuration=Release

3 years agoConvert the 'if (Const < (uint)span.Length)' patterns to equivalent natural versions...
SingleAccretion [Thu, 11 Mar 2021 14:52:23 +0000 (17:52 +0300)]
Convert the 'if (Const < (uint)span.Length)' patterns to equivalent natural versions (#49450)

3 years agoEnable new CA1839 and CA1840 Environment rules (#49393)
Stephen Toub [Thu, 11 Mar 2021 11:50:25 +0000 (06:50 -0500)]
Enable new CA1839 and CA1840 Environment rules (#49393)

3 years agoAdd Android functional test for invariant culture only mode (#49204)
Maxim Lipnin [Thu, 11 Mar 2021 08:23:10 +0000 (11:23 +0300)]
Add Android functional test for invariant culture only mode (#49204)

Contributes to #43865

./build.sh mono+libs -os Android -arch x64 -c Release
./dotnet.sh build /t:Test src/tests/FunctionalTests/Android/Device_Emulator/InvariantCultureOnlyMode /p:TargetOS=Android /p:TargetArchitecture=x64 /p:Configuration=Release

3 years agoFix APICompat errors for atttributes on parameters (#49408)
Santiago Fernandez Madero [Thu, 11 Mar 2021 08:03:10 +0000 (00:03 -0800)]
Fix APICompat errors for atttributes on parameters (#49408)

3 years agoAdd an option to do zero byte reads on StreamPipeReader (#49117)
David Fowler [Thu, 11 Mar 2021 07:49:43 +0000 (23:49 -0800)]
Add an option to do zero byte reads on StreamPipeReader (#49117)

- Added UseZeroByteReads to StreamPipeReaderOptions that allows not allocating a buffer by doing a zero byte read on the underlying Stream before the internal buffer is allocated.

3 years agoFix marshaling in HostFXR API test (#49386)
Mateo Torres-Ruiz [Thu, 11 Mar 2021 07:22:29 +0000 (23:22 -0800)]
Fix marshaling in HostFXR API test (#49386)

* Marshal sizte_t as UIntPtr
Use CharSet.Auto

* PR feedback

3 years ago[AndroidCrypto] Add exception check to RsaVerificationPrimitive (#49443)
Elinor Fung [Thu, 11 Mar 2021 02:11:17 +0000 (18:11 -0800)]
[AndroidCrypto] Add exception check to RsaVerificationPrimitive (#49443)

* Add exception check to AndroidCryptoNative_RsaVerificationPrimitive

* Fix return error code

3 years agoDon't include windows PInvokes on Unix for System.Drawing (#49405)
Santiago Fernandez Madero [Thu, 11 Mar 2021 02:02:10 +0000 (18:02 -0800)]
Don't include windows PInvokes on Unix for System.Drawing (#49405)

* Don't include windows PInvokes on Unix for System.Drawing

* More interop cleanup to avoid building windows only codepaths on Unix

* Make lower range use handletreshold to make test more resilient

3 years agoUpdating snaps for March releases (#49462)
Rahul Bhandari [Wed, 10 Mar 2021 23:29:02 +0000 (15:29 -0800)]
Updating snaps for March releases (#49462)

* Updating snaps

* Updating snaps for March releases

3 years ago[mono][wasm][debugger] Implement conditional breakpoint (#48785)
Thays Grazia [Wed, 10 Mar 2021 23:02:23 +0000 (20:02 -0300)]
[mono][wasm][debugger] Implement conditional breakpoint (#48785)

* Implementing conditional breakpoint

* Adding tests

* Changing what @radical suggested

* Changing what @radical suggested.

* Changed what @radical suggested.

* Implement support to conditional breakpoints returning string.
Adding more tests.

* Changing tests to use TheoryData as suggested by @radical.

* Apply suggestions from code review

Co-authored-by: Larry Ewing <lewing@microsoft.com>
Co-authored-by: Larry Ewing <lewing@microsoft.com>
3 years ago[wasm] Throw exception if culture data does not exist in icu (#47301)
Tammy Qiu [Wed, 10 Mar 2021 22:59:22 +0000 (17:59 -0500)]
[wasm] Throw exception if culture data does not exist in icu (#47301)

* Add check for culture data in ICU
Add PredefinedOnly GlobalizationMode
Modified tests if Culture Data not found
* Add test for predefined culture env var
* change assembly test data to pl-PL to avoid culturenotfound exception

Co-authored-by: Larry Ewing <lewing@microsoft.com>
3 years agoAdd EnumBuilder.CreateType back in the public API (#49319)
Eric Erhardt [Wed, 10 Mar 2021 21:17:11 +0000 (15:17 -0600)]
Add EnumBuilder.CreateType back in the public API (#49319)

Fix #46681

3 years agoImprove liveness for 'STORE_BLK(lcl_var)'. (#48797)
Sergey Andreenko [Wed, 10 Mar 2021 20:15:25 +0000 (12:15 -0800)]
Improve liveness for 'STORE_BLK(lcl_var)'. (#48797)

* improve liveness for STORE_BLK

* Improve code for `RehomeArgForFastTailCall`.

* Delete an unnecessary change

While reviewing this change again I found that `fgMarkUseDef` should be called when we visit the local itself, the diffs that I saw from this change were because the LCL_VAR was not marked as `GTF_VAR_DEF`. Now the lclVar is marked as `GTF_VAR_DEF` so we don't need this extra logic.

3 years agoEventSource Feature switch type fix (#49432)
Lakshan Fernando [Wed, 10 Mar 2021 20:08:23 +0000 (12:08 -0800)]
EventSource Feature switch type fix (#49432)

* eh fix

* test change that inadvertently got checked in earlier

* Suppresses the trimmer warning on TypeAnalysis ctor

* Incorporating FB

* Update src/libraries/System.Diagnostics.DiagnosticSource/src/System/Diagnostics/DiagnosticSourceEventSource.cs

Co-authored-by: Eric Erhardt <eric.erhardt@microsoft.com>
* Update src/libraries/System.Diagnostics.DiagnosticSource/src/System/Diagnostics/DiagnosticSourceEventSource.cs

Co-authored-by: Eric Erhardt <eric.erhardt@microsoft.com>
* Update src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/EventSource.cs

Co-authored-by: Eric Erhardt <eric.erhardt@microsoft.com>
* Fix DynamicDependency as per PR feedback

* an earlier change got reverted

* fixed proj file netcore app condition check

* fixed NETCORE_ENGINEERING_TELEMETRY build failures

* fixeing another NETCORE_ENGINEERING_TELEMETRY build failures

* Adding RequiresUnreferencedCode to TypeAnalysis ctor instead of suppressing the warning to get FB, not fully fixed

* PR FB and suppressing warnings for safe calls

* propagated the warning all the way up

* CI build break fix for one file

* excluding NativeRTEventSrc from being build in a project

* Missed couple of supppressions on NativeRTEventSrc

* build break fixes

* EventSource feature switch type fix

Co-authored-by: Eric Erhardt <eric.erhardt@microsoft.com>
3 years agoSwitch MibcProfileParser to the ILReader plan (#49355)
Michal Strehovský [Wed, 10 Mar 2021 19:56:54 +0000 (20:56 +0100)]
Switch MibcProfileParser to the ILReader plan (#49355)

* Add ILReader from NativeAOT branch

* Use ILReader in MibcProfileParser

Co-authored-by: dotnet-bot <dotnet-bot@microsoft.com>
3 years agoAdd support for repeated XML elements without a name attribute (#44608)
Alexander Moerman [Wed, 10 Mar 2021 19:55:04 +0000 (20:55 +0100)]
Add support for repeated XML elements without a name attribute (#44608)

* Add support for repeated XML elements without a name attribute

This commit adds support in Microsoft.Extensions.Configuration.Xml for repeated XML elements without requiring a Name attribute.
This solves a particularly subtle bug when configuring Serilog from an XML configuration source. For a full description, see #36541

The original implementation of the XmlStreamConfigurationProvider has been modified to do the following:

- Maintain a stack of encountered XML elements while traversing the XML source. This is needed to detect siblings.
- When siblings are detected, automatically append an index to the generated configuration keys. This makes it work exactly the same as the JSON configuration provider with JSON arrays.

Tests are updated to reflect the new behavior:
- Tests that verified an exception occurs when entering duplicate keys have been removed. Duplicate keys are supported now.
- Add tests that verify duplicate keys result in the correct configuration keys, with all the lower/upper case variants and with support for the special "Name" attribute handling.

Co-authored-by: Santiago Fernandez Madero <safern@microsoft.com>
3 years agoAdd debugger displays / type proxies for Timer (#49100)
Stephen Toub [Wed, 10 Mar 2021 18:40:58 +0000 (13:40 -0500)]
Add debugger displays / type proxies for Timer (#49100)

Adds a private Timer.AllTimers property that can be used in the debugger to get a list of all timers, debugger display strings for Timer / TimerQueueTimer that help to make sense of the state in a timer and when it'll fire next, and debugger type proxies for Timer/TimerQueueTimer/TimerQueue to help when navigating state.

3 years ago[mono] Add missing opcodes for r4 to native int conversions (#49427)
Vlad Brezae [Wed, 10 Mar 2021 18:25:39 +0000 (20:25 +0200)]
[mono] Add missing opcodes for r4 to native int conversions (#49427)

3 years agoSuperpmi collection pipeline improvements (#49385)
Kunal Pathak [Wed, 10 Mar 2021 17:48:41 +0000 (09:48 -0800)]
Superpmi collection pipeline improvements (#49385)

* Do not pass --use-zapdisable to dotnet

But instead pass to individual CoreRun.exe that is launched during benchmark run. That way we do not slow down the launch of dotnet.exe process.

* Fail superpmi collection pipeline if there was no valid .mch files were found to merge

* Upload merged .mch files as zipped artifacts

TODO: Upload the superpmi.log from all the partition runs

* TEMP: New Jit guid

- Add new JIT guid so we don't overwrite the existing .mch files
- Disable all the runs except benchmarks

* add trailing path sep

* Upload superpmi.logs separately

* Use PublishPipelineArtifacts instead of upload artifacts

* properly pass zapdisable to CoreRun.exe

* Revert "TEMP: New Jit guid"

This reverts commit e89ef69625e4e57bb622fc35ff66d82f14b34285.

* Remove CoreClrTestBuildHost from benchmark run

* fix --envVars for benchmarks run

* add missing space

* temporary disable other runs

* Revert "temporary disable other runs"

This reverts commit 2926d1f582061eee6c7852046982ffb5107887b3.

3 years ago[AndroidCrypto] Check if DSA impl is disposed before setting key size. (#49382)
Jeremy Koritzinsky [Wed, 10 Mar 2021 17:48:11 +0000 (09:48 -0800)]
[AndroidCrypto] Check if DSA impl is disposed before setting key size. (#49382)

3 years ago[AndroidCrypto] Update X509Certificates tests to consume test files that don't use...
Elinor Fung [Wed, 10 Mar 2021 17:45:02 +0000 (09:45 -0800)]
[AndroidCrypto] Update X509Certificates tests to consume test files that don't use RC2 (#49399)

3 years agoBump timeout in runtime-dev-innerloop to 90min (#49439)
Viktor Hofer [Wed, 10 Mar 2021 17:40:20 +0000 (18:40 +0100)]
Bump timeout in runtime-dev-innerloop to 90min (#49439)

Mitigates reported issues: https://github.com/dotnet/runtime/issues/49309.

3 years agoFix a crash in llvm if the sreg of a setret is not set because the methods ends with...
Zoltan Varga [Wed, 10 Mar 2021 17:11:50 +0000 (12:11 -0500)]
Fix a crash in llvm if the sreg of a setret is not set because the methods ends with a throw. (#49122)

3 years ago[macOS-arm64] Disable failing libraries tests (#49400)
Steve MacLean [Wed, 10 Mar 2021 17:02:50 +0000 (12:02 -0500)]
[macOS-arm64] Disable failing libraries tests (#49400)

* Disable tests for XUnit crashes on Apple Silicon

* Apple Silicon Disable System.IO.MemoryMappedFiles.Tests

* Apple Silicon disable DirectoryServices.Protocols.Tests

* Apple Silicon disable Cryptography tests

M1 helix missing usable libssl

* Apple Silicon disable TestVirtualMemorySize64

* Apple Silicon disable ImportCollectionsFromContainerOnly

* Apple Silicon disable XmlWriterApi tests

* Fix whitespace

3 years agoimprove PriorityQueue documentation (#49392)
Eirik Tsarpalis [Wed, 10 Mar 2021 15:54:32 +0000 (15:54 +0000)]
improve PriorityQueue documentation (#49392)

3 years ago[wasm] Fix debugger tests (#49206)
Ankit Jain [Wed, 10 Mar 2021 14:52:35 +0000 (09:52 -0500)]
[wasm] Fix debugger tests (#49206)

* [wasm][debugger] Correctly skip static properties when iterating type

.. members.

* [wasm][debugger][tests] cleanup

* [wasm][debugger][tests] Use SingleLine for the logger

3 years ago[mono] Fix the emission of EnumEqualityComparer instances into the corlib AOT image...
Zoltan Varga [Wed, 10 Mar 2021 13:16:22 +0000 (08:16 -0500)]
[mono] Fix the emission of EnumEqualityComparer instances into the corlib AOT image. (#49402)

Add a few dummy enums to the Mono namespace in corlib, and use them
to create valid EnumEqualityComparer instances. Also make sure the
instances are actually emitted and not replaced by gsharedvt instances.

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

3 years agojitutils M2M renaming reaction (#49430)
Viktor Hofer [Wed, 10 Mar 2021 13:14:17 +0000 (14:14 +0100)]
jitutils M2M renaming reaction (#49430)

* jitutils M2M renaming reaction

* Update format.py

3 years agoWinHttpHandler: Read HTTP/2 trailing headers
Anton Firszov [Wed, 10 Mar 2021 10:54:22 +0000 (11:54 +0100)]
WinHttpHandler: Read HTTP/2 trailing headers

Fixes #44778

3 years ago[RyuJIT] Make casthelpers cold for sealed classes (#49295)
Egor Bogatov [Wed, 10 Mar 2021 06:36:43 +0000 (09:36 +0300)]
[RyuJIT] Make casthelpers cold for sealed classes (#49295)

3 years agoJIT: Non-void ThrowHelpers (#48589)
Egor Bogatov [Wed, 10 Mar 2021 06:36:04 +0000 (09:36 +0300)]
JIT: Non-void ThrowHelpers (#48589)

3 years agoUpdate package index for servicing (#49417)
Eric StJohn [Wed, 10 Mar 2021 05:33:19 +0000 (21:33 -0800)]
Update package index for servicing (#49417)

3 years agoRemove unnecessary check on polymorphic serialization (#48464)
David Cantú [Wed, 10 Mar 2021 03:11:17 +0000 (19:11 -0800)]
Remove unnecessary check on polymorphic serialization (#48464)

3 years agoRemove release build cron triggers from jitstress jobs (#49333)
Bruce Forstall [Wed, 10 Mar 2021 02:25:19 +0000 (18:25 -0800)]
Remove release build cron triggers from jitstress jobs (#49333)

We need to make per-preview decisions about when and how
frequently to run non-baseline jobs. We don't want the
existing configuration to automatically flow to new previews.

3 years ago[main] Update dependencies from dotnet/arcade dotnet/llvm-project dotnet/runtime...
dotnet-maestro[bot] [Wed, 10 Mar 2021 00:58:37 +0000 (00:58 +0000)]
[main] Update dependencies from dotnet/arcade dotnet/llvm-project dotnet/runtime-assets (#49359)

[main] Update dependencies from dotnet/arcade dotnet/llvm-project dotnet/runtime-assets

 - re-introduce publishing workaround

3 years agoImplement AppleCryptoNative_X509GetRawData using SecCertificateCopyData
Filip Navara [Wed, 10 Mar 2021 00:40:55 +0000 (01:40 +0100)]
Implement AppleCryptoNative_X509GetRawData using SecCertificateCopyData

3 years ago[AndroidCrypto] Support a zero-length salt for HMACs. (#49384)
Jeremy Koritzinsky [Wed, 10 Mar 2021 00:27:36 +0000 (16:27 -0800)]
[AndroidCrypto] Support a zero-length salt for HMACs. (#49384)

3 years agoUse managed implementation of pbkdf2 for Android's one-shot implementation. (#49314)
Jeremy Koritzinsky [Wed, 10 Mar 2021 00:26:31 +0000 (16:26 -0800)]
Use managed implementation of pbkdf2 for Android's one-shot implementation. (#49314)

3 years agoMake 303 redirects do GET like Net Framework (#49095)
TimothyByrd [Tue, 9 Mar 2021 23:29:00 +0000 (15:29 -0800)]
Make 303 redirects do GET like Net Framework (#49095)

* Make 303 redirects do GET like Net Framework

In Net Framework, PUT redirects on a 303 do a GET.
Net 5.0 breaks compatibility with this.
See https://github.com/dotnet/runtime/issues/28998
This commit causes redirects of a 303 to do a GET for all methods except HEAD.

Co-authored-by: Timothy Byrd <timothy.byrd@laserfiche.com>
3 years agoMake sure event generation is incremental (#48903)
Juan Hoyos [Tue, 9 Mar 2021 22:13:54 +0000 (14:13 -0800)]
Make sure event generation is incremental (#48903)

3 years agoAdd amd and Surface arm64 perf runs (#49389)
Drew Scoggins [Tue, 9 Mar 2021 22:06:18 +0000 (14:06 -0800)]
Add amd and Surface arm64 perf runs (#49389)

* Add better queue selection support

* Add logical machine to job name

* Add logical machine for Arm64 runs

* Fix log naming

3 years agoEnregister EH var that are single def (#47307)
Kunal Pathak [Tue, 9 Mar 2021 21:58:16 +0000 (13:58 -0800)]
Enregister EH var that are single def (#47307)

* Enable EhWriteThry for SingleDef

* If EhWriteThru is enabled, DoNotEnregister if variable is not singleDef

* Revert code in ExecutionContext.RunInternal

* Revert code in AsyncMethodBuildCore.Start()

* Make sure we do not reset lvSingleDef

* Consitent display of frame offset

misc change in superpmi.py

* Use lvEHWriteThruCandidate

* Do not enregister EH Var that has single use

* do not enregister simdtype

* add missing comments

* jit format

* revert an unintended change

* jit format

* Add missing comments

3 years agoReplace custom Marvin copy with string.GetHashCode (#48410)
Stephen Toub [Tue, 9 Mar 2021 21:33:05 +0000 (16:33 -0500)]
Replace custom Marvin copy with string.GetHashCode (#48410)

* Use HashCode instead of custom Marvin implementation

* Update src/libraries/System.Formats.Cbor/src/System/Formats/Cbor/CborConformanceLevel.cs

3 years agoDo not block folding of unsigned (and unordered) comparisons in value numbering ...
SingleAccretion [Tue, 9 Mar 2021 21:32:05 +0000 (00:32 +0300)]
Do not block folding of unsigned (and unordered) comparisons in value numbering (#48568)

* Do not block folding of unsigned comparisons in value numbering

* Handle unordered FP comparisons in ValueNumStore::EvalComparison

* Added coverage of evaluating unordered FP comparisons of constants in value numbering

* Do not block evaluation of unordered comparisons with NaNs in ValueNumStore::VNForFunc

* Added coverage of early folding logic for cgt.un.r4

* Added coverage of early folding logic for cgt.un.r8

* Added coverage of early folding logic for clt.un.r4

* Added coverage of early folding logic for clt.un.r8

* Improve placement of comments

* Added coverage of early folding logic for bge.un.r4

* Added coverage of early folding logic for bge.un.r8

* Added coverage of early folding logic for bgt.un.r4

* Added coverage of early folding logic for bgt.un.r8

* Added coverage of early folding logic for ble.un.r4

* Added coverage of early folding logic for ble.un.r8

* Added coverage of early folding logic for blt.un.r4

* Added coverage of early folding logic for blt.un.r8

* Added coverage of early folding logic for bne.un.r4

* Added coverage of early folding logic for bne.un.r8

3 years agoFix to release memory allocated by AllocHGlobal (#48059)
gekka [Tue, 9 Mar 2021 20:31:18 +0000 (05:31 +0900)]
Fix to release memory allocated by AllocHGlobal (#48059)

3 years ago[wasm] Add Wasm.Build tests, for testing wasm app builds (#47683)
Ankit Jain [Tue, 9 Mar 2021 19:01:38 +0000 (14:01 -0500)]
[wasm] Add Wasm.Build tests, for testing wasm app builds (#47683)

* [wasm] Add Wasm.Build tests, for testing wasm app builds

These tests will build wasm test projects, as part of each test method,
and run them.

Other library tests are run with `xharness`, and the test assembly is run
under wasm.  But here we want to run them with xunit, outside wasm. So,
this has different requirements for the helix payload, eg, the sdk,
xunit console runner etc.

To make it work, a new Scenario - `BuildWasmApps` is added, which emits
it's archives in a `buildwasmapps/` folder, which makes it easy to pick
up for the helix test run.

The tests are added under `src/tests/BuildWasmApps/Wasm.Build.Tests`, but
they use `Directory.Build*` from `src/libraries`, similar to how
FunctionalTests do it.

Another use case of this kinda scenario are the wasm debugger tests,
in which the individual test methods launch wasm apps, and then debug
them. (TBD)

Tests:

- The initial set of tests are just proof-of-concept, and more will be
  added once this is merged.

Note: The individual tests build test projects, and then run them with
`xharness`, under `v8`, and Chrome.

* [wasm] Disable il stripping completely

This uses `mono-cil-strip` from a mono installation. And in it's current
form it can cause issues, so disabling it for now.

* Bump helix timeout for tests from 30m to 60m

* [wasm] Cleanup builing RunScriptCommand

.. this allows supporting other properties from xunit*targets, eg. to
run a particular test `$(XUnitMethodName)`, which adds `-method foobar`
to the command line.

* [wasm] Fix timeout string, 00:60:00 to 01:00:00

* [wasm] Fix path to build support dir

* cleanup

* [wasm] fix InvariantGlobalization test

* [wasm] cleanup Wasm.Build.Tests.csproj

* [wasm] Add `include_aot` param for the test data

* [wasm] Enable verbose output for xunit

Instead of writing all the output to stdout also, use `-verbose` which
gives output like:

```
      Wasm.Build.Tests.WasmBuildAppTest.InvariantGlobalization(config: "Debug", aot: False, invariantGlobalization: null) [STARTING]
  ============== wasm test =============
  ============== wasm test-browser =============
      Wasm.Build.Tests.WasmBuildAppTest.InvariantGlobalization(config: "Debug", aot: False, invariantGlobalization: null) [FINISHED] Time: 8.6357275s
```

We log the detailed output to files anyway.

* [wasm] fix tests

* [wasm] Really enable verbose output for xunit, this time

* [wasm] Update tests to track the xharness fix for expected-exit-code

* [wasm] Bump browser job's timeout from 120 to 180 mins

* Improve comment

Co-authored-by: Mitchell Hwang <mitchhwang1418@gmail.com>
* Update eng/testing/tests.mobile.targets

Co-authored-by: Mitchell Hwang <mitchhwang1418@gmail.com>
* Remove unrelated commit

Instead, this is moved to a different AOT PR.

Revert "[wasm] Disable il stripping completely"

This reverts commit 25c2340a636be7d8973c09b6808a20466fdcd296.

* Revert "Remove unrelated commit"

This is needed because `mono-cil-strip` isn't available on helix. And we
want to disable cil stripping anyway.

This reverts commit ead13ee3d9c6d53a22b3c3051542057373c77b31.

Co-authored-by: Mitchell Hwang <mitchhwang1418@gmail.com>
3 years agoResolve ILLink warnings in System.ComponentModel.TypeConverter (Round 1) (#48890)
Eric Erhardt [Tue, 9 Mar 2021 18:49:25 +0000 (12:49 -0600)]
Resolve ILLink warnings in System.ComponentModel.TypeConverter (Round 1) (#48890)

* Resolve ILLink warnings in System.ComponentModel.TypeConverter (Round 1)

Contributes to #45623

* Update the AttributeCollection message

* Add trimming test for SimplePropertyDescriptor.IsReadOnly

* Update the ref source with DynamicallyAccessedMembers attributes

3 years agoIncrease timeout for thread pool tests (#49329)
Dan Moseley [Tue, 9 Mar 2021 18:35:51 +0000 (10:35 -0800)]
Increase timeout for thread pool tests (#49329)

Relates to #48236

It isn't possible to say whether the test is hung, or will complete but occasionally needs more than 30 seconds. Let's try increasing the cutoff to see.

3 years ago[metadata_update] Fix bounds check error (#49328)
Aleksey Kliger (λgeek) [Tue, 9 Mar 2021 17:34:38 +0000 (12:34 -0500)]
[metadata_update] Fix bounds check error (#49328)

The issue is that the STANDALONESIG bounds check was using a 0-based index, and
mono_metadata_bounds_check_slow was compensating by adding 1.

But that made another call to the bounds check fail: in
mono_class_from_typeref_checked we passed a 1-based index.  So in the case
where a TypeRef was using the last AssemblyRef in a delta, the bound check
would fail.

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

Co-authored-by: Ryan Lucia <ryan@luciaonline.net>
Co-authored-by: Ryan Lucia <ryan@luciaonline.net>
3 years agoEnable ICU on iOS (#48606)
Steve Pfister [Tue, 9 Mar 2021 17:17:52 +0000 (12:17 -0500)]
Enable ICU on iOS (#48606)

3 years agoReset assignedInterval during verifyFinalAllocation (#49286)
Kunal Pathak [Tue, 9 Mar 2021 17:00:42 +0000 (09:00 -0800)]
Reset assignedInterval during verifyFinalAllocation (#49286)

* Unassign register for RefTypeDef if it is not assigned register

Fix failures exposed by EHWriteThru:

https://dev.azure.com/dnceng/public/_build/results?buildId=1021926&view=ms.vss-test-web.build-test-results-tab&runId=31791570&resultId=180705&paneView=dotnet-dnceng.dnceng-build-release-tasks.helix-test-information-tab

https://helixre8s23ayyeko0k025g8.blob.core.windows.net/dotnet-runtime-refs-pull-47307-head-ad03bd78ebf7456dbe/System.Memory.Tests/console.387c2cf0.log?sv=2019-07-07&se=2021-03-24T01%3A36%3A31Z&sr=c&sp=rl&sig=hPD%2B625ykQtQRVKnl3pCZzTEiI5hXzrqZtIPgo6Wc74%3D

* Fix more asserts for spillAfter/Def where assignedInterval was not reset

Fixes errors like this:

https://dev.azure.com/dnceng/public/_build/results?buildId=1024357&view=ms.vss-test-web.build-test-results-tab&runId=31848698&resultId=181011&paneView=dotnet-dnceng.dnceng-build-release-tasks.helix-test-information-tab

https://helixre8s23ayyeko0k025g8.blob.core.windows.net/dotnet-runtime-refs-pull-47307-head-2f177492e7644d448d/System.Management.Tests/console.5337e574.log?sv=2019-07-07&se=2021-03-25T09%3A27%3A01Z&sr=c&sp=rl&sig=aBfB4tstmjMyucEadkhaFxtWdog3teT32PvzPAS4Vv4%3D

* jit format

3 years agoJIT: update jit config defaults for PGO (#49267)
Andy Ayers [Tue, 9 Mar 2021 16:35:15 +0000 (08:35 -0800)]
JIT: update jit config defaults for PGO (#49267)

Enable edge profiling by default, when jitting, or when prejitting for R2R.
Keep block profiling there for classic ngen (so there is an entry probe).

Enable minimal probing by default, when jitting. Keep full probing there for
prejitting so presence of counts in a method implies method was executed.

Enable class profiling by default when jitting. Still TBD if we will also
do this when prejitting.

Enable guarded devirtualization by default (will only kick in for PGO).

Adjust experimental CI legs to reflect the above.

Net effect is that when jitting, COMPlus_TieredPGO=1 turns on dynamic PGO
with the expected set of behaviors, without any other options.

We'll still need to set COMPlus_TC_QuickJitForLoops=1 to have methods with
loops pass through Tier0.

3 years agoFix pgo ci bugs (#49349)
David Wrighton [Tue, 9 Mar 2021 16:10:24 +0000 (08:10 -0800)]
Fix pgo ci bugs (#49349)

* Fix null reference in pgo data merging

* Additional fixes found in CI usage of dotnet-pgo tool

3 years agoInclude timeout value in Regex cache key (#49352)
Stephen Toub [Tue, 9 Mar 2021 14:41:09 +0000 (09:41 -0500)]
Include timeout value in Regex cache key (#49352)

Static Regex methods use a cache of recently used regexes.  We currently include in the key for that cache whether a timeout value was specified, since whether there's a timeout can impact how the regex is built, but we don't currently include the actual value of the timeout.  This leads to oddities where if the same pattern, culture, and options are used with a static regex method and one non-infinite timeout, and then those exact same values are used with a different non-infinite timeout, and then original data was still in the cache, we'll end up using the previous timeout value rather than the new timeout value.  The fix is just to include the timeout itself in the key.

3 years agoFix access mode of memory-mapped apphost (#49341)
Mateo Torres-Ruiz [Tue, 9 Mar 2021 14:39:27 +0000 (06:39 -0800)]
Fix access mode of memory-mapped apphost (#49341)

* Use read access on apphost memory mapped file

* Add test

3 years agoSync shared crossgen2 files (#49302)
Michal Strehovský [Tue, 9 Mar 2021 14:37:13 +0000 (15:37 +0100)]
Sync shared crossgen2 files (#49302)

3 years agoFix link in covariant-return-methods.md (#49356)
lindexi [Tue, 9 Mar 2021 11:47:00 +0000 (19:47 +0800)]
Fix link in covariant-return-methods.md (#49356)

3 years ago[interp] Stop generating code in the cbb if the inlined method always throws (#49344)
Vlad Brezae [Tue, 9 Mar 2021 09:45:54 +0000 (11:45 +0200)]
[interp] Stop generating code in the cbb if the inlined method always throws (#49344)

3 years agoChange package names without interior dir names (#49202)
Andy Gocke [Tue, 9 Mar 2021 08:53:29 +0000 (00:53 -0800)]
Change package names without interior dir names (#49202)

* Change package names without interior dir names

The previous renaming properly renamed the package, but also renamed
the nested folder in the dotnet-runtime zip to Microsoft.NETCore.App.PGO,
which created problems with integration with the installer. This should
fix that by creating packages with a changed name without altering the contents.

* Test change without renaming host package

* Only set property when pgoinstrument is set

* Missed .Runtime package

* Code review comments

3 years agoFix EC key file import tests (#49253)
Jeremy Koritzinsky [Tue, 9 Mar 2021 07:29:15 +0000 (23:29 -0800)]
Fix EC key file import tests (#49253)

* Fix cofactor import and disable tests that require the ability to derive a new public key from a private key + curve + generator, order, and cofactor.

* Add missing member.

* Disable more tests against CanDeriveNewPublicKey.

* Use isSupported instead of ConditionalFact.

* Fix net47 build.

3 years agoRemove no longer needed `usenmakemakefiles` option (#49327)
Bruce Forstall [Tue, 9 Mar 2021 05:51:14 +0000 (21:51 -0800)]
Remove no longer needed `usenmakemakefiles` option (#49327)

After https://github.com/dotnet/jitutils/pull/318, we no longer
need this option.

3 years agoMove test_fx_ver under test folder (#49313)
Elinor Fung [Tue, 9 Mar 2021 03:46:53 +0000 (19:46 -0800)]
Move test_fx_ver under test folder (#49313)