platform/upstream/dotnet/runtime.git
3 years agoAdded the `ConfigureDefaults` API, as an extension method of `IHostBuilder` (#50447)
David Pine [Wed, 31 Mar 2021 00:20:57 +0000 (19:20 -0500)]
Added the `ConfigureDefaults` API, as an extension method of `IHostBuilder` (#50447)

* Added the ConfigureDefaults API, as an extension method on the IHostBuilder interface. Fix #36003

* Apply suggestions from code review

Co-authored-by: Eric Erhardt <eric.erhardt@microsoft.com>
* Update src/libraries/Microsoft.Extensions.Hosting/src/Host.cs

Co-authored-by: Eric Erhardt <eric.erhardt@microsoft.com>
3 years agoFix handling of array constructors in Crossgen2 (#48557)
Tomáš Rylek [Tue, 30 Mar 2021 23:44:40 +0000 (16:44 -0700)]
Fix handling of array constructors in Crossgen2 (#48557)

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

3 years agoMake CLOCK_MONOTONIC handling more precise in pal_threading.c (#50441)
Alexander Köplinger [Tue, 30 Mar 2021 23:42:47 +0000 (01:42 +0200)]
Make CLOCK_MONOTONIC handling more precise in pal_threading.c (#50441)

The root cause of the problem in https://github.com/dotnet/runtime/pull/50388 turned out to be because we do not have `pthread_condattr_setclock(..., CLOCK_MONOTONIC);` on iOS.
This caused the timeout argument for `pthread_cond_timedwait` to be interpreted as an _absolute system time_ (in seconds since the Unix epoch), however the value we got back from `clock_gettime(CLOCK_MONOTONIC, ...)` was actually some value based on the uptime of the system.
Since the uptime is much smaller than the system time the wait immediately returned.

Harden the handling by adding a check for `HAVE_PTHREAD_CONDATTR_SETCLOCK` like we already do in `SystemNative_LowLevelMonitor_Create()`

3 years ago[mono] Remove domain lock (#50328)
Zoltan Varga [Tue, 30 Mar 2021 23:18:03 +0000 (19:18 -0400)]
[mono] Remove domain lock (#50328)

* [mono] Reduce domain lock usage.

* Avoid double locking the loader+domain lock, its not needed.
* Use the mem manager lock and the loader lock in a few places instead of
  the domain lock.
* Use lock free code in mono_jit_runtime_invoke ().
* Avoid locking around mono_jit_info_table_add (), it does locking itself.

* [mono] Internalize access to MonoMemoryManager.mp to memory-manager.c.

Also add a separate non-coop lock to protect it, since its accessed
very frequently.

* Use a separate lock for each memory manager.

* Remove the domain lock.

3 years ago[mono] Move the jit info table definitions into a separate jit-info.h file, it no...
Zoltan Varga [Tue, 30 Mar 2021 23:17:23 +0000 (19:17 -0400)]
[mono] Move the jit info table definitions into a separate jit-info.h file, it no longer depends on domains. (#50423)

3 years agoRename the superpmi.py asmdiffs output directory (#50403)
Bruce Forstall [Tue, 30 Mar 2021 22:45:56 +0000 (15:45 -0700)]
Rename the superpmi.py asmdiffs output directory (#50403)

* Rename the superpmi.py asmdiffs output directory

Previously, the directory name was `asm.os.arch.build_flavor`.
Now, use the MCH file name instead. Since the MCH filename of our
collections has the target os/arch/flavor, those components will still
be there (but will be based on the MCH file, not the host; this is
important if you are doing cross-compile asm diffs). It will
also have the MCH base name, such as "benchmarks.run", to help
distinguish different runs. Of course, if there is a conflict with
a previous run, `.1`, `.2`, etc., is appended to the directory name.

Also, add a new, optional `-tag` option to `superpmi.py asmdiffs` to
allow specifying an additional word to prefix the artifacts folder
base name. This might help more easily distinguish different experiments.

So, `superpmi.py asmdiffs -filter benchmarks -tag test2` might give you
dasm files in these directories:
```
c:\runtime\artifacts\spmi\asm.test2.benchmarks.run.windows.x64.checked.3\base
c:\runtime\artifacts\spmi\asm.test2.benchmarks.run.windows.x64.checked.3\diff
```

* Review feedback

Created `create_artifacts_base_name()` function.

Fixed `run_and_log` to display command line of command being
invoked at the specified log level. Currently only affects invoking
`jit-analyze`, which makes the `jit-analyze` command line visible
on the console, not just in the log file.

3 years agoexpose alloc data on dbi (#50341)
Maoni Stephens [Tue, 30 Mar 2021 22:29:29 +0000 (15:29 -0700)]
expose alloc data on dbi (#50341)

we are already exposing this data for sos, should make this available for debuggers to use as well. it's very lightweight and would be very useful for things like showing exactly how many bytes were allocated on the thread between 2 breakpoints.

3 years agoUse OptimizeForSize condition in SPC only on Browser (#50413)
Alexander Köplinger [Tue, 30 Mar 2021 16:52:30 +0000 (18:52 +0200)]
Use OptimizeForSize condition in SPC only on Browser (#50413)

The size impact doesn't matter for tvOS.

3 years agoFileSystemGlobbing: Allow rootDir paths ending with separator to match files correctl...
David Cantú [Tue, 30 Mar 2021 16:45:10 +0000 (09:45 -0700)]
FileSystemGlobbing: Allow rootDir paths ending with separator to match files correctly (#45139)

* Allow rootDir paths ending with separator to match files correctly

* Avoid running tests with windows-like absolute paths on non-windows platforms

* Address test suggestion

3 years agoFix issues with JitDump (#50395)
Bruce Forstall [Tue, 30 Mar 2021 16:42:04 +0000 (09:42 -0700)]
Fix issues with JitDump (#50395)

1. On 64 bit platforms, with "long" bitset types (> 64 bits), when
converting to string format for display, we were only displaying
the low 32 bits of every 64 bit chunk.
2. Add display of the `IGF_ALIGN` flag.

3 years agoUpdate dependencies from https://github.com/mono/linker build 20210330.1 (#50417)
dotnet-maestro[bot] [Tue, 30 Mar 2021 16:25:00 +0000 (11:25 -0500)]
Update dependencies from https://github.com/mono/linker build 20210330.1 (#50417)

Microsoft.NET.ILLink.Tasks
 From Version 6.0.100-preview.2.21177.1 -> To Version 6.0.100-preview.2.21180.1

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
3 years agoClean up allocated memory on error in CordbEval::NewParameterizedObject (#50371)
Omair Majid [Tue, 30 Mar 2021 16:08:02 +0000 (12:08 -0400)]
Clean up allocated memory on error in CordbEval::NewParameterizedObject (#50371)

pArgData is allocated in this piece of code; if we are failing and
returning early, we should deallocate this memory to avoid a memory
leak.

3 years agoincrease timout on ConnectTimeout_TimesOutSSLAuth_Throws test (#50351)
Tomas Weinfurt [Tue, 30 Mar 2021 16:04:42 +0000 (09:04 -0700)]
increase timout on ConnectTimeout_TimesOutSSLAuth_Throws test (#50351)

3 years agoFix waits on iOS (#50388)
Ryan Lucia [Tue, 30 Mar 2021 14:31:36 +0000 (10:31 -0400)]
Fix waits on iOS (#50388)

I don't understand why CLOCK_MONOTONIC doesn't work even in newer simulators here, but this will at least fix the problem for now.

3 years agoRevert "Fix release builds with latest VS dogfood (#49948)" (#50398)
Jan Kotas [Tue, 30 Mar 2021 14:10:16 +0000 (07:10 -0700)]
Revert "Fix release builds with latest VS dogfood (#49948)" (#50398)

This reverts commit 3961d91812c997af18ff1ebbdac53bcc4d84fb02.

This workaround is no longer needed.

3 years ago[interp] Add a few super instructions (#50361)
Vlad Brezae [Tue, 30 Mar 2021 11:23:03 +0000 (14:23 +0300)]
[interp] Add a few super instructions (#50361)

* [interp] Fix PROFILE_INTERP build

* [interp] Add ldc.i8.0 opcode, replacing ldnull on 64bit

We still need to use this opcode in more places, instead of the generic ldc.i8

* [interp] Add a few super instructions

We depend on the cprop pass to init local_ref_count. We only add a super instruction if the definition of the an intermediary result is done in the same basic block (the dreg is local var) and it is not used anywhere else, otherwise we can't clear the instruction.

* [interp] Improve the marvin block intrinsic

By removing also 2 additional ldloca instructions, and enabling cprop for these vars that no longer have their address taken.

3 years ago[main] Update dependencies from dotnet/runtime dotnet/xharness (#50358)
dotnet-maestro[bot] [Tue, 30 Mar 2021 11:21:28 +0000 (07:21 -0400)]
[main] Update dependencies from dotnet/runtime dotnet/xharness (#50358)

* Update dependencies from https://github.com/dotnet/runtime build 20210328.6

Microsoft.NETCore.DotNetHost , Microsoft.NETCore.DotNetHostPolicy , Microsoft.NETCore.ILAsm , runtime.native.System.IO.Ports , Microsoft.NET.Sdk.IL , System.Runtime.CompilerServices.Unsafe , System.Text.Json
 From Version 6.0.0-preview.3.21169.6 -> To Version 6.0.0-preview.4.21178.6

* Update dependencies from https://github.com/dotnet/xharness build 20210329.2

Microsoft.DotNet.XHarness.CLI , Microsoft.DotNet.XHarness.TestRunners.Xunit
 From Version 1.0.0-prerelease.21176.1 -> To Version 1.0.0-prerelease.21179.2

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
3 years agoAdd "Help Wanted" badge (#50352)
Ben Adams [Tue, 30 Mar 2021 11:19:31 +0000 (12:19 +0100)]
Add "Help Wanted" badge (#50352)

* Add "Help Wanted" badge

* Move help wanted second

3 years agos390x: Fixes to tailcall and array parameter fix (#49466)
Neale Ferguson [Tue, 30 Mar 2021 10:22:26 +0000 (20:22 +1000)]
s390x: Fixes to tailcall and array parameter fix (#49466)

### Small s390x fixes
- Add another tailcall disqualifying condition
- Minor formatting change

### New Array Parameter fix

We have been seeing msbuild tasks fail due to an OverflowException being raised in `(wrapper_alloc)_object:AllocVector` because the number of elements appears to be negative (0xffffffff00000088).

However, this is just the result of a missing type conversion somehow. The original C# code is simply:
```
_metadataStringTable = new string[_reader.ReadInt32()];
```
The IL corresponding to that line reads:
```
converting (in B2: stack: 2) IL_0021: callvirt 0x0a00035e
cmethod = int System.IO.BinaryReader:ReadInt32 ()
Call requires: 1 parameters
converting (in B2: stack: 2) IL_0026: newarr 0x010000b6
```
Note that the return from the `ReadInt32` call is of type `int` (i.e. 32 bits) and is passed unmodified as argument to `newarr`. This remains the same in the initial stages of Mono JIT compilation:
```
call_membase R43 <- [R45 + 0xe8] [int System.IO.BinaryReader:ReadInt32 ()] [s390_r2 <- R44] clobbers: c
il_seq_point il: 0x26, nonempty-stack
newarr R46 <- R43
```
But later the `newarr` is implemented in terms of a function call:
```
call_membase R43 <- [R45 + 0xe8] [int System.IO.BinaryReader:ReadInt32 ()] [s390_r2 <- R44] clobbers: c
il_seq_point il: 0x26, nonempty-stack
i8const R81 <- [2929315620864]
move R83 <- R81
move R84 <- R43
call R46 <- [(wrapper alloc) object object:AllocVector (intptr,intptr)] [s390_r2 <- R83] [s390_r3 <- R84] clobbers: c
```
And here the argument is of type `intptr` (i.e. 64 bits). But the return value of ReadInt32 is still passed through directly to `AllocVector` without any conversion, and this remains true in the final assembler code:
```
b2: 0d e1             basr %r14,%r1 // ReadInt32
b4: b9 04 00 32       lgr %r3,%r2 // <<- simple move of the return value
b8: c0 28 00 00 02 aa iihf %r2,682
be: c0 29 08 d1 28 00 iilf %r2,147924992
c4: c0 e8 00 00 03 ff iihf %r14,1023
ca: c0 e9 9d ec 97 08 iilf %r14,2649528072
d0: 0d ee             basr %r14,%r14 // AllocVector
```
This becomes a problem because the implementation of `AllocVector` does indeed expect a 64-bit input, and throws an exception if that is negative.

In addition, the implementation of `ReadInt32` only computes a 32-bit result in the low 32 bits of the register, and leaves the upper half undefined. Due to the particular code sequence we get a return with the upper half nonzero even though the lower half is a positive integer:
```
e6: e3 20 f0 e0 00 14  lgf %r2,224(%r15) <<- if this is a 32-bit value with the top bit set, then the upper half of %r2 is now 0xffffffff
ec: e3 20 f0 b8 00 50  sty %r2,184(%r15)
f2: b9 04 00 32        lgr %r3,%r2 <<- and so is %r3
f6: c0 01 00 ff 00 ff  lgfi %r0,16711935
fc: b9 e4 00 43        ngrk %r4,%r3,%r0
100: b9 14 00 24       lgfr %r2,%r4
104: 88 20 00 08       srl %r2,8
108: 89 40 00 18       sll %r4,24
10c: b9 e6 40 22       ogrk %r2,%r2,%r4
110: c0 01 ff 00 ff 00 lgfi %r0,-16711936 <<-- the upper half of %r0 is also 0xffffffff
116: b9 e4 00 43       ngrk %r4,%r3,%r0 <<-- and so is %r4
11a: b9 14 00 34       lgfr %r3,%r4
11e: 89 30 00 08       sll %r3,8
122: 88 40 00 18       srl %r4,24
126: b9 e6 40 33       ogrk %r3,%r3,%r4 <<- and now %r3
12a: b9 08 00 23       agr %r2,%r3 <<- and therefore %r2, where the upper half for 0 before
12e: e3 20 f0 b8 00 50 sty %r2,184(%r15)
134: a7 fb 00 f8       aghi %r15,248
138: eb 6e f0 30 00 04 lmg %r6,%r14,48(%r15)
13e: 07 fe             br %r14 <<- and here it is returned unchanged
```

3 years agoMore Mono unwind fixes for s390x (#49986)
Ulrich Weigand [Tue, 30 Mar 2021 09:51:36 +0000 (11:51 +0200)]
More Mono unwind fixes for s390x (#49986)

* mono_arch_unwind_frame: Handle FPRs during unwind.  (This is important
  since GCC will spill GPRs to FPRs instead of the stack when beneficial.)

* map_hw_reg_to_dwarf_reg: Implement DWARF register number mapping for FPRs.
  (https://github.com/IBM/s390x-abi/releases/download/v1.5/lzsabi_s390x.pdf)

* mono_arch_create_generic_trampoline: Fix incorrect start address.

3 years agoMove publishing off hosted ADO machines, again (#50405)
Lukas Lansky [Tue, 30 Mar 2021 09:48:34 +0000 (11:48 +0200)]
Move publishing off hosted ADO machines, again (#50405)

Co-authored-by: Matt Galbraith <MattGal@users.noreply.github.com>
3 years ago[WASM] Trim TimeZoneInfo to reduce size (#50266)
Matt Johnson-Pint [Tue, 30 Mar 2021 07:24:50 +0000 (00:24 -0700)]
[WASM] Trim TimeZoneInfo to reduce size (#50266)

* Trim TimeZoneInfo to reduce wasm size

* Use partial class files instead of ifdefs

3 years agoignore empty domain for digets auth (#50348)
Tomas Weinfurt [Tue, 30 Mar 2021 07:01:14 +0000 (00:01 -0700)]
ignore empty domain for digets auth (#50348)

* ignore empty domain for digets auth

* style cleanup

3 years agoAnnotate CreateInstanceForAnotherGenericParameter as PublicParameterlessConstructor...
Eric Erhardt [Tue, 30 Mar 2021 02:12:29 +0000 (21:12 -0500)]
Annotate CreateInstanceForAnotherGenericParameter as PublicParameterlessConstructor (#50390)

This allows private constructors on the Types to be trimmed.

Fix #50353

3 years agoDo not fold away double negation if the tree is a CSE candidate (#50373)
SingleAccretion [Tue, 30 Mar 2021 01:14:17 +0000 (04:14 +0300)]
Do not fold away double negation if the tree is a CSE candidate (#50373)

* Do not morph away double negation if it is a CSE candidate

* Added a test verifying that double negation is not removed for CSEs

* Bump the test's priority to zero

3 years agoAdd CancellationTokenSource.TryReset (#50346)
Stephen Toub [Tue, 30 Mar 2021 00:44:25 +0000 (20:44 -0400)]
Add CancellationTokenSource.TryReset (#50346)

* Add CancellationTokenSource.TryReset

* Update src/libraries/System.Private.CoreLib/src/System/Threading/CancellationTokenSource.cs

3 years agoSeveral WebProxy-related fixes (#50368)
Stephen Toub [Tue, 30 Mar 2021 00:40:33 +0000 (20:40 -0400)]
Several WebProxy-related fixes (#50368)

- Split browser from non-browser to avoid CA1416 suppressions, UnsupportedOSPlatform attributes, and PNSEs when used from browser
- Cache domain name and local addresses for use in IsLocal, along with clearing of the caches upon network change detection
- Removing redundant IPAddress.IsLoopback check that's covered by previous Uri.IsLoopback check
- Change IsMatchInBypassList to use string interpolation, such that the non-default port case will get better implicitly with C# 10 interpolated string improvements

3 years agoFix SuperPMI handling of missing data for asm diffs (#50309)
Bruce Forstall [Tue, 30 Mar 2021 00:12:57 +0000 (17:12 -0700)]
Fix SuperPMI handling of missing data for asm diffs (#50309)

Adjust the error code determination for asm diffs to not report
diffs if all the compilation failures were due to missing data
in the MCH files.

Update the SuperPMI end status line to report the count of MC
compilation failures due to missing data (and adjust parallel
SuperPMI to handle it as well).

As a result, with `superpmi.py asmdiffs` you won't see the message
"Asm diffs" if all the failures were due to missing data.

3 years agoSinglefile compression of native files (#49855)
Vladimir Sadov [Mon, 29 Mar 2021 23:16:14 +0000 (16:16 -0700)]
Singlefile compression of native files (#49855)

* versioning

* no need to support 2.0 bundle version

* enable compression

* fixes after rebase

* build fix for Unix

* Fix build with GCC

* disable a test temporarily to see what else breaks

* Add EnableCompression option to Bundler + PR feedback

* Couple more places should use version 6.0

* PR feedback (header versioning, more tests, fixed an assert)

* Suggestion from PR review

Co-authored-by: Vitek Karas <vitek.karas@microsoft.com>
* sorted usings

* should be bundle_major_version in two more places.

* More PR feedback

Co-authored-by: Vitek Karas <vitek.karas@microsoft.com>
3 years agoDon't throw when previous enum mapping is not found. (#49892)
Steve Molloy [Mon, 29 Mar 2021 22:46:54 +0000 (15:46 -0700)]
Don't throw when previous enum mapping is not found. (#49892)

3 years agoRemove unnecessary delegate/closure from NtProcessInfoHelper on Windows (#50387)
Stephen Toub [Mon, 29 Mar 2021 22:10:00 +0000 (18:10 -0400)]
Remove unnecessary delegate/closure from NtProcessInfoHelper on Windows (#50387)

3 years agoClean up REGUTIL/CLRConfig system (#50314)
Aaron Robinson [Mon, 29 Mar 2021 20:58:50 +0000 (13:58 -0700)]
Clean up REGUTIL/CLRConfig system (#50314)

* Convert all configuration options from REGUTIL to CLRConfig.

* Remove uses of REGUTIL outside of CLRConfig impl.

3 years agoSet IsTrimmable on CompilerServices.Unsafe (#50370)
Sven Boemer [Mon, 29 Mar 2021 20:14:51 +0000 (13:14 -0700)]
Set IsTrimmable on CompilerServices.Unsafe (#50370)

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

3 years agoFix unintended closure in RsaPaddingProcessor.OpenProcessor (#50377)
Stephen Toub [Mon, 29 Mar 2021 20:11:13 +0000 (16:11 -0400)]
Fix unintended closure in RsaPaddingProcessor.OpenProcessor (#50377)

3 years agoRemove some delegate/closures from X509Pal (#50376)
Stephen Toub [Mon, 29 Mar 2021 20:06:30 +0000 (16:06 -0400)]
Remove some delegate/closures from X509Pal (#50376)

3 years ago[wasm] Wasm.Build.Tests: add support for shared builds (#49398)
Ankit Jain [Mon, 29 Mar 2021 19:33:54 +0000 (15:33 -0400)]
[wasm] Wasm.Build.Tests: add support for shared builds (#49398)

* [wasm] Wasm.Build.Tests: add support for shared builds

- Essentially, we want to share builds wherever possible. Example cases:

    - Same build, but run with different hosts like v8/chrome/safari, as
      separate test runs
    - Same build but run with different command line arguments

- Sharing builds especially helps when we are AOT'ing, which is slow!

- This is done by caching the builds with the key:

    `public record BuildArgs(string ProjectName, string Config, bool AOT, string ProjectFileContents, string? ExtraBuildArgs);`

- Also, ` SharedBuildClassFixture` is added, so that the builds can be
  cleaned up after all the tests in a particular class have finished
  running.

- Each test run gets a randomly generated test id. This is used for
  creating:
  1. build paths, like `artifacts/bin/Wasm.Build.Tests/net6.0-Release/browser-wasm/xharness-output/logs/n1xwbqxi.ict`
  2. and the log for running with xharness, eg. for Chrome, are in
     `artifacts/bin/Wasm.Build.Tests/net6.0-Release/browser-wasm/xharness-output/logs/n1xwbqxi.ict/Chrome/`

- split `WasmBuildAppTest.cs` into : `BuildTestBase.cs`, and
  `MainWithArgsTests.cs`.

* [wasm] Wasm.Build.Tests: Add test for relinking with InvariantGlobalization

* [wasm] Wasm.Build.Tests - Check `CultureInfo` for invariant culture

.. tests. Code stolen from @maximlipin's https://github.com/dotnet/runtime/pull/49204/

* fix invariant+aot test

* [wasm] Fix the order of include paths

For AOT we generate `pinvoke-table.h` in the obj directory. But there is
one present in the runtime pack too.

In my earlier changes the order in which these were passed as include
search paths was changed from:

`"-I/runtime/pack/microsoft.netcore.app.runtime.browser-wasm/Release/runtimes/browser-wasm/native/include/wasm" "-Iartifacts/obj/mono/Wasm.Console.Sample/wasm/Release/browser-wasm/wasm/"`

.. which meant that the one from the runtime pack took precedence, and
got used. So, fix the order!

And change the property names to indicate where they are sourced from.

* [wasm] Only test with Release config on CI

* [wasm] Fallback to `dotnet xharness` if `XHARNESS_CLI_PATH` is not set.

The environment variable is set on helix. During local testing it can be
useful when using a locally built xharness.

* [wasm] fix invariant test - 'en-ES' -> 'es-ES'

* [wasm] RunWithEmSdkEnv: log the working directory also

* [wasm] Re-enable wasm build tests

* [wasm] Add regression test for issue #49588

* fix test

* [wasm] Cleanup, and add more tests

* Update tests to track wasm relinking being default in some cases

* Fix InvariantGlobalization to track change in wasm relinking defaults

* [wasm] Update emsdk check message to track changes

* [wasm] Update tests to track changes

* [wasm] Move Scenario=BuildWasmApps to be submitted first

TLDR;
- this might help with the job getting scheduled first, and thus having
  a chance at completing at the same time as others.

Reasoning:

The problem this is trying to fix is:

1. The helix step submits 3 jobs:
    a. library tests to be run with v8
    b. library tests to be run with browser (scenario=wasmtestonbrowser)
    c. Wasm.Build.Tests (scenario=buildwasmapps)

2. The 3 jobs, individually take roughly 30mins each
3. And they get submitted at roughly the same time
4. But .. the first two seem to complete earlier, and the 3rd one
   completes 25-30mins later.

The hypothesis is that all the machines might be busy processing the
200+ work items from each of the first two steps, and so
Wasm.Build.Tests get scheduled pretty late.

So, here we move that to be submitted first, in the hope that it would
be able to run in parallel with the other jobs.

3 years agoRemove unnecessary delegate/closure allocations from PollForValues (#50357)
Stephen Toub [Mon, 29 Mar 2021 18:52:23 +0000 (14:52 -0400)]
Remove unnecessary delegate/closure allocations from PollForValues (#50357)

It allocates a delegate/closure for each counter group each time the loop runs.

3 years agoPropagate XUnitMethodName/XUnitClassName properties to Android test runner (#50295)
Elinor Fung [Mon, 29 Mar 2021 18:06:44 +0000 (11:06 -0700)]
Propagate XUnitMethodName/XUnitClassName properties to Android test runner (#50295)

3 years agoUse a NewHolder for pEmitter to avoid memory leak (#50242)
Omair Majid [Mon, 29 Mar 2021 17:49:48 +0000 (13:49 -0400)]
Use a NewHolder for pEmitter to avoid memory leak (#50242)

It seems like we are allocating memory, but never releasing it.

3 years agoFix typo in comment in BitOperation.cs
Stephen Toub [Mon, 29 Mar 2021 17:26:22 +0000 (13:26 -0400)]
Fix typo in comment in BitOperation.cs

3 years ago[main] Update dependencies from mono/linker (#50232)
dotnet-maestro[bot] [Mon, 29 Mar 2021 17:15:54 +0000 (12:15 -0500)]
[main] Update dependencies from mono/linker (#50232)

* Update dependencies from https://github.com/mono/linker build 20210324.1

Microsoft.NET.ILLink.Tasks
 From Version 6.0.100-preview.2.21172.2 -> To Version 6.0.100-preview.2.21174.1

* Update dependencies from https://github.com/mono/linker build 20210326.1

Microsoft.NET.ILLink.Tasks
 From Version 6.0.100-preview.2.21172.2 -> To Version 6.0.100-preview.2.21176.1

* Update dependencies from https://github.com/mono/linker build 20210327.1

Microsoft.NET.ILLink.Tasks
 From Version 6.0.100-preview.2.21172.2 -> To Version 6.0.100-preview.2.21177.1

* Add missing annotations

* Always keep ValueType constructor

* Fix exceptions descriptors to match what native lookup expects

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: Marek Safar <marek.safar@gmail.com>
3 years agoDo not mutate IEnumerable and null values when formatting (#49228)
Per Gårdebrink [Mon, 29 Mar 2021 16:22:06 +0000 (18:22 +0200)]
Do not mutate IEnumerable and null values when formatting (#49228)

Co-authored-by: Stephen Toub <stoub@microsoft.com>
3 years agoJIT: tolerate edge profile inconsistencies better. (#50213)
Andy Ayers [Mon, 29 Mar 2021 15:55:15 +0000 (08:55 -0700)]
JIT: tolerate edge profile inconsistencies better. (#50213)

We should not blow up jitting just because edge counts are inconsistent.

Also, make sure we're not doing any guarded devirt if we disable pgo.

And, add an option JitEnablePgoRange to selectively enable use of PGO for
problem isolation.

3 years agoReenable threadstart tests. (#50343)
Sergey Andreenko [Mon, 29 Mar 2021 15:42:16 +0000 (08:42 -0700)]
Reenable threadstart tests. (#50343)

The failures do not look jit-related. If they fail again please open another issue.

3 years agoAdded LoggerMessage.Define overloads to disable IsEnabled check (#50334)
Günther Foidl [Mon, 29 Mar 2021 13:37:10 +0000 (15:37 +0200)]
Added LoggerMessage.Define overloads to disable IsEnabled check (#50334)

- LoggerMessage.Define with overload to disable IsEnabled check
- Hoist skipEnabledCheck

3 years agoAlways clear the local buffer in ArrayBuffer (#49573)
David Fowler [Mon, 29 Mar 2021 04:15:47 +0000 (21:15 -0700)]
Always clear the local buffer in ArrayBuffer (#49573)

- SslStream was holding onto a 4K byte[] after the handshake was complete. This was because the ArrayBuffer struct doesn't clear the local buffer field in dispose. This changes that.

3 years agoIncrease test coverage for Exception.TargetSite (#50275)
Michal Strehovský [Mon, 29 Mar 2021 03:03:45 +0000 (05:03 +0200)]
Increase test coverage for Exception.TargetSite (#50275)

* Increase test coverage for Exception.TargetSite

* Apply suggestions from code review

Co-authored-by: Stephen Toub <stoub@microsoft.com>
Co-authored-by: Stephen Toub <stoub@microsoft.com>
3 years agocatch exceptions in callbacks from native code on OSX in SafeDeleteSslContext (#49945)
Tomas Weinfurt [Mon, 29 Mar 2021 01:01:19 +0000 (18:01 -0700)]
catch exceptions in callbacks from native code on OSX in SafeDeleteSslContext (#49945)

* catch exceptions in callbacks from native code

* style update

* add traces for failures

* add comment

3 years agoUse random file names in the TZ tests (#50339)
Tarek Mahmoud Sayed [Mon, 29 Mar 2021 00:24:24 +0000 (17:24 -0700)]
Use random file names in the TZ tests (#50339)

3 years agoAdd documentation on ILLink files (#50302)
Eric Erhardt [Sun, 28 Mar 2021 21:52:37 +0000 (16:52 -0500)]
Add documentation on ILLink files (#50302)

* Add documentation on ILLink files

* Add link to ILLink-files from project-guidelines

3 years ago[main] Update dependencies from dotnet/arcade dotnet/xharness (#50278)
dotnet-maestro[bot] [Sun, 28 Mar 2021 20:34:59 +0000 (20:34 +0000)]
[main] Update dependencies from dotnet/arcade dotnet/xharness (#50278)

[main] Update dependencies from dotnet/arcade dotnet/xharness

 - reintroduce publishing branch workarounds.

Required while https://github.com/dotnet/arcade/issues/6987 is fixed

 - fix whitespace in publish-using-darc script

 - re-introduce publishing branch workaround

https://github.com/dotnet/arcade/issues/698

3 years agoAdd check for JsonConverterFactory (#50219) (#50329)
Sychev Vadim [Sun, 28 Mar 2021 12:46:02 +0000 (15:46 +0300)]
Add check for JsonConverterFactory (#50219) (#50329)

3 years ago[mono] Reduce usage of the domain lock (#50313)
Zoltan Varga [Sat, 27 Mar 2021 18:06:39 +0000 (14:06 -0400)]
[mono] Reduce usage of the domain lock (#50313)

* [mono] Add a separate lock for the method_to_dyn_method hashtable.

* Use the jit memory manager lock instead of the domain lock in the arm64 patch code.

* Remove usage of the domain lock from the interpreter code.

* Use a separate lock to protect the jit info table.

* Fix the build.

3 years agoHarden SuperPMI replay against missing data (#50307)
Bruce Forstall [Sat, 27 Mar 2021 16:30:11 +0000 (09:30 -0700)]
Harden SuperPMI replay against missing data (#50307)

When generating disasm for an SPMI replay, we can call
`eeGetMethodFullName` for callees for which we are missing data.
Fix `MethodContext::repGetArgNext` to raise an appropriate exception,
and not crash, when it encounters missing data.

3 years agoResolve remaining Xslt-related warnings (round 2) (#50211)
Jose Perez Rodriguez [Sat, 27 Mar 2021 15:59:20 +0000 (08:59 -0700)]
Resolve remaining Xslt-related warnings (round 2) (#50211)

* Resolve remaining Xslt-related warnings

* Addressing final linker warning and adding annotations to ref assembly

* Update src/libraries/System.Private.Xml/src/System/Xml/Xsl/IlGen/GenerateHelper.cs

Co-authored-by: Eric Erhardt <eric.erhardt@microsoft.com>
* Update src/libraries/System.Private.Xml/src/System/Xml/Xsl/Runtime/XmlExtensionFunction.cs

Co-authored-by: Eric Erhardt <eric.erhardt@microsoft.com>
* Addressing PR feedback

* kept -> preserved

* Address remaining feedback

Co-authored-by: Eric Erhardt <eric.erhardt@microsoft.com>
3 years agoFix PKCS Crypto tests on Android (#50252)
Jeremy Koritzinsky [Sat, 27 Mar 2021 07:11:34 +0000 (00:11 -0700)]
Fix PKCS Crypto tests on Android (#50252)

* Handle the fact that on Android, more validation failures are treated as PartialChain when doing CMS signing.

* Fix copy-paste error for RSA SHA-512 PKCS1 padding

* Change condition so we have it in netstandard builds.

3 years agoImprove performance of DateTime.UtcNow on Windows (#50263)
Levi Broderick [Sat, 27 Mar 2021 04:52:19 +0000 (21:52 -0700)]
Improve performance of DateTime.UtcNow on Windows (#50263)

Optimizes leap-second handling by avoiding calls to FileTimeToSystemTime when possible

3 years agoDelete unreachable code for emitting PE fixups and obj files (#50259)
Jan Kotas [Sat, 27 Mar 2021 03:02:35 +0000 (20:02 -0700)]
Delete unreachable code for emitting PE fixups and obj files (#50259)

* Delete unrechable code for emitting PE fixups and obj files

* Fold ICeeGen into ICeeGenInternal and change IID

3 years agoAdd CoreCLR implementation of CallConvMemberFunction. (#47828)
Jeremy Koritzinsky [Sat, 27 Mar 2021 01:53:10 +0000 (18:53 -0700)]
Add CoreCLR implementation of CallConvMemberFunction. (#47828)

* Add CoreCLR implementation of CallConvMemberFunction.

* Add tests and make a few fixes to get them passing.

* Fix Clang build

* Fix argument ordering for calling a cdecl or stdcall instance method from managed.

* Update src/coreclr/dlls/mscorrc/mscorrc.rc

Co-authored-by: Jan Kotas <jkotas@microsoft.com>
* Fix UnmanagedCallersOnly instance method calls for stdcall and cdecl.

* Update issues.targets.

* Fix formatting.

* Add dummy param to validate param order. Rewrite traversal to second-to-last argument.

* Merge implementations of call conv modopt name comparison.

Use a macro-based implementation initially since it allows us to add new calling conventions by adding one line and the macro-ized code is relatively small.

* Fix assignment alignment.

* SAL and contracts.

* Add assert

* Fix UnmanagedCallersOnly parsing in the refactored parser.

Co-authored-by: Jan Kotas <jkotas@microsoft.com>
3 years agoAdd more support for Julian time zones POSIX rules (#50131)
Tarek Mahmoud Sayed [Sat, 27 Mar 2021 01:51:55 +0000 (18:51 -0700)]
Add more support for Julian time zones POSIX rules (#50131)

3 years agoUse IGenericSharedAPI test harness in PriorityQueue (#50291)
Eirik Tsarpalis [Sat, 27 Mar 2021 00:31:05 +0000 (00:31 +0000)]
Use IGenericSharedAPI test harness in PriorityQueue (#50291)

* Use IGenericSharedAPI test harness in PriorityQueue

* remove dead code

* remove index check from IEnumerator.Current

* Update src/libraries/System.Collections/tests/Generic/PriorityQueue/PriorityQueue.Generic.cs

Co-authored-by: Stephen Toub <stoub@microsoft.com>
* Update src/libraries/System.Collections/tests/Generic/PriorityQueue/PriorityQueue.Generic.cs

Co-authored-by: Stephen Toub <stoub@microsoft.com>
Co-authored-by: Stephen Toub <stoub@microsoft.com>
3 years agoAdd PGD files to runtime package (#50296)
Andy Gocke [Sat, 27 Mar 2021 00:07:49 +0000 (17:07 -0700)]
Add PGD files to runtime package (#50296)

3 years agoFix superpmi.py setting of environment (#50304)
Bruce Forstall [Fri, 26 Mar 2021 23:13:26 +0000 (16:13 -0700)]
Fix superpmi.py setting of environment (#50304)

Especially, fix the setting of environment when generating asm diffs
artifacts.

Before, we were setting the global environment before generating textual
dasm or dump files, and not resetting it. Because we currently loop over
all the MCH files doing (1) `superpmi -a` to determine binary diffs,
then (2) generating textual dasm; after the the environment was set in
(2), if there were further MCH files to process, then the variables would
get picked up in (1). This seemed to work ok, except made the diff process
extremely slow because the baseline and diff JIT were generating textual
dasm for every single MC, which was ignored, then we would re-generate it
for any binary diffs.

Thus, for multiple MCH files, and diffs, things are MUCH faster now.

3 years agoUse SPMI_CACHE_DIRECTORY for sharing mch files across repos (#50298)
Kunal Pathak [Fri, 26 Mar 2021 21:34:13 +0000 (14:34 -0700)]
Use SPMI_CACHE_DIRECTORY for sharing mch files across repos (#50298)

* Use SPMI_LOCATION

* Rename to SUPERPMI_CACHE_DIRECTORY

3 years agoEnsure System.Resources.Extensions targets are applied transitively (#50288)
Eric StJohn [Fri, 26 Mar 2021 21:21:16 +0000 (14:21 -0700)]
Ensure System.Resources.Extensions targets are applied transitively (#50288)

Copy targets to buildTransitive so that they will be applied from
transitive package/project references.  We maintain build folder so that
old nuget clients can still get the build targets.

3 years agoWrap ArgumentException with CryptographicException for incorrect key in EnvelopedCms
Kevin Jones [Fri, 26 Mar 2021 21:15:58 +0000 (17:15 -0400)]
Wrap ArgumentException with CryptographicException for incorrect key in EnvelopedCms

If an incorrect asymmetric key is used to decrypt a symmetric key
in enveloped data, and the decryption is successful but produces
an invalid symmetric key, wrap that as a CryptographicException.

3 years agoRename ILLinkTrim files to ILLink.Descriptors (#50216)
Eric Erhardt [Fri, 26 Mar 2021 20:22:38 +0000 (15:22 -0500)]
Rename ILLinkTrim files to ILLink.Descriptors (#50216)

* Rename ILLinkTrim files to ILLink.Descriptors.

Fix #37651

3 years agoAdd missing Windows Android cross compilers (#50118)
Jo Shields [Fri, 26 Mar 2021 19:56:11 +0000 (15:56 -0400)]
Add missing Windows Android cross compilers (#50118)

Previously, only android-x64 cross compilers have been produced for running on windows-x64.

This PR introduces the three missing android RID targets.

3 years agoJIT: Don't allocate string literals inside potential BBJ_THROW candidates (#50112)
Egor Bogatov [Fri, 26 Mar 2021 19:21:29 +0000 (22:21 +0300)]
JIT: Don't allocate string literals inside potential BBJ_THROW candidates (#50112)

3 years agoFix buffering bug (#50277)
Adam Sitnik [Fri, 26 Mar 2021 18:57:14 +0000 (19:57 +0100)]
Fix buffering bug (#50277)

Co-authored-by: Stephen Toub <stoub@microsoft.com>
3 years agoRemove some assemblies from ASP.NETCore transport package (#50284)
Eric StJohn [Fri, 26 Mar 2021 18:32:19 +0000 (11:32 -0700)]
Remove some assemblies from ASP.NETCore transport package (#50284)

3 years ago[QUIC] API Update (#49823)
Marie Píchová [Fri, 26 Mar 2021 17:21:28 +0000 (18:21 +0100)]
[QUIC] API Update (#49823)

* Cherry picked change from scalablecory/msquic-update.

* Enum rename _FLAG --> _FLAGS to follow msquic naming.

* Enums updated

* Updated interop, compilable project.

* Somewhat working update of msquic API

* Post-merge compilation fixes.

* Fixed most of the tests, one turned into ActiveIssue

* Comments.

* Regenerated ref sources.

* Addressed some feedback.

* Added readme.

* QUIC_ADDRESS_FAMILY

3 years agoImplement ISpanFormattable on Rune and Char (#50272)
Stephen Toub [Fri, 26 Mar 2021 16:29:28 +0000 (12:29 -0400)]
Implement ISpanFormattable on Rune and Char (#50272)

* Implement ISpanFormattable on Rune and Char

For now, this helps reduce allocation if a rune or char is used as an argument to string.Format.  Once ISpanFormattable (or whatever we decide to do as part of API review) is public as part of the improved support for interpolated strings, it'll help there as well.

* Address PR feedback

3 years agomove NonDisposedSocket_SafeHandlesCollected to a non-parallel test collection (#50279)
Anton Firszov [Fri, 26 Mar 2021 16:28:24 +0000 (17:28 +0100)]
move NonDisposedSocket_SafeHandlesCollected to a non-parallel test collection (#50279)

3 years agoAdd SIMD instructions not emitted in simd-intrinsics.c for decompose. (#50168)
Johan Lorensson [Fri, 26 Mar 2021 15:45:16 +0000 (16:45 +0100)]
Add SIMD instructions not emitted in simd-intrinsics.c for decompose. (#50168)

Mono codegen emits a couple of SIMD instructions in regular codegen.
Add them to list of instructions to check for vtype decompose.

With this fix all tests under System.Numerics.Vectors pass on Windows.

3 years ago[mono] Runtime cleanup functions removal (#49639)
Ryan Lucia [Fri, 26 Mar 2021 15:34:16 +0000 (11:34 -0400)]
[mono] Runtime cleanup functions removal (#49639)

* Remove DISABLE_CLEANUP define

* Remove the rest of the cleanup functions

* Readd profiler APIs

3 years agoAdd tests validating collections drop references (#50258)
Stephen Toub [Fri, 26 Mar 2021 10:54:17 +0000 (06:54 -0400)]
Add tests validating collections drop references (#50258)

3 years agoLock region allocator (#49990)
Peter Sollich [Fri, 26 Mar 2021 09:11:05 +0000 (10:11 +0100)]
Lock region allocator (#49990)

Make region_allocator multi-thread safe by wrapping a dedicated lock around region_allocator::allocate and region_allocator:delete_region. Added a few ASSERT_HOLDING_SPIN_LOCK to guard against future bitrot.

3 years agoFix pointer tearing in JIT_MemSet helper on ARM64 (#50273)
Jan Kotas [Fri, 26 Mar 2021 09:06:22 +0000 (02:06 -0700)]
Fix pointer tearing in JIT_MemSet helper on ARM64 (#50273)

3 years agoPrint reason why EH Var was not enregistered (#50215)
Kunal Pathak [Fri, 26 Mar 2021 07:26:55 +0000 (00:26 -0700)]
Print reason why EH Var was not enregistered (#50215)

* zero init

* add indicator why EH-var did not get enregistered

* jit format

* review comments

3 years agoDelete a test method that produces an error during compilation. (#50208)
Sergey Andreenko [Fri, 26 Mar 2021 06:46:57 +0000 (23:46 -0700)]
Delete a test method that produces an error during compilation. (#50208)

* Delete a method that produces an error.

The error was:
```
[  4%] Building CXX object Interop/PInvoke/Miscellaneous/ThisCall/CMakeFiles/ThisCallNative.dir/ThisCallNative.cpp.o
/Users/seandree/git/runtime/src/tests/Common/Platform/platformdefines.cpp:356:12: error: cast to smaller integer type 'unsigned int' from '_opaque_pthread_t *' [-Werror,-Wpointer-to-int-cast]
    return (DWORD)*tThread;
           ^~~~~~~~~~~~~~~
1 error generated.
```

* Delete TP_JoinThread

3 years ago[mono] Fix HOST_WASM -> TARGET_WASM in llvm code. (#50269)
Zoltan Varga [Fri, 26 Mar 2021 05:31:09 +0000 (01:31 -0400)]
[mono] Fix HOST_WASM -> TARGET_WASM in llvm code. (#50269)

3 years agoCredentials fix (#50230)
Jan Jahoda [Fri, 26 Mar 2021 04:18:38 +0000 (05:18 +0100)]
Credentials fix (#50230)

* Port of https://github.com/dotnet/corefx/pull/43051

* Shrink suppression file

* Fix another bugs

* Bump System.Net.TestData version

* Fix typo

* Revert casing in connection string

* Fix connection string case

* more fixes

* Change suppression messages

* Fix typo

* Remove false positive

* Fix usersecrets

Co-authored-by: Dan Moseley <danmose@microsoft.com>
3 years ago Block debugger attach after any ApplyUpdate changes (#50200)
Mike McLaughlin [Fri, 26 Mar 2021 01:39:14 +0000 (18:39 -0700)]
 Block debugger attach after any ApplyUpdate changes (#50200)

* Block debugger attach after any ApplyUpdate changes

* Add better error message for ApplyUpdate while debugging

* Code review feedback

* Fix arm32/arm64 builds

* Code review feedback

* Code review feedback

3 years agoAdd PropertyItem tests (#46794)
Hugh Bellamy [Fri, 26 Mar 2021 01:05:47 +0000 (01:05 +0000)]
Add PropertyItem tests (#46794)

* Refactor PropertyItem image code

* Refactor PropertyItemInternal

* Use Windows implementation of PropertyItem in Unix

* PR feedback

* Use ArrayPool

3 years agoremove repetitions ';' (#50236)
kronic [Fri, 26 Mar 2021 00:59:08 +0000 (03:59 +0300)]
remove repetitions ';' (#50236)

Co-authored-by: kronic <kronic@softland.ru>
3 years agoSeal internal types in libraries (#50225)
Stephen Toub [Fri, 26 Mar 2021 00:50:33 +0000 (20:50 -0400)]
Seal internal types in libraries (#50225)

3 years agoMake tests target overwrite any existing xunit-excludes.txt file when building test...
Elinor Fung [Fri, 26 Mar 2021 00:22:53 +0000 (17:22 -0700)]
Make tests target overwrite any existing xunit-excludes.txt file when building test app (#50183)

3 years ago[mbr] Fix encmap boundary and method RVA lookup. (#50248)
Aleksey Kliger (λgeek) [Fri, 26 Mar 2021 00:21:14 +0000 (20:21 -0400)]
[mbr] Fix encmap boundary and method RVA lookup. (#50248)

Two separate issues:

1. When we process the EnC map, any tables after the last one that has an
update gets an "enc_recs" pointer that's one past the last row of the
table.  (the enc_recs pointer is used to speed up relative address lookup).  So
at lookup time if enc_recs says to look past the end of the EnC map table, we
know there won't be any updates - return -1.

2. When looking for the updated RVA of a method, we need to go through every
delta and find the latest one that has an update for the given method.  The
problem is that if a later generation doesn't have an update, we would take the
NULL return value at face value and it would look like the method had no
updates to its body - we would go back to using the original version from
before any updates were applied.  Instead now ignore lookup table misses and
remember the last successful lookup.  Fixes
https://github.com/dotnet/runtime/issues/50190

3 years agoRemoving suspension prioritization scheme for GC threads vs. non-GC (#49378)
Vladimir Sadov [Thu, 25 Mar 2021 23:45:58 +0000 (16:45 -0700)]
Removing suspension prioritization scheme for GC threads vs. non-GC (#49378)

* remove nonfunctional suspension prioritization scheme for GC threads

* remove cntCollideRetry statistics counter

3 years agoDo not set predecessor for throw block (#50115)
Kunal Pathak [Thu, 25 Mar 2021 23:38:43 +0000 (16:38 -0700)]
Do not set predecessor for throw block (#50115)

* Do not set predecessor for throw block

* jit format

* added comments

* delete BBF_SHARED_THROW

3 years agoRemove unused JNI objects (#50224)
Elinor Fung [Thu, 25 Mar 2021 22:43:44 +0000 (15:43 -0700)]
Remove unused JNI objects (#50224)

3 years ago[main] Update dependencies from dotnet/arcade dotnet/xharness dotnet/runtime-assets...
dotnet-maestro[bot] [Thu, 25 Mar 2021 22:41:48 +0000 (22:41 +0000)]
[main] Update dependencies from dotnet/arcade dotnet/xharness dotnet/runtime-assets (#50231)

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

 - Re-introduce publishing workaround

Required while https://github.com/dotnet/arcade/issues/6987 is resolved

3 years agoAdd arch specifier for AOT unpack path (#50194)
Drew Scoggins [Thu, 25 Mar 2021 21:37:18 +0000 (14:37 -0700)]
Add arch specifier for AOT unpack path (#50194)

3 years agoRemove GETTHREAD_ALLOWED tracking (#50080)
Vladimir Sadov [Thu, 25 Mar 2021 21:26:44 +0000 (14:26 -0700)]
Remove GETTHREAD_ALLOWED tracking (#50080)

* Remove GETTHREAD_ALLOWED tracking

* removed EE_THREAD_NOT_REQUIRED

* removed EE_THREAD_REQUIRED

* step1

* more changes

* fix Unix build

* more changes

* GetThread in pinvokestubs.S

* build fix for dac

* PInvokeGetThreadHelper

* more changes (dac)

* more (cordbe)

* more (nearly all?)

* Couple places that were mistakengly set to use `GetThreaNotOk` (should use `GetThreadNULLOk`)

* Renamed GetThread() -> GetThreadDoNotUse()

* Missed a few uses of GetThread()

* One more case of GetThread

* Bring GetThread() back - now with an assert in it.

* Renamed PInvokeGetThreadHelper -> JitGetThreadHelper

* One place that should use GetThreadNULLOk (otherwise there are asserts)

* Apply suggestions from code review

Jan's 74 suggestions.

Co-authored-by: Jan Kotas <jkotas@microsoft.com>
* remove SetFiberMode - it is dead code

* Make `EE_THREAD_NOT_REQUIRED` a noop and revert its removal.

* `GetThreadNULLOk()` should be used here.

* PR review suggestion

Co-authored-by: Jan Kotas <jkotas@microsoft.com>
* renamed JitGetThreadHelper -> GetThreadHelper

* One more place that should use `GetThreadNULLOk()`.

Co-authored-by: Jan Kotas <jkotas@microsoft.com>
3 years ago[debugger] Removing call to jit_done to help debug multithread (#50240)
Thays Grazia [Thu, 25 Mar 2021 19:40:00 +0000 (16:40 -0300)]
[debugger] Removing call to jit_done to help debug multithread (#50240)

It was causing a side effect on Unity, I will study it again while implement multithread on icordebug.

Reverting part of this PR #19103
Mirror of this PR https://github.com/mono/mono/pull/20970

3 years agoDispose the ContentFileProvider when the host is disposed (#50181)
David Fowler [Thu, 25 Mar 2021 19:09:20 +0000 (12:09 -0700)]
Dispose the ContentFileProvider when the host is disposed (#50181)

* Dispose the ContentFileProvider when the host is disposed
- Today we don't and it results in a leak when hosts are created and destroyed.

* Added test

3 years agoImprove Linux root certificate store change detection involving symlinks
Tomas Weinfurt [Thu, 25 Mar 2021 16:08:57 +0000 (09:08 -0700)]
Improve Linux root certificate store change detection involving symlinks

3 years agoPort misc changes from feature/NativeAOT (#50212)
Jan Kotas [Thu, 25 Mar 2021 14:45:51 +0000 (07:45 -0700)]
Port misc changes from feature/NativeAOT (#50212)

3 years agoFix incorrect optimization of Activator.CreateInstance (#50228)
Michal Strehovský [Thu, 25 Mar 2021 14:39:41 +0000 (15:39 +0100)]
Fix incorrect optimization of Activator.CreateInstance (#50228)

We should not return "default" if there's a private parameterless constructor. GetDefaultConstructor only calls the default constructor in the C# sense (public parameterless ctor on a non-abstract class).