Commit Graph
113609 Commits
Author SHA1 Message Date
Tomas Rylek df734cf00f Fix dependency of GenerateLayout on RestorePackages
Parker Bibus pinged me earlier today to report a bug caused by my
test cleanup - using generatelayoutonly without previously
building the managed tests ends up failing the build due to
unrestored packages. This was due to the fact that I overlooked
that CopyDependenciesToCoreRoot needs the support projects to be
restored; in usual scenarios, they usually got restored as part
of another build step like managed test build so that I didn't hit
that in my local and lab testing.

Thanks

Tomas
2021-10-07 21:01:01 +02:00
SingleAccretion b36548cae1 Make field nodes unary (#60105)
* Make GenTreeField a unary op

There is no reason for it to be a GTK_SPECIAL op, a concept that
is needed only for nodes with special operand iteration semantics.

There is a quirk in this change, in gtCloneExpr, it is needed to
make this commit a zero-diff one (which it is).

* Remove the quirk

The old implementation of cloning for fields had
an interesting hidden pessimization in it: it set
GTF_GLOB_REF unnecessarily on the cloned tree, even
if the original tree did not have the flag.

This was because "gtNewFldRef", when passed "nullptr"
for the "FldObj", added the aforementioned GTF_GLOB_REF
to the node, presuming it was a static field access.

But we do not need to do that, and this commits removes
the quirk, getting some good diffs in the process.
2021-10-07 10:47:07 -07:00
SingleAccretion 23e386f5b3 Remove dead code (#60095)
* Remove dead code

 - Delete unused GTF_NOP_DEATH.
 - Delete dead code handling GT_INDEX_ADDR as a
   GTK_SPECIAL node, it has always been GTK_BINOP.
 - Remove the unused Compiler* parameter from GenTreeQmark's constructor.
 - Remove the unused Compiler* parameter from LIR::Use::ReplaceWith,
   ever so slightly improving its performance.

There are a handful of expected diffs with this change,
they are due to proper costing for INDEX_ADDR causing
fgMorphArgs to make slightly different decisions.

* Use more strong typing in GenTreeQmark

* Call the base constructor

MSVC apparently does not detect this :(.
2021-10-07 10:33:12 -07:00
Kunal Pathak 4eb8d0ebec Fix an assert condition for UpperVectorSave/Restore (#60108)
* expand assert to take save upper vector in account

* jit format
2021-10-07 10:31:38 -07:00
Maryam Ariyan 00fcaa169d Regression Fix - Set the app name via an argument (#60053) 2021-10-07 09:49:30 -07:00
Marie Píchová 701c0422f0 [HTTP/3] Set EOF for 0-length response payload (#60120) 2021-10-07 17:43:45 +02:00
Robin Lindner 6195d98cad Optimize code readability by replacing ternary operator with logical or construct (#60071) 2021-10-07 09:14:03 -06:00
Tomáš Rylek 5ba59174ab Merge src/tests/run.proj into src/tests/build.proj (#60098)
* Merge src/tests/run.proj into src/tests/build.proj

In my previous change I modified the test-related scripts to always
use build.proj as the "front-end", the run.proj became something
like a targets file just used internally by build.proj. As both
MSBuild scripts are rather short and the boundary between test
building and running is rather blurred, I propose merging their
contents into the build.proj script and removing the run.proj
script to simplify developer navigation around the multitude of
test-related scripts.

Based on PR feedback I separated out those parts of the build
script that deal with emission of the XUnit wrappers to a separate
targets file "xunit-wrappers.targets". The expectation is that this
file can be removed once we refactor the XUnit wrapper logic
to more dynamic test grouping.

Thanks

Tomas

* Remove XML metadata per Santi's PR feedback

* Separate out xunit wrapper emitter into a new script

* Move the target CreateAllWrappers to xunit-wrappers.targers per Santi's PR feedback
2021-10-07 12:52:48 +02:00
Tomáš Rylek 9e9001812a Add R2RTest support for the perfmap-format-version Crossgen2 option (#60002) 2021-10-07 12:50:49 +02:00
Krzysztof Wicher fc20fc770d Do not check options values if options haven't been initialized in BindingDoesNotThrowIfReloadedDuringBinding test (#60062) 2021-10-07 11:27:16 +02:00
yowl 45fe1dece9 add PreciseRefCountsRequierd to better describe the intention (#60027)
The condition is different in NativeAOT, so this helps downstream.
2021-10-07 10:58:37 +02:00
Jakob Botsch Nielsen 367b006530 Support fast tailcalls in R2R (#56669)
* Support fast tailcalls in R2R

Partially addresses #5857

* Support ARM64

* Run jit-format

* Fix non-R2R ARM build

* Fix recursive-call-to-loop optimization with non-standard args

* Implement new delay load helper for fast tailcalls

* Minor changes and fix build break

* Switch to a define for tailcall register

* Fix x86

* Implement DefType.IsUnsafeValueType

* Emit rex.jmp for tailcall jumps on x64

* Refactor non standard args + refix recursive tailcall opt

* Set nonStandardArgKind for stack args also

* Regenerate JIT interface

* Improve recursion-to-loop decision about which args need to be reassigned

* Use INS_tail_i_jmp for func token indir

* More efficient arm64 VSD fast tailcalls, fix some bad merging

Also fix logic since we removed tailcall register. For ARM64 that means
we now use the single temp reg that is available for R2R/VSD calls, and
in LSRA we ensure this goes into a volatile register.

* Take R2R indirection into account for tail call profitability

On x64 an R2R indirected direct call normally disassembles the call site
to determine the indirection cell, so it is more expensive to do tail
calls in this scenario as the indirection cell needs to be passed in a
register. Take this into account: if there is no tail. prefix, do normal
calls, and otherwise use tail calls.

* Disallow tailcalls via JIT helper in R2R builds

* Revert "Take R2R indirection into account for tail call profitability"

This reverts commit 863ad4d344bcdacebb00c8c921c7345fd63c7d7b.

Let's not divert on the behavior here. It is not clear that having a
smaller call site is better than tail calling albeit with a larger call
site.

* Add SPMI support, clean up mcPackets enum

* Take necessary conditions into account in canTailCall

Do not do implicit tailcalls when
* The caller is the entry point
* The caller is marked NoInline
* The callee requires security object
2021-10-07 10:15:59 +02:00
Jakob Botsch Nielsen a258c4fe6b Fix benign assert in gtNewTempAssign (#59991)
The later part of this method correctly handles the GT_COMMA case, so we
just need to fix the assert.

Fix #59871
2021-10-07 10:15:11 +02:00
Zoltan Varga 36229d9d3a [mono][jit] Fix a JIT assert. (#59861)
Fixes https://github.com/dotnet/runtime/issues/57560.
2021-10-07 08:38:52 +02:00
Bruce Forstall fd69468ca7 Change loop cloning conditions codegen (#59886)
Add an option, statically determined at compile time,
to generate loop cloning loop choice conditions into one block
per condition instead of using bitwise `and` operators that
execute all non-dependent conditions in a single block. Set the
condition to use the one-block-per-condition mode.

This leads to code size reduction in the generated condition code,
generally performance improvements in the microbenchmarks,
as well as making it easier to understand.
2021-10-06 22:26:48 -07:00
Bruce Forstall f21a3155c2 Switch Windows Checked build to -O2 from -O1 (#59235)
That is, optimize for speed, not for size.

Don't do this for Windows x86, due to
https://github.com/dotnet/runtime/issues/59845
2021-10-06 22:15:14 -07:00
David Mason 240a64d14c Change profilers to use thread local evacuation counters (#59741)
* Change profilers to use thread local evacuation counters

Change to prefix increment

* get rid of lambdas

* Fix jit inlining, fix R2R too

* Remove VolatilePtr<> from helpers

* Get rid of additionalData argument
2021-10-06 19:59:43 -07:00
Eric Erhardt 42a68e3303 Remove SkipOn NetFramework attributes in System.Reflection.Emit tests (#60103)
These tests are not run on netfx, so these attributes are just clutter.
2021-10-06 20:50:02 -06:00
Jeremy Koritzinsky fb8dde4af7 Don't create a symbols archive in a PGO build. (#60096) 2021-10-06 17:36:20 -07:00
Vladimir Sadovandvitek-karas bbc898f3e5 Override corehost_resolve_component_dependencies and corehost_set_error_writer PInvokes in singlefile scenario. (#60046)
* Override `corehost_resolve_component_dependencies` and `corehost_set_error_writer` PInvokes in singlefile scenario.

* fix for GCC

* Fixes the test failures when hostpolicy is used at runtime.

Co-authored-by: vitek-karas <[email protected]>
2021-10-06 16:52:40 -07:00
Aaron Kunkle d2a05e3429 Fix performance-setup Function Definitions (#60102)
* Fix function definitions
2021-10-06 16:01:03 -07:00
Aleksey Kliger (λgeek) b393a43a62 [mono] Implement coreclr_create_delegate and move ComponentActivator to shared CoreLib (#59962)
* [CoreLib] Move ComponentActivator to the shared area

* [mono] Implement coreclr_create_delegate hosting API

   Related to https://github.com/dotnet/runtime/issues/59815

* Mark IsolatedComponentLoadContext as unsupported on mobile and browser

   Should make ComponentActivator work without them (depends on AssemblyDependencyResolver, which depends on hostpolicy or hostpolicy pinvoke redirects)

* Also unsupported on MacCatalyst
2021-10-06 18:52:26 -04:00
Larry Ewing 74ba1330fa [workloads] Use the dual signed wix version for workload msis (#59500)
* Use the dual signed wix version for workload msis

* Update signed wix version to 1.0.0-v3.14.0.5722
2021-10-06 17:23:08 -05:00
Maksym Koshovyi 1f555b256e [Group 2] Enable nullable annotations for Microsoft.Extensions.Configuration.Abstractions (#57401)
* Annotate src

* Annotate ref

* Fix FakeConfigurationProvider

* Don't use using in ref

* DisableImplicitAssemblyReferences

* Update ConfigurationExtensions.cs

* TryGet can return null

* Remove not used namespace
2021-10-06 16:18:05 -05:00
Maksym Koshovyi 1c30027a9d [Group 1] Enable nullable annotations for Microsoft.Extensions.FileSystemGlobbing (#57398)
* Annotate src

* Annotate ref

* Null check for directoryInfo

* Nullcheck for PatternMatchingResult.Files

* ParentDirectory cannot be null

! need to be addressed

* Update PatternBuilder.cs

* Use expression body in segments

* Update ref

* DisableImplicitAssemblyReferences

* Fix doc

* TestMatchingGroup nonnull

* ParentDirectory can be null

* Update TestGetHashCodeWithNull

* Update FilePatternMatchTests.cs

* Update FilePatternMatchTests.cs

* Remove TestGetHashCodeWithNull

* InMemoryFileInfo.ParentDirectory is not null
2021-10-06 15:56:06 -05:00
Tomáš Rylek be918580c7 Cleanup of runtime test build scripts (#58762)
This change moves most test build logic from the scripts src/tests/build.cmd and src/tests/build.sh into the common MSBuild script src/tests/build.proj; the scripts stay in place but now they only deal with parsing the command-line parameters and building native test components, all remaining functionality is delegated to the common project.

Thanks

Tomas
2021-10-06 21:04:27 +02:00
Thays Grazia 05345b2a78 [wasm][debugger] Fix debug compilation using cmake (#60029)
* Fix debug compilation.

* changing how to pass the compiler flags
2021-10-06 14:48:08 -03:00
Ulrich Weigand e645b5190c [mono] Fix libcoreclr.so build incompatibilities on Linux (#59988)
* Link with -z relro -z now to enable full RELRO mode
  Fixes https://github.com/dotnet/runtime/issues/59904

* Generate and link in version.c to provide version string
  Fixes https://github.com/dotnet/source-build/issues/2484
2021-10-06 18:57:06 +02:00
Aaron Kunkle a442df07a5 Fix errors from earlier performance-setup PR (#60073) 2021-10-06 09:51:51 -07:00
Parker Bibus b3f21a045f Updated channel passed to ci_setup in the performance-setup.sh file. (#60034)
* Updated channel passed to ci_setup in the performance-setup.sh file.

* Removed spaces from assignments so they are seen as actual variabls, and tested locally.
2021-10-06 09:50:38 -07:00
Bruce Forstall 3e79767855 Fix win-x64 outgoing argument size calculation for PInvoke prolog helper (#60050)
The win-x64 ABI requires allocating 32 bytes of outgoing argument
stack space for every call, which can be used by callees. In the case
where there are no calls in a function, there is no need to allocate
that space. The JIT computes the required argument space during
`fgSimpleLowering` by processing the IR and looking for call instructions,
but also accounting for a few special cases where calls are not visible
in the IR. One case was missing, leading to a zero-sized outgoing argument
space even though a call was still generated. This can cause corruption in the
caller stack frame. The case is where there are no explicit calls but the
JIT is going to generate a PInvoke frame initialization helper call. This
shouldn't happen, however, it occurs because the JIT eliminates a PInvoke
that is statically dead code, but still generates the prolog setup code.

A general solution would be to eliminate the PInvoke setup code if there
are no remaining PInvokes in the function. The simple change made here is
to ensure there is sufficient outgoing argument space for the PInvoke helper
call if that will be generated.

This was found by seeing test crashes due to stack corruption when
building the CLR with the VC++ compiler `-O2` optimization switch, which
stored data in the incoming argument stack space of the PInvoke helper function
(with PR https://github.com/dotnet/runtime/pull/59235).

There are 5 SPMI diffs: 2 in coreclr tests (the ones that failed at runtime),
2 in libraries tests, and 1 in System.Net.Http.WinHttpChannelBinding:.ctor(SafeWinHttpHandle):this
2021-10-06 08:50:50 -07:00
Stephen Toub 02bead1c76 Update Regex source generator to use new GetBestTypeByMetadataName method (#59778)
* Update Regex source generator to use new GetBestTypeByMetadataName method

* Disable tests in tests.proj
2021-10-06 11:49:14 -04:00
Stephen Toub 44f89824f0 Improve regex reductions and code gen for some alternations (#59903)
* Add optimize alternation path to regex source generator

If all branches of an alternation begin with a fixed character, we can emit a switch over just that character and save on potentially lots of failed match attempts, especially if the C# compiler can lower the switch into an IL switch or otherwise optimize the search based on first character.

* Improve alternation extraction of prefixes

Given an expression like "ab|ac|ade", we already reduce this to "a(?:b|c|de)" in order to factor out the starting "a".  But given an expression like "ab|acd|ef|egh", we don't currently extract the individual prefixes, e.g. "a(?:b|cd)|e(?:f|gh)", which would be valuable for a few reasons.  Primarily, it enables more efficient processing of the alternation, as a failed match in one branch then has to explore fewer branches, and we can potentially make that initial branch selection even faster if all the branches start with unique, fixed characters.

* Improve reduction for atomic alternations

The primary change here is an additional reduction for atomic alternations that enables subsequent optimizations to do more.  We previously added an optimization for alternation reduction that enables extraction of a common prefix from a contiguous sequence of branches in an alternation.  Such extraction isn't possible if there's a branch in between two that could otherwise be combined, and in the general case, we can't reorder the branches as that breaks the semantics of ordering being visible.  However, for atomic alternations, where no backtracking back into the node is possible, if we can prove that the intermediate branch can't match the same things as the other branches, reordering is fine.  Thus, for atomic alternations, we can reorder branches that begin with the same character as long as we can prove that the intermediate branches may never match that same character.  For now, we stick to fixed characters, though in the future this could be extended to sets/notones as well.

This also adds a minor optimization for atomic alternations that trims away all branches after an empty branch.

And it tweaks the pass that finds nodes to mark as atomic, ensuring that a top-level alternation is marked atomic so that the aforementioned optimizations kick in.

* Address PR feedback
2021-10-06 11:15:57 -04:00
Jan Kotas 62d70c4f79 Use custom error message when running out of syncblocks (#60013)
Contributes to #49215
2021-10-06 05:45:59 -07:00
dotnet-maestro[bot]anddotnet-maestro[bot] 8486eacfa3 [main] Update dependencies from dotnet/linker (#59931)
* Update dependencies from https://github.com/dotnet/linker build 20211004.1

Microsoft.NET.ILLink.Tasks
 From Version 7.0.100-1.21501.1 -> To Version 7.0.100-1.21504.1

* Update dependencies from https://github.com/dotnet/linker build 20211004.4

Microsoft.NET.ILLink.Tasks
 From Version 7.0.100-1.21501.1 -> To Version 7.0.100-1.21504.4

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
2021-10-06 10:42:00 +02:00
Johan Lorensson 031dab0318 Disable providervalidation runtime test on MonoVM. (#59994) 2021-10-06 09:59:54 +02:00
Tomáš Rylek 6321ddcd2e Block out the test Interop/PInvoke/Generics/GenericTest on arm64 pending investigation (#60039) 2021-10-05 20:54:14 -07:00
Theodore Tsirpanis 732ee3c9cd Remove the runtime-specific Stream source files. (#60019)
`Stream.CoreCLR.cs` and `Stream.Mono.cs` were almost identical.
2021-10-05 19:35:11 -07:00
Aaron Robinson 1e86c6e868 Add a Reverse P/Invoke scenario for profiler transition tests. (#60038) 2021-10-05 18:56:53 -07:00
Andy Ayers 26954f5e1d JIT: better support for patchpoints in try regions (#59784)
This change adds control flow to ensure that an OSR method for a patchpoint
nested in try regions enters those regions try from the first block of each
try rather than mid-try.

This lets these OSR methods conform to the data flow expectations that the
only way control flow can enter a try is via its first block.

See #33658 for more details on the approach taken here.

Fixes #35687.
2021-10-05 18:40:45 -07:00
Krzysztof Wicher d14366c798 Rollback changes breaking rolling builds (#60040)
* Revert "CI matrix update: add Ubuntu 21.04 (#59578)"

This reverts commit 127a498bfe.

* Revert "CI matrix: add openSUSE 15.2 (#59574)"

This reverts commit f9025ae80e.

* Revert "CI matrix change: add Windows.Server.Core.20H2 (#59572)"

This reverts commit 5ab435e1fa.
2021-10-06 01:25:17 +02:00
dotnet bot 127fd5c5bf Localized file check-in by OneLocBuild Task: Build definition ID 679: Build ID 1403459 (#60000) 2021-10-05 16:15:40 -07:00
Aaron Kunkle 191c60e679 Nonzero Exit Code for performance-setup Failures (#59483)
* failed git clone causes script failure

* Failure notification for moves & copies

* Fix robocopy failure detection

* Use functions to verify

* Close shell ifs

* Remove unintended tabs
2021-10-05 15:27:05 -07:00
Santiago Fernandez Madero eed2e5e6e1 Pin compiler version to workaround package validation loading missmatching roslyn versions (#60026) 2021-10-05 15:23:27 -07:00
Steve Molloy e0c392a333 Syndication test fixes for wasm. (#59835) 2021-10-05 14:40:42 -07:00
Jeff Handley 8e274278f2 Update CODEOWNERS to remove JSON area and to add Obsoletions (#60032) 2021-10-05 14:24:30 -07:00
Sychev Vadim 140e7a1e9c Loosen strict KeyValuePair deserialization logic (#59450) (#59757)
* Loosen strict KeyValuePair deserialization logic (#59450)

* Moved KeyValuePairConverter logic back to the KeyValuePairConverter.cs (#59450)

* Removed unnecessary code in KeyValuePairConverter (#59450)

* Cleaned up some mistakes (#59450)
2021-10-05 14:10:40 -07:00
Andrew Au 64842b50dc Code review feedback for DacHeapWalker (#60014) 2021-10-05 13:28:11 -07:00
01fdc9068e Add back the nethost archive. (#59847)
* Add back the nethost archive.

This archive makes it a bit easier for developers to pull down nethost in a non-.NET environment (without NuGet). We had this in 3.1, but it was lost at some point between then and now with all of the large infrastructure changes.

* Fix symbols copying.

* Create the symbols archive for nethost

* Update src/installer/pkg/archives/dotnet-nethost.proj

Co-authored-by: Juan Hoyos <[email protected]>

* Update src/installer/pkg/archives/dotnet-nethost.proj

Co-authored-by: Elinor Fung <[email protected]>

* Update src/installer/pkg/archives/dotnet-nethost.proj

* Symbols are in the PDB folder.

* Fix symbol paths for xplat.

* Update src/installer/pkg/archives/dotnet-nethost.proj

* Update src/installer/pkg/archives/dotnet-nethost.proj

Co-authored-by: Viktor Hofer <[email protected]>

* Update src/installer/pkg/archives/dotnet-nethost.proj

Co-authored-by: Viktor Hofer <[email protected]>

Co-authored-by: Juan Hoyos <[email protected]>
Co-authored-by: Elinor Fung <[email protected]>
Co-authored-by: Viktor Hofer <[email protected]>
2021-10-05 13:08:11 -07:00
Stephen Toub a59ba8cce5 Remove use of Unsafe in regex source generator (#60005)
Just process and slice spans rather than using Unsafe.  Simpler and cleaner code, arguably safer, and doesn't appear to negatively impact throughput.
2021-10-05 15:59:59 -04:00