platform/upstream/dotnet/runtime.git
3 years agoDecember infra rollout - remove duplicated 'src' from coreclr subrepo (src/coreclr...
Tomáš Rylek [Tue, 8 Dec 2020 02:19:44 +0000 (03:19 +0100)]
December infra rollout - remove duplicated 'src' from coreclr subrepo (src/coreclr/src becomes src/coreclr) (#44973)

* Move src/coreclr/src/Directory.Build.targets to src/coreclr
Merge src/coreclr/src/CMakeLists.txt into src/coreclr/CMakeLists.txt

* Mechanical move of src/coreclr/src to src/coreclr

* Scripts adjustments to reflect the changed paths

3 years agoEnable StressLog for subprocess in EventPipe tests (#45425)
John Salem [Tue, 8 Dec 2020 01:21:04 +0000 (17:21 -0800)]
Enable StressLog for subprocess in EventPipe tests (#45425)

3 years agoReword the note on redundancy of frequent clean builds (#45718)
SingleAccretion [Tue, 8 Dec 2020 00:26:18 +0000 (03:26 +0300)]
Reword the note on redundancy of frequent clean builds (#45718)

3 years agoMove regenerate-download-table and cleanup (#45724)
Viktor Hofer [Tue, 8 Dec 2020 00:06:30 +0000 (01:06 +0100)]
Move regenerate-download-table and cleanup (#45724)

3 years agoAdd default case in RLimitResources switch (#45707)
Adeel Mujahid [Tue, 8 Dec 2020 00:05:07 +0000 (02:05 +0200)]
Add default case in RLimitResources switch (#45707)

* Add default case in RLimitResources switch

* Fix cmake warning in libs, showing up in -s clr too

3 years agoThere is one true bool and it is bool (#45630)
David Wrighton [Mon, 7 Dec 2020 22:12:04 +0000 (14:12 -0800)]
There is one true bool and it is bool (#45630)

While reviewing a PR by @AndyAyersMS, I saw that @Rattenkrieg had noticed our variable use of the `bool` and `BOOL` types. This change converts all BOOL usage to bool in the jit interface api,

- This change should have no impact on anything but the jit interface api surface
- I have a goal of converting the jit interface to be loadable in a non-PAL based header environment. As part of that BOOL as well as many other Windowsisms will need to go away and be replaced by standard types
- This was just the first type, although its the only type change that I believe will necessitate changes in the managed crossgen2 codebase

3 years agoAdd CompressionLevel.SmallestSize (#41960)
Huo Yaoyuan [Mon, 7 Dec 2020 22:11:04 +0000 (06:11 +0800)]
Add CompressionLevel.SmallestSize (#41960)

* Add CompressionLevel.SmallestSize and map to ZLibNative.CompressionLevel.BestCompression.

* Update xmldoc for CompressionLevel.

* Fix xml doc on ZLibNative.CompressionLevel.

* Apply suggestion from review

Co-authored-by: Dan Moseley <danmose@microsoft.com>
* Add SmallestSize to tests.

* Add test for compression level and sizes.

* Update src/libraries/Common/tests/System/IO/Compression/CompressionStreamUnitTestBase.cs

* Brotli

* Re-add size in order test.

Co-authored-by: Dan Moseley <danmose@microsoft.com>
3 years agoUpdate CODEOWNERS (#45620)
Layomi Akinrinade [Mon, 7 Dec 2020 22:06:56 +0000 (14:06 -0800)]
Update CODEOWNERS (#45620)

3 years ago[wasm] Add WasmAppBuilder pkgproj for wasm sample (#44749)
Mitchell Hwang [Mon, 7 Dec 2020 21:21:01 +0000 (16:21 -0500)]
[wasm] Add WasmAppBuilder pkgproj for wasm sample (#44749)

* Add wasm sample pkgproj

* Add wasm Sample pkgproj to descriptions

* Add wasm sample pkgproj ProjectReference

* Add packaging target

* Update to use NetCoreAppToolCurrent

Co-authored-by: Mitchell Hwang <mitchell.hwang@microsoft.com>
3 years agoUpdate dependencies from https://github.com/dotnet/xharness build 20201207.1 (#45684)
dotnet-maestro[bot] [Mon, 7 Dec 2020 21:20:07 +0000 (21:20 +0000)]
Update dependencies from https://github.com/dotnet/xharness build 20201207.1 (#45684)

[master] Update dependencies from dotnet/xharness

3 years agoAdd test for exception propagation inside loader events (#43910)
Ryan Lucia [Mon, 7 Dec 2020 19:51:31 +0000 (14:51 -0500)]
Add test for exception propagation inside loader events (#43910)

3 years agoEnable nullable on HostFactoryResolver (#45513)
James Newton-King [Mon, 7 Dec 2020 19:43:03 +0000 (08:43 +1300)]
Enable nullable on HostFactoryResolver (#45513)

3 years agoUpdate portable thread pool event enablement checks (#45681)
Koundinya Veluri [Mon, 7 Dec 2020 19:20:33 +0000 (11:20 -0800)]
Update portable thread pool event enablement checks (#45681)

* Revert "Make PortableThreadPool to check events correctly before firing them (#45666)"

This reverts commit 83d19de66a596ff5e0ad0519e48dff62945cc636.

* Add keyword and verbosity checks for events

Reverted the part of https://github.com/dotnet/runtime/pull/38225/commits/e8043ffa05450b1983a1e751d0a1af80e43e1f31 regarding `IsEnabled` checks

3 years ago[aot] Store the addresses of aot constants in an array instead of using a switch...
monojenkins [Mon, 7 Dec 2020 18:11:16 +0000 (13:11 -0500)]
[aot] Store the addresses of aot constants in an array instead of using a switch statement on wasm to save space. (#45669)

Co-authored-by: vargaz <vargaz@users.noreply.github.com>
3 years agoCombine free and busy register allocation (#45135)
Carol Eidt [Mon, 7 Dec 2020 17:56:50 +0000 (09:56 -0800)]
Combine free and busy register allocation (#45135)

* Combine free and busy allocation

Perform register allocation for a given RefPosition
with a single traversal of the registers, whether free
or busy.

* More refactoring

* More refactoring to separate evaluation of heursitics.

* More refactoring to simplify configuration.
Fix one source of arm32 double diffs.

* Delete unused `registerIsAvailable` method
Fix `nextPhysRefLocation` computation for Arm32

* Use `UNIT_MAX` not `MAXUINT`

* clear constantReg when interval is moved

* Fix merge issues

* Fix weight

* Fix spill cost update for UpperVectors

* Fix a bug in reload of multireg call on Arm64

* FixedReg fixes

* Review feedback and other cleanup

* Call clearConstanReg before nulling out the interval, so that we can correctly handling doubles on ARM

* Minor cleanup

* Formatting changes

* Other minor pending fixes

Co-authored-by: Kunal Pathak <Kunal.Pathak@microsoft.com>
3 years agoFix GNU linker detection on FreeBSD (#45664)
Adeel Mujahid [Mon, 7 Dec 2020 17:54:54 +0000 (19:54 +0200)]
Fix GNU linker detection on FreeBSD (#45664)

3 years ago[master] Update dependencies from mono/linker (#45565)
dotnet-maestro[bot] [Mon, 7 Dec 2020 17:00:56 +0000 (18:00 +0100)]
[master] Update dependencies from mono/linker (#45565)

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
3 years agoSuppress ILLink warnings in Reflection (#45603)
Eric Erhardt [Mon, 7 Dec 2020 16:37:35 +0000 (10:37 -0600)]
Suppress ILLink warnings in Reflection (#45603)

* Suppress RunClassConstructor ILLinker warning in RuntimeConstructorInfo

This instance is the static constructor, so the static constructor will be present.

* Suppress ILLink warning in CustomAttributeData.Init.

Update ILLink.Suppressions file.

3 years agoUpdate dependencies from https://github.com/dotnet/xharness build 20201204.1 (#45626)
dotnet-maestro[bot] [Mon, 7 Dec 2020 11:45:38 +0000 (11:45 +0000)]
Update dependencies from https://github.com/dotnet/xharness build 20201204.1 (#45626)

[master] Update dependencies from dotnet/xharness

3 years agoMake PortableThreadPool to check events correctly before firing them (#45666)
Sung Yoon Whang [Mon, 7 Dec 2020 04:24:15 +0000 (20:24 -0800)]
Make PortableThreadPool to check events correctly before firing them (#45666)

3 years agoStatic linking of native libs (#44505)
Vladimir Sadov [Mon, 7 Dec 2020 04:08:41 +0000 (20:08 -0800)]
Static linking of native libs (#44505)

* from prototype

* fix OSX

* fix for Android

* treat "libSystem.Globalization.Native" as QCall in mono too (for now).

* fix for wasm

* fix pedantic errors on GCC

* delete gPalGlobalizationNative

* pass overrider from the host

* default override

* default PInvoke override runs after optional host-provided overrider.

* Some PR feedback   (mostly related to code, not the CMake stuff).

* more coding PR feedback

* Deleted "libraries-native" folder.

* unifying tryrun.cmake into 1 common file

* factor out adding lib-specific dependencies into one place (per native library)

* cleanup: entirely remove tryrun.cmake propagation in eng, gen-buildsys, build-commons, and build scripts

* remove "clrcompression.dll" and "libSystem.IO.Compression.Native.dylib" from single-file host packaging

* mono: refactor Globalization lookup into `default_resolve_dllimport`.

* set FEATURE_DISTRO_AGNOSTIC_SSL according to __PortableBuild

* CORECLR_CALLING_CONVENTION for the host callback types

* refactor common parts of entrypoints.c into entrypoints.h

* rename OverrideEntry -->  DllImportEntry

* extra libs as CMake functions

* use macros instead of functions in extra_libs.cmake

* mono formatting style in src/mono/mono/metadata/native-library.c

Co-authored-by: Ryan Lucia <ryan@luciaonline.net>
* mono: Remaining stylistic nits.

Co-authored-by: Ryan Lucia <ryan@luciaonline.net>
* do not set DFEATURE_DISTRO_AGNOSTIC_SSL on iOS, Android, tvOS

Co-authored-by: Ryan Lucia <ryan@luciaonline.net>
3 years agoDelete redundant DivMod implementation (#45652)
Jan Kotas [Sun, 6 Dec 2020 20:42:39 +0000 (12:42 -0800)]
Delete redundant DivMod implementation (#45652)

3 years agoDelete IsIntrinsicWorkaround (#45656)
Jan Kotas [Sun, 6 Dec 2020 19:33:18 +0000 (11:33 -0800)]
Delete IsIntrinsicWorkaround (#45656)

3 years agoAdd support for diffing GC ref map info to R2RDump; small bugfix (#45619)
Tomáš Rylek [Sun, 6 Dec 2020 19:10:56 +0000 (20:10 +0100)]
Add support for diffing GC ref map info to R2RDump; small bugfix (#45619)

3 years agoUpgrade StyleCopAnalyzers to v1.2.0-beta.304 (#45644)
xtqqczze [Sun, 6 Dec 2020 16:24:57 +0000 (16:24 +0000)]
Upgrade StyleCopAnalyzers to v1.2.0-beta.304 (#45644)

Follow-up to #45562.

3 years agoGet exact class during devirtualization (#45526)
Andy Ayers [Sat, 5 Dec 2020 16:33:21 +0000 (08:33 -0800)]
Get exact class during devirtualization (#45526)

If we devirtualize to a method on a generic class, try and obtain the
exact class. Pass this back to the jit to unblock some types of inlines.

Also refactor how information is passed during devirtualization in
anticipation of follow on work to devirtualize default interface methods.
Because there are now multiple inputs and outputs, convey everything
using a struct.

Resolves #38477.

3 years agoUpdate area-owners.md (#45584)
Hong Li [Sat, 5 Dec 2020 02:38:12 +0000 (18:38 -0800)]
Update area-owners.md (#45584)

3 years agoJIT: don't compute edge weights when there's no profile data (#45615)
Andy Ayers [Sat, 5 Dec 2020 02:19:37 +0000 (18:19 -0800)]
JIT: don't compute edge weights when there's no profile data (#45615)

We don't look edge the weights unless there's profile data, so only compute
edge weights if there is profile data.

Saves a tiny bit on TP (~0.2%).

3 years agoOptimize huffman encoding static table initialization (#45303)
Roman Konecny [Fri, 4 Dec 2020 22:42:40 +0000 (23:42 +0100)]
Optimize huffman encoding static table initialization (#45303)

Huffman encoding table split into two static arrays

3 years agoThis is an initial checkin and allows to run some tests (I've included the ones I...
Maoni Stephens [Fri, 4 Dec 2020 21:43:43 +0000 (13:43 -0800)]
This is an initial checkin and allows to run some tests (I've included the ones I ran below). (#45172)

I have not done a full functional test run - there are things I know don't work yet. But being
able to run some tests will allow multiple people to work on this in parallel.

I added an env var for now to specify the range for regions. We can have a default reserve range
that's very large. This simplies a lot of things. Right now I'm only enabling the feature on 64-bit
because I've only been testing on 64-bit. For 32-bit we would likely still need to have things like grow_brick_card_tables.

Each generation has at least one region; each region can only belong to one generation.

---
Main changes -

+ I'm using the current heap_segment to represent a region instead of doing a ton of renaming
  because each region also needs to keep track of the same allocated/committed/etc. So when
  USE_REGIONS is defined you could think region whenever you see segment. But gen/planned gen
  are now maintained by each region since we no long have a contiguous range for ephemeral gens.
+ Added a simple region allocator that finds free blocks for region alloc requests and coalesce
  adjacent free blocks.
+ Places that need to check for ephemeral generations are changed to check for gen_num/plan_gen_num
  accordingly, eg, gc_mark, mark_through_cards, relocate_address.
+ plan phase is changed quite a bit to accommodate regions, eg, we set each region's plan as
  we've planned them; we need to go through eph regions for allocating survivors, instead of
  detecting crossing gen0/1 boundary by the survivors position relative to their gen start, we
  plan the next generation (if necessary) when we run out of regions of the current generation
  we are going through. This actually avoids some of the complexity with segments.
+ sweep phase is heavily changed since we don't have a gen limit to detect eph gen boundaries
  anymore.
+ Rewrote the code that threads segments together for regions after compact/sweep is done.
+ Changed the SOH allocator to acquire new regions when needed, still maintain ephemeral_heap_segment
  but now it's used to indicate the region we are currently allocating in.
+ Got rid of the following that doesn't apply to regions -
  ephemeral_low/ephemeral_high
  demotion_low/demotion_high
  Some of these were replaced for regions; others haven't been (like ephemeral_low/ephemeral_high)
  which will be done in separate work items.
+ Added some internal stress mechanisms like selectively pinning some objects and creating ro segs
  in GC.
+ I have not changed the write barrier code so for WKS GC cards will be set unconditionally like in
  SVR GC.
+ Changed verify_heap to verify regions.
+ Perf changes, eg, to determine compaction.
+ Some changes for BGC; it's still incomplete but I've changed places where it needs to avoid reading
  into the ephemeral regions for concurrent like BGC revisit/overflow. Overflow can be optimized to
  be per region (this optimization applies to segs as well but more gains with regions).

Some key implementation differences between regions and segments -

+ We no longer have the expand heap code paths which simplies things by a lot.
+ We no longer have a generation start object - each generation has a list of regions that belong to
  that generation. Any empty region can be removed off of this list. This is different from when we
  had a generation start which meant the first segment would never be empty and we don't reuse it for new
  eph seg.
+ With segments in plan phase we may not have allocated gen1/0 start while going through survivors since
  there may not be survivors in gen1/0... with regions it's different because each time I finish a generation
  I will call process_last_np to allocate the new gen. It's more consistent.
+ consing_gen in plan phase really doesn't need to be a generation. With segments it would change that
  generation's alloc seg and we'd switch to gen1 when we need to plan ephemeral generations. But this is
  unnecessary because all we need is the alloc_ptr/limit pair + alloc seg (or alloc region for regions).
  I've made some progress simplying this so this never changes (always the condemned gen) and always
  represents the alloc_ptr/limit/region. We can totally get rid of consing_gen and only maintain those
  3 things.

=======

Other things worth mentioning -

+ I intentionally left quite a bit of logging for the new code. Some can be removed when the code
  is more baked.
+ I have some "REGIONS TODO"s in the code that are things needed to changed about this PR. Of course
  there are many optimizations that will be done - seperated PRs will be submitted for those.

=======

This is the env I used for testing -

complus_gcConcurrent=0
complus_GCLogEnabled=1
complus_GCLogFile=c:\temp\gclog
complus_GCLogFileSize=100
complus_GCName=clrgc.dll
complus_GCRegionsRange=20000000
complus_heapverify=1
complus_StressLog=0

command line I used for GCPerfSim -

-tc 2 -tagb 16 -tlgb 0.05 -lohar 0 -sohsi 10 -lohsi 0 -pohsi 0 -sohpi 0 -lohpi 0 -pohpi 0 -sohfi 0 -lohfi 0 -pohfi 0 -allocType reference -testKind time -printEveryNthIter 300000

-tc 2 -tagb 32 -tlgb 0.05 -lohar 100 -sohsi 10 -lohsi 100 -pohsi 0 -sohpi 0 -lohpi 0 -pohpi 0 -sohfi 0 -lohfi 0 -pohfi 0 -allocType reference -testKind time -printEveryNthIter 300000

3 years agoFix warnings in the code emitted by the wasm pinvoke generator. (#45322)
Zoltan Varga [Fri, 4 Dec 2020 20:16:49 +0000 (15:16 -0500)]
Fix warnings in the code emitted by the wasm pinvoke generator. (#45322)

3 years agoAdd link to active issue attribute on PR guide (#45606)
Santiago Fernandez Madero [Fri, 4 Dec 2020 20:08:35 +0000 (12:08 -0800)]
Add link to active issue attribute on PR guide (#45606)

3 years agoAdd description of AvoidSplittingBackedge branch and link to #40264 (#45609)
Carol Eidt [Fri, 4 Dec 2020 20:05:23 +0000 (12:05 -0800)]
Add description of AvoidSplittingBackedge branch and link to #40264 (#45609)

3 years ago[Mono] Arrays shouldn't implement linked out generic classes (#45125)
Aleksey Kliger (λgeek) [Fri, 4 Dec 2020 19:37:27 +0000 (14:37 -0500)]
[Mono] Arrays shouldn't implement linked out generic classes (#45125)

3 years agoSlight cleanup of host test RepoDirectoriesProvider helper (#45579)
Elinor Fung [Fri, 4 Dec 2020 18:30:03 +0000 (10:30 -0800)]
Slight cleanup of host test RepoDirectoriesProvider helper (#45579)

3 years agoUse NetCoreAppToolCurrent TFM for *AppBuilders (#45591)
Alexander Köplinger [Fri, 4 Dec 2020 17:21:44 +0000 (18:21 +0100)]
Use NetCoreAppToolCurrent TFM for *AppBuilders (#45591)

This ensures they're built against net5.0 right now instead of net6.0.

3 years agoReplace new UTF8Encoding(false) (#45541)
Next Turn [Fri, 4 Dec 2020 16:11:24 +0000 (00:11 +0800)]
Replace new UTF8Encoding(false) (#45541)

* Replace new UTF8Encoding(false)

* Remove static field

3 years agoRemove unnecessary IsStatic checks in ActivatorUtilities (#45439)
Eric Erhardt [Fri, 4 Dec 2020 16:06:17 +0000 (10:06 -0600)]
Remove unnecessary IsStatic checks in ActivatorUtilities (#45439)

3 years agoFix resolve root IServiceProvider (#45171)
Vadim Galaktionov [Fri, 4 Dec 2020 13:04:46 +0000 (16:04 +0300)]
Fix resolve root IServiceProvider (#45171)

3 years agoBreaking change: Throw when resolving on a disposed service provider (#45116)
Maryam Ariyan [Fri, 4 Dec 2020 13:01:36 +0000 (05:01 -0800)]
Breaking change: Throw when resolving on a disposed service provider (#45116)

3 years agoAdd documentation on how to disable runtime tests (#45578)
Juan Hoyos [Fri, 4 Dec 2020 05:18:02 +0000 (21:18 -0800)]
Add documentation on how to disable runtime tests (#45578)

* Update pr-guide.md

Co-authored-by: Jan Kotas <jkotas@microsoft.com>
3 years agoReturn the result of PAL_InjectActivation in Thread::InjectGcSuspension (#44731)
Ilia [Fri, 4 Dec 2020 04:50:12 +0000 (07:50 +0300)]
Return the result of PAL_InjectActivation in Thread::InjectGcSuspension (#44731)

3 years agoDocument Compilation Options and Compilation Metadata References CDIs (#37605)
Tomáš Matoušek [Fri, 4 Dec 2020 04:46:50 +0000 (20:46 -0800)]
Document Compilation Options and Compilation Metadata References CDIs (#37605)

3 years agoAdd Tuple-based Math.DivRem overloads (#45074)
Egor Bogatov [Fri, 4 Dec 2020 04:39:33 +0000 (07:39 +0300)]
Add Tuple-based Math.DivRem overloads (#45074)

* Add Tuple-based Math.DivRem overloads

* Remove internal versions of Math.DivRem

* Add AggressiveInlining

* Add comments

Co-authored-by: Stephen Toub <stoub@microsoft.com>
3 years agoFix location of JIT-EE version GUID (#45574)
Bruce Forstall [Fri, 4 Dec 2020 04:34:36 +0000 (20:34 -0800)]
Fix location of JIT-EE version GUID (#45574)

With #45044 it moved from corinfo.h to jiteeversionguid.h

3 years agoUpdate UnmanagedCallersOnly tests to not emit IL (#45572)
Jeremy Koritzinsky [Fri, 4 Dec 2020 04:16:27 +0000 (20:16 -0800)]
Update UnmanagedCallersOnly tests to not emit IL (#45572)

* Update UnmanagedCallersOnly tests to emit IL only when needed.

* Move last test into IL and delete test that uses invalid IL that only RefEmit can handle.

3 years agoMake BinderEventListener not listen to TplEventSource (#45570)
Sung Yoon Whang [Fri, 4 Dec 2020 03:59:57 +0000 (19:59 -0800)]
Make BinderEventListener not listen to TplEventSource (#45570)

* Make BinderEventListener not listen to TplEventSource

* Remove TasksFlowActivityIds definition

Co-authored-by: Juan Hoyos <juan.hoyos@microsoft.com>
3 years agoXmlSerializer.Serialize doesn't work when using TrimMode=link (#44772)
Eric Erhardt [Fri, 4 Dec 2020 02:14:14 +0000 (20:14 -0600)]
XmlSerializer.Serialize doesn't work when using TrimMode=link (#44772)

* XmlSerializer.Serialize doesn't work when using TrimMode=link

Make XmlSerializer work correctly with ILLinker trimming.

1. Use constant BindingFlags to work around https://github.com/mono/linker/issues/1617
2. Annotate CodeGenerator.CreateTypeBuilder correctly to preserve base class members

Fix #41389

* Update ILLinker suppressions file.

* PR feedback.

Fix ILLinker suppresions.

3 years agoSuperPMI collection pipeline: fix location of JIT-EE version GUID (#45576)
Bruce Forstall [Fri, 4 Dec 2020 01:16:10 +0000 (17:16 -0800)]
SuperPMI collection pipeline: fix location of JIT-EE version GUID (#45576)

With #45044 it moved from corinfo.h to jiteeversionguid.h

3 years agoVarious fixes in Microsoft.NETCore.App packs (#45566)
Jeremy Koritzinsky [Fri, 4 Dec 2020 00:06:23 +0000 (16:06 -0800)]
Various fixes in Microsoft.NETCore.App packs (#45566)

3 years agoUpgrade StyleCopAnalyzers to v1.2.0-beta.261 (#45562)
xtqqczze [Fri, 4 Dec 2020 00:02:32 +0000 (00:02 +0000)]
Upgrade StyleCopAnalyzers to v1.2.0-beta.261 (#45562)

* Upgrade StyleCopAnalyzers to v1.2.0-beta.261

https://github.com/DotNetAnalyzers/StyleCopAnalyzers/releases/tag/1.2.0-beta.261

* Disable SA1142

* Enable SA1142 except in tests

3 years agoFix dependency for test assets on musl test runs (#45567)
Santiago Fernandez Madero [Thu, 3 Dec 2020 23:02:21 +0000 (15:02 -0800)]
Fix dependency for test assets on musl test runs (#45567)

* Fix dependency for test assets on musl test runs

* Use testOsSubGroup on dependency

3 years agoDisable Long Running JSON tests on Checked CoreCLR (#45505)
Santiago Fernandez Madero [Thu, 3 Dec 2020 22:39:39 +0000 (14:39 -0800)]
Disable Long Running JSON tests on Checked CoreCLR (#45505)

* Disable Long Running JSON tests on Checked CoreCLR

* PR Feedback

3 years agoDon't emit type fixups for primitive types in Crossgen2 (#45555)
Jan Vorlicek [Thu, 3 Dec 2020 21:34:47 +0000 (22:34 +0100)]
Don't emit type fixups for primitive types in Crossgen2 (#45555)

We were emitting fixups for primitive types like bool, void, etc. These
are not necessary as all of these types are always loaded and so it was
just a waste of R2R file space.

This change blocks generating fixups for those.

3 years agoRemoved Serialization tests for SQLClient types (#42016)
Yujin Lee [Thu, 3 Dec 2020 21:16:16 +0000 (06:16 +0900)]
Removed Serialization tests for SQLClient types (#42016)

* Remove Serialization tests for SQLClient types

* Deleted reference to System.Data.SqlClient

Co-authored-by: Jan Kotas <jkotas@microsoft.com>
3 years agoFix covariant returns with generic return types (#45275)
Jan Vorlicek [Thu, 3 Dec 2020 20:38:32 +0000 (21:38 +0100)]
Fix covariant returns with generic return types (#45275)

* Fix covariant returns with generic return types

When a covariant return type was an uninstantiated generic type, the
ClassLoader::IsCompatibleWith was not working properly. In debug builds,
it was asserting because there was no MethodTable for that type and in
release builds, it resulted in ExecutionEngineException or an internal
CLR error.

This change fixes it by using TypeHandle::CanCastTo instead of
MethodTable::CanCastTo and adds a regression test for two cases where
the problem was observed (Assembly.GetTypes() and creating an instance
of a type with a covariant return with a problematic kind of type).

* Fix issue 45082 too

There were two issues. First, the
ClassLoader::ValidateMethodsWithCovariantReturnTypes was called before
typeHnd.DoFullyLoad and that resulted in an assert down the call chain
of TypeDesc::CanCastTo due to a wrong load level.
Second, the SigTypeContext generation for the current MD in the
ClassLoader::ValidateMethodsWithCovariantReturnTypes requires the same
change for class instantiation as the one that we had for the parent MD.

* Fix the issue 45082 in a correct way

The call to ClassLoader::ValidateMethodsWithCovariantReturnTypes is now
in MethodTable::DoFullyLoad.
I have also added a test case that verifies a case that David Wrighton
has suggested offline, where there are 3 types... A, B and C.
C derives from B which derives from A. B has a bad override which
should produce an error.  Then, cause C to be fully loaded without
otherwise triggering a load of B.

3 years agoRemove FEATURE_COMPILED_XSL define (#45553)
Eric Erhardt [Thu, 3 Dec 2020 20:34:52 +0000 (14:34 -0600)]
Remove FEATURE_COMPILED_XSL define (#45553)

* Remove FEATURE_COMPILED_XSL define

This is always defined, so there is no need in this define. In the past, it was not defined for UAP builds.

* Remove unused resource

3 years agoMove return buffer handling from interop to the JIT (#39294)
Jeremy Koritzinsky [Thu, 3 Dec 2020 19:58:19 +0000 (11:58 -0800)]
Move return buffer handling from interop to the JIT (#39294)

Co-authored-by: Jan Kotas <jkotas@microsoft.com>
Co-authored-by: Carol Eidt <carol.eidt@microsoft.com>
Co-authored-by: Sergey Andreenko <seandree@microsoft.com>
Co-authored-by: Andy Ayers <andya@microsoft.com>
3 years agoUpdate first-class-structs.md (#45512)
Carol Eidt [Thu, 3 Dec 2020 19:15:40 +0000 (11:15 -0800)]
Update first-class-structs.md (#45512)

* Update first-class-structs.md

* Address feedback and add links to x64 vector ABI branches

3 years agoAdds support for testing tvOS (#45043)
Steve Pfister [Thu, 3 Dec 2020 18:29:31 +0000 (13:29 -0500)]
Adds support for testing tvOS (#45043)

XHarness already supports tvOS as a target, so this change supplies the right info

Co-authored-by: Steve Pfister <steve.pfister@microsoft.com>
3 years ago[master] Update dependencies from dotnet/xharness dotnet/runtime-assets dotnet/arcade...
dotnet-maestro[bot] [Thu, 3 Dec 2020 16:39:12 +0000 (16:39 +0000)]
[master] Update dependencies from dotnet/xharness dotnet/runtime-assets dotnet/arcade (#45487)

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

3 years agoCorrectly apply EventSourceSupport feature switch to NativeRuntimeEventSource (#43602)
Vitek Karas [Thu, 3 Dec 2020 15:21:22 +0000 (07:21 -0800)]
Correctly apply EventSourceSupport feature switch to NativeRuntimeEventSource (#43602)

`NativeRuntimeEventSource.Process` is called from native code in CoreCLR and as such is rooted in the descriptor. But if event source is disabled via feature switch it should not do anything.

3 years ago[runtime] Avoid checking for hardened runtime on ios, its not needed, and it causes...
monojenkins [Thu, 3 Dec 2020 13:05:25 +0000 (08:05 -0500)]
[runtime] Avoid checking for hardened runtime on ios, its not needed, and it causes alerts because of PROT_WRITE|PROT_EXEC. (#45514)

Co-authored-by: vargaz <vargaz@users.noreply.github.com>
3 years agoFix issue 45091 (#45409)
Peter Sollich [Thu, 3 Dec 2020 08:25:08 +0000 (09:25 +0100)]
Fix issue 45091 (#45409)

Fix overeager call to Validate() - we should call this with a bDeep parameter of FALSE, because the pointers to other objects may not be valid yet, if these other objects have not yet been copied.

Note this issue will only repro if HEAPVERIFY_GC is on - otherwise we won't attempt to verify pointers to other objects.

3 years agoTemporarily disable Mono Desktop Windows Release x64 (#45529)
Juan Hoyos [Thu, 3 Dec 2020 07:45:00 +0000 (23:45 -0800)]
Temporarily disable Mono Desktop Windows Release x64 (#45529)

3 years agoDisableFileSystemWatcherTest (#45511)
Santiago Fernandez Madero [Thu, 3 Dec 2020 05:52:07 +0000 (21:52 -0800)]
DisableFileSystemWatcherTest (#45511)

3 years agoRemove ActivatorUtilities_In_DependencyInjection #define
Eric Erhardt [Tue, 1 Dec 2020 22:28:36 +0000 (16:28 -0600)]
Remove ActivatorUtilities_In_DependencyInjection #define

3 years agoMove ActivatorUtilities from the Common directory to DI.Abstractions
Eric Erhardt [Tue, 1 Dec 2020 22:11:52 +0000 (16:11 -0600)]
Move ActivatorUtilities from the Common directory to DI.Abstractions

This is the only project in the repo that uses this file. There's no reason for it to be in the Common directory.

3 years agoFix continue on error conditions (#45519)
Santiago Fernandez Madero [Thu, 3 Dec 2020 02:33:11 +0000 (18:33 -0800)]
Fix continue on error conditions (#45519)

3 years agofix invalid IL in profiler stub helper (#45453)
David Mason [Thu, 3 Dec 2020 02:17:04 +0000 (18:17 -0800)]
fix invalid IL in profiler stub helper (#45453)

3 years agoFixes paths (#45392)
Andrew Au [Thu, 3 Dec 2020 01:59:50 +0000 (17:59 -0800)]
Fixes paths (#45392)

3 years agoFix IID for System.Runtime.InteropServices.ComTypes.IEnumSTATDATA (#45498)
Elinor Fung [Thu, 3 Dec 2020 01:33:19 +0000 (17:33 -0800)]
Fix IID for System.Runtime.InteropServices.ComTypes.IEnumSTATDATA (#45498)

3 years agoDelete unnecessary GetNativeHandle methods on reflection types (#45489)
Jan Kotas [Thu, 3 Dec 2020 01:32:14 +0000 (17:32 -0800)]
Delete unnecessary GetNativeHandle methods on reflection types (#45489)

They just return "this" for the most part

3 years agoWinHttpHandler: fix double -> uint conversions for ARM64 (#45480)
Anton Firszov [Thu, 3 Dec 2020 00:41:21 +0000 (01:41 +0100)]
WinHttpHandler: fix double -> uint conversions for ARM64 (#45480)

* extend ReceiveDataTimeout functional coverage

* fix double -> uint conversions

* more comments + remove 'unchecked'

* Comment suggestion

Co-authored-by: Jan Kotas <jkotas@microsoft.com>
* Comment suggestion

Co-authored-by: Jan Kotas <jkotas@microsoft.com>
Co-authored-by: Jan Kotas <jkotas@microsoft.com>
3 years agoRemove an erroneous assert (#45495)
Andrew Au [Wed, 2 Dec 2020 23:45:17 +0000 (15:45 -0800)]
Remove an erroneous assert (#45495)

3 years agoRedirect default install location in test to avoid using machine-wide install (#45500)
Elinor Fung [Wed, 2 Dec 2020 22:30:57 +0000 (14:30 -0800)]
Redirect default install location in test to avoid using machine-wide install (#45500)

3 years agodisable restore in vs for projects targeting platform specific old frameworks (#44932)
Anirudh Agnihotry [Wed, 2 Dec 2020 22:18:52 +0000 (14:18 -0800)]
disable restore in vs for projects targeting platform specific old frameworks (#44932)

* disable vs restore in vs for projects targeting platform specific older frameworks

* Add infra to auto-update solution files for restore

* Add NuGet.config files for solutions affected by restore issue

Co-authored-by: Viktor Hofer <viktor.hofer@microsoft.com>
3 years agoFix break in send-to-helix-inner.yml (#45502)
Santiago Fernandez Madero [Wed, 2 Dec 2020 21:28:52 +0000 (13:28 -0800)]
Fix break in send-to-helix-inner.yml (#45502)

3 years agoUse the updated URL for FabricBot (#45499)
Jeff Handley [Wed, 2 Dec 2020 20:43:50 +0000 (12:43 -0800)]
Use the updated URL for FabricBot (#45499)

And fix a couple of formatting nits while editing (removing commas between owners, and aligning table spacing)

3 years agoFix Write_DataReadFromDesiredOffset test (#45477)
Stephen Toub [Wed, 2 Dec 2020 19:04:16 +0000 (14:04 -0500)]
Fix Write_DataReadFromDesiredOffset test (#45477)

(Already failing on my goal not to submit PRs while on vacation, but I wanted to help squash this test failure taking out multiple PRs.)

Sporadic null reference exceptions were occurring in CI as part of GZipStream.Dispose.  The call to writeable.Dispose in the writing task can race with the invisible writeable.Dispose that happens as part of the disposal at the end of the block, due to the earlier using statement.  If the writeable.Dispose in the task nulls out the _deflateStream inside of the GZipStream after the implicit Dispose has checked for null but before it calls Dispose on the field, it'll null ref.  The fix is simple and something that should have been there anyway: explicitly wait for the writing task to complete, which guarantees the implicit disposal won't race with the explicit one.

3 years agoIncrease Mac outerloop timeout for AzDO job (#45490)
Matt Galbraith [Wed, 2 Dec 2020 18:54:51 +0000 (10:54 -0800)]
Increase Mac outerloop timeout for AzDO job (#45490)

As seen in https://dnceng.visualstudio.com/public/_build/results?buildId=905703&view=logs&j=8580ecfb-912a-5dbd-35ce-e64d0d51ddbf, OSX test runs can get cancelled as little as 12 minutes before they would have finished (timed out job in question started at 2020-12-02 13:38:06.9640000, finished  2020-12-02 14:59:19.2760000, but the job was cancelled at 2020-12-02T14:48:29.3981590Z.

3 years agoA small jit changes for Arm64 apple. (#45461)
Sergey Andreenko [Wed, 2 Dec 2020 18:38:25 +0000 (10:38 -0800)]
A small jit changes for Arm64 apple. (#45461)

* Expand the test.

* The jit change that slipped in branches and merges.

3 years agoAdd OSX arm64 jit. (#45467)
Sergey Andreenko [Wed, 2 Dec 2020 18:24:15 +0000 (10:24 -0800)]
Add OSX arm64 jit. (#45467)

* CMake changes.

* use unix_osx.

3 years agoUse jit interface thunkgen tech for more files (#45044)
David Wrighton [Wed, 2 Dec 2020 18:02:32 +0000 (10:02 -0800)]
Use jit interface thunkgen tech for more files (#45044)

- Reduce the boilerplate logic when modifying the jit ee interface
 - 3 new files in superpmi are now autogenerated as well as 2 files in the jit directory are now autogenerated
- Reduce to only having one copy of the jit-ee interface guid

3 years agoRemove ResolveXHandle indirections (#45292)
Ben Adams [Wed, 2 Dec 2020 17:25:27 +0000 (17:25 +0000)]
Remove ResolveXHandle indirections (#45292)

* Remove internal redirection for RuntimeTypeHandle

* Remove internal redirection for RuntimeFieldHandle

* Remove internal redirection for RuntimeMethodHandle

* Add null token tests

Co-authored-by: Jan Kotas <jkotas@microsoft.com>
3 years agoReduce CacheEntry size (#45410)
Adam Sitnik [Wed, 2 Dec 2020 17:04:26 +0000 (18:04 +0100)]
Reduce CacheEntry size (#45410)

* replace 3 boolean fields with one enum flag field

* use auto property for AbsoluteExpiration

* simplify the code by using expression bodies

* don't use internal fields of CacheEntry, the public properties are enough

* expose private methods of MemoryCache and replace the usage of delegates with dependency to MemoryCache

2 fields less for MemoryCache and three for every CacheEntry

3 years agoFix the EH-write thru scenario (#45248)
Kunal Pathak [Wed, 2 Dec 2020 16:53:37 +0000 (08:53 -0800)]
Fix the EH-write thru scenario (#45248)

* Fix the EH-write thru

* Fix condition for BBJ_THROW

* Proper fix

3 years agoFix deadlock in TestEventListener and re-enable ArrayPool DiagnosticEvent tests ...
Sung Yoon Whang [Wed, 2 Dec 2020 16:31:21 +0000 (08:31 -0800)]
Fix deadlock in TestEventListener and re-enable ArrayPool DiagnosticEvent tests (#45469)

* fix deadlock in TestEventListener

* re-enable disabled test

* Apply suggestions from code review

Co-authored-by: Stephen Toub <stoub@microsoft.com>
3 years agoBump timeout for iOS CI jobs (#45484)
Alexander Köplinger [Wed, 2 Dec 2020 16:02:07 +0000 (17:02 +0100)]
Bump timeout for iOS CI jobs (#45484)

We've sometimes seen the job timeout on AzDO because the Helix queue got a little busy, bump the timeout to give it more breathing room.

3 years agoUpdates the RID graph to include Android 30 (#45442)
Steve Pfister [Wed, 2 Dec 2020 15:21:55 +0000 (10:21 -0500)]
Updates the RID graph to include Android 30 (#45442)

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

3 years agoAdd Mono Windows x86 builds (#45434)
Alexander Köplinger [Wed, 2 Dec 2020 15:07:52 +0000 (16:07 +0100)]
Add Mono Windows x86 builds (#45434)

Also contains initial work to support arm/arm64 builds but those don't build yet.

3 years agoUpdate dependencies from https://github.com/dotnet/xharness build 20201201.1 (#45476)
dotnet-maestro[bot] [Wed, 2 Dec 2020 14:28:53 +0000 (14:28 +0000)]
Update dependencies from https://github.com/dotnet/xharness build 20201201.1 (#45476)

[master] Update dependencies from dotnet/xharness

3 years agoFix for R2RDumpTests nullref in composite mode (#45447)
Tomáš Rylek [Wed, 2 Dec 2020 12:44:57 +0000 (13:44 +0100)]
Fix for R2RDumpTests nullref in composite mode (#45447)

My original conjecture that the R2RDumpTests nullref crash in CG2
composite pipeline had the same cause as the libraries test
failures spotted over the weekend seems wrong. The R2RDumpTests
crash is a plain initialization issue:

In composite mode, native code for the entire framework gets
emitted into the special composite native image (CoreCLR test
scripting uses the name framework-r2r.dll for this image); the
individual component assemblies including SPC only act as holders
for the MSIL and forwarders to the native image.

For this reason, running R2RDumpTests to dump SPC in composite mode
yielded a library with zero native methods; thus we never entered
the conditional clause in EnsureMethods and _methods remained null.
I have reformulated the code by centralizing initialization of
both _instanceMethods and _methods in EnsureMethods.

Thanks

Tomas

3 years agoRemoved thread-safety from SequenceReader (#45437)
Günther Foidl [Wed, 2 Dec 2020 09:20:48 +0000 (10:20 +0100)]
Removed thread-safety from SequenceReader (#45437)

As it's a ref-struct and thus stack-only there's no need to have any guarantees for thread-safety and atomicity.

3 years agoChange AssemblyName formatting not to require static table of KVPs (#45418)
Marek Safar [Wed, 2 Dec 2020 08:41:45 +0000 (09:41 +0100)]
Change AssemblyName formatting not to require static table of KVPs (#45418)

* Change AssemblyName formatting not to require static table of KVPs
to do loop with span operations to replace single characters

Expanded test coverage to actually cover this odd behaviour

Realign the implementation with original code at
https://github.com/dotnet/runtime/blob/master/src/coreclr/src/binder/textualidentityparser.cpp#L690

3 years agoFix conditions to include suceeded on send to helix inner (#45432)
Santiago Fernandez Madero [Wed, 2 Dec 2020 07:17:54 +0000 (23:17 -0800)]
Fix conditions to include suceeded on send to helix inner (#45432)

* Fix conditions to include suceeded on send to helix inner

* Fix yaml syntax

3 years agoDisable DiagnosticEvent tests in arraypool (#45451)
Santiago Fernandez Madero [Wed, 2 Dec 2020 07:16:51 +0000 (23:16 -0800)]
Disable DiagnosticEvent tests in arraypool (#45451)

3 years ago[master] Update dependencies from mono/linker (#45108)
dotnet-maestro[bot] [Wed, 2 Dec 2020 03:12:57 +0000 (04:12 +0100)]
[master] Update dependencies from mono/linker (#45108)

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

Microsoft.NET.ILLink.Tasks
 From Version 6.0.0-alpha.1.20561.1 -> To Version 6.0.0-alpha.1.20566.3

* Update tools to 5.0 RTM which is now required by illinker

The update was forced for linker because of https://github.com/dotnet/arcade/pull/6547 automatic distribution. The same change were suppose to land in dotnet/runtime in https://github.com/dotnet/runtime/pull/44835 but was reverted with no explanation in https://github.com/dotnet/runtime/pull/44835/commits/6b863052d7ccae09bc0dd50755414efe29c04805

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

Microsoft.NET.ILLink.Tasks
 From Version 6.0.0-alpha.1.20561.1 -> To Version 6.0.0-alpha.1.20580.1

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

Microsoft.NET.ILLink.Tasks
 From Version 6.0.0-alpha.1.20561.1 -> To Version 6.0.0-alpha.1.20580.2

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

Microsoft.NET.ILLink.Tasks
 From Version 6.0.0-alpha.1.20561.1 -> To Version 6.0.0-alpha.1.20580.3

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

Microsoft.NET.ILLink.Tasks
 From Version 6.0.0-alpha.1.20561.1 -> To Version 6.0.0-alpha.1.20580.4

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

Microsoft.NET.ILLink.Tasks
 From Version 6.0.0-alpha.1.20561.1 -> To Version 6.0.0-alpha.1.20580.5

* Revert "Update tools to 5.0 RTM which is now required by illinker"

This reverts commit 9532380dd2ee77bf50c3834eb798d68447c97d85.

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

Microsoft.NET.ILLink.Tasks
 From Version 6.0.0-alpha.1.20561.1 -> To Version 6.0.0-alpha.1.20601.1

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: Marek Safar <marek.safar@gmail.com>
3 years agoRemove ZipDownloadDisable for azdo artifacts download (#45427)
Santiago Fernandez Madero [Wed, 2 Dec 2020 02:10:22 +0000 (18:10 -0800)]
Remove ZipDownloadDisable for azdo artifacts download (#45427)

3 years ago[wasm] remove compile timezone data task (#45443)
Tammy Qiu [Wed, 2 Dec 2020 01:02:04 +0000 (20:02 -0500)]
[wasm] remove compile timezone data task (#45443)

* [wasm] remove compile timezone data task

* Bump runtime-assets dependency

* Fix merge conflict

Co-authored-by: Alexander Köplinger <alex.koeplinger@outlook.com>