platform/upstream/dotnet/runtime.git
2 years agoUpdate docker image (#61217)
Drew Scoggins [Wed, 17 Nov 2021 23:41:56 +0000 (15:41 -0800)]
Update docker image (#61217)

* Add support for custom container for Linux Arm64

Update platform_matrix.yml to allow custom containers for Arm64 Linux runs.
This is required for our performance runs as we need a newer version of the
python runtime. This change follows the same pattern as https://github.com/dotnet/runtime/pull/59202/files

* Update perf_slow.yml with correct container values

2 years agoSkip HardwareIntrinsics/x86base/Pause tests on Mono (#61743)
Andy Gocke [Wed, 17 Nov 2021 20:43:26 +0000 (12:43 -0800)]
Skip HardwareIntrinsics/x86base/Pause tests on Mono (#61743)

2 years agoMerge System.Security.Cryptography.Algorithms to System.Security.Cryptography
Jeremy Barton [Wed, 17 Nov 2021 20:00:31 +0000 (12:00 -0800)]
Merge System.Security.Cryptography.Algorithms to System.Security.Cryptography

2 years agoHostFactoryResolver - Increase default timeout to thirty seconds (#61621)
Maryam Ariyan [Wed, 17 Nov 2021 19:09:08 +0000 (11:09 -0800)]
HostFactoryResolver - Increase default timeout to thirty seconds (#61621)

2 years agoA few follow up changes to LookupTypeKey change (#61718)
Vladimir Sadov [Wed, 17 Nov 2021 18:30:29 +0000 (10:30 -0800)]
A few follow up changes to LookupTypeKey change (#61718)

* re-enable optimization when a token is replaced by corresponding type handle

* compute "isNested" ony when we need it.

* no need to make more than 2 attempts at reading

2 years agoFactor out and improve the vectorization of RegexInterpreter.FindFirstChar (#61490)
Stephen Toub [Wed, 17 Nov 2021 16:41:12 +0000 (11:41 -0500)]
Factor out and improve the vectorization of RegexInterpreter.FindFirstChar (#61490)

* Factor out and improve the vectorization of RegexInterpreter.FindFirstChar

This change started with the "simple" goal of factoring out the FindFirstChar logic from RegexInterpreter and consuming it in SymbolicRegexMatcher.  The existing engines use FindFirstChar to quickly skip ahead to the next location that might possibly match, at which point they fall back to analyzing the whole pattern at that location.  SymbolicRegexMatcher (used by RegexOptions.NonBacktracking) had its own implementation for this, which it used any time it entered a start state.  This required non-trivial additional code to maintain, and there's no good reason it should be separate from the other engines.

However, what started out as a simple change grew due to regressions that resulted from differences in the implementations.  In particular, SymbolicRegexMatcher already works off of precomputed equivalence tables for casing, which gives it very different characteristics in this regard from the existing engines.  For example, SymbolicRegexMatcher's existing "skip ahead to the next possible match start location" logic already evaluated all the characters that could possibly start a match, which included variations of the same character when using IgnoreCase, but the existing RegexInterpreter logic didn't.  That discrepancy then results in a significant IgnoreCase regression for NonBacktracking due to losing the ability to use a vectorized search for the next starting location.  We already plan to shift the existing engines over to a plan where all of these equivalences are computed at construction time rather than using ToLower at both construction time and match time, so this PR takes some steps in that direction, doing so for most of ASCII.  This has added some temporary cruft, which we'll be able to delete once we fully shift the implementations over (which we should do in the near future).

Another difference was SymbolicRegexMatcher was enabling use of IndexOfAny for up to 5 characters, whereas RegexOptions.Compiled was only doing up to 3 characters, and RegexInterpreter wasn't doing for any number.  The PR now uses 5 everywhere.

However, the more characters involved, the more overhead there is to IndexOfAny, and for some inputs, the higher the chances are that IndexOfAny will find a match sooner, which means its overhead compounds more.  To help with that, we now not only compute the possible characters that might match at the beginning of the pattern, but also characters that might match at a fixed offset from the beginning of the pattern (e.g. in \d{3}-\d{2}-\d{4}, it will find the '-' at offset 3 and be able to vectorize a search for that and then back off by the relevant distance.  That then also means we might end up with multiple sets to choose to search for, and this PR borrows an idea from Rust, which is to use some rough frequency analysis to determine which set should be targeted.  It's not perfect, and we can update the texts use to seed the analysis (right now I based it primarily on *.cs files in dotnet/runtime and some Project Gutenberg texts), but it's good enough for these purposes for now.

We'd previously switched to using IndexOf for a case-sensitive prefix string, but still were using Boyer-Moore for case-insensitive.  Now that we're able to also vectorize a search for case-insensitive values (right now just ASCII letter, but that'll be fixed soon), we can just get rid of Boyer-Moore entirely.  This saves all the costs to do with constructing the Boyer-Moore tables and also avoids having to generate the Boyer-Moore implementations in RegexOptions.Compiled and the source generator.

The casing change also defeated some other optimizations already present.  For example, in .NET 5 we added an optimization whereby an alternation like `abcef|abcgh` would be transformed into `abc(?:ef|gh)`, and that would apply whether case-sensitive or case-insensitive.  But by transforming the expression at construction now for case-insensitive into `[Aa][Bb][Cc][Ee][Ff]|[Aa][Bb][Cc][Gg][Hh]`, that optimization was defeated.  I've added a new optimization pass for alternations that will detect common prefixes even if they're sets.

The casing change also revealed some cosmetic issues.  As part of the change, when we encounter a "multi" (a multi-character string in the pattern), we convert that single case-insensitive RegexNode to instead be one case-sensitive RegexNode per character, with a set for all the equivalent characters that can match.  This then defeats some of the nice formatting we had for multis in the source generator, so as part of this change, the source generator has been augmented to output nicer code for concatenations.  And because sets like [Ee] are now way more common (since e.g. a case-insensitive 'e' will be transformed into such a set), we also special-case that in both the source generator and RegexOptions.Compiled, to spit out the equivalent of `(c | 0x20) == 'e'` rather than `(c == 'E'| c == 'e')`.

Along the way, I cleaned up a few things as well, such as passing around a CultureInfo more rather than repeatedly calling CultureInfo.CurrentCulture, using CollectionsMarshal.GetValueRefOrAddDefault on a hot path to do with interning strings in a lookup table, tweaking SymbolicRegexRunnerFactory's Runner to itself be generic to avoid an extra layer of virtual dispatch per operation, and cleaning up code / comments in SymbolicRegexMatcher along the way.

For the most part the purpose of the change wasn't to improve perf, and in fact I was willing to accept some regressions in the name of consolidation.  There are a few regressions here, mostly small, and mostly for cases where we're simply paying an overhead for vectorization, e.g. where the current location is fine to match, or where the target character being searched for is very frequent.  Overall, though, there are some substantial improvements.

* Fix missing condition in RegexCompiler

* Try to fix mono failures and address comment feedback

* Delete more now dead code

* Fix dead code emitting after refactoring

Previously return statements while emitting anchors were short-circuiting the rest of the emitting code, but when I moved that code into a helper, the returns stopped having that impact, such that we'd end up emitting a return statement and then emit dead code after it.  Fix it.

* Remove some now dead code

2 years ago[DllImportGenerator] Enable on projects without System.Memory and System.Runtime...
Elinor Fung [Wed, 17 Nov 2021 16:12:15 +0000 (09:12 -0700)]
[DllImportGenerator] Enable on projects without System.Memory and System.Runtime.CompilerServices.Unsafe (#61704)

2 years agoRemove XUnit reference metadata from tests I switched over last week (#61691)
Tomáš Rylek [Wed, 17 Nov 2021 15:53:50 +0000 (16:53 +0100)]
Remove XUnit reference metadata from tests I switched over last week (#61691)

During code review of my latest PR Bruce raised the concern that
hard-coding public key values and version ID for the xunit.core
reference will cause enormous maintenance pain if we decide to
upgrade to a newer version of the module in the future. As Jeremy
verified that the metadata is not really needed, I'm deleting it
from all tests I switched over last week.

Thanks

Tomas

2 years agorefactoring (#60074)
kronic [Wed, 17 Nov 2021 15:46:02 +0000 (18:46 +0300)]
refactoring (#60074)

Co-authored-by: kronic <kronic@softland.ru>
2 years agoIgnore missing data result from superpmi-replay run (#61699)
Kunal Pathak [Wed, 17 Nov 2021 14:42:53 +0000 (06:42 -0800)]
Ignore missing data result from superpmi-replay run (#61699)

* Ignore missing data result

* Move result = false only if error Code is other than 2/3

2 years agoRemove some unnecessary slicing from generated Regex code (#61701)
Stephen Toub [Wed, 17 Nov 2021 13:22:14 +0000 (08:22 -0500)]
Remove some unnecessary slicing from generated Regex code (#61701)

* Remove some unnecessary slicing from generated Regex code

When we're outputting code to match a "multi" (a sequence of multiple characters), we're currently issuing a Slice for the known tracked offset even if that offset is 0.  We can skip that nop.

* Address PR feedback

2 years agoExtend RegexCharClass.Canonicalize range inversion optimization (#61562)
Stephen Toub [Wed, 17 Nov 2021 12:52:37 +0000 (07:52 -0500)]
Extend RegexCharClass.Canonicalize range inversion optimization (#61562)

* Extend RegexCharClass.Canonicalize range inversion optimization

There's a simple optimization in RegexCharClass.Canonicalize that was added in .NET 5, with the goal of taking a set that's made up of exactly two ranges and seeing whether those ranges were leaving out exactly one character.  If they were, the set can instead be rewritten as that character negated, which is a normalized form used downstream and optimized.  We can extend this normalization ever so slightly to be for two ranges separated not just be a single character but by more than that as well.

* Update TODO comment

* Add some more reduction tests

2 years agoMinor File.ReadAllBytes* improvements (#61519)
Adam Sitnik [Wed, 17 Nov 2021 12:29:49 +0000 (13:29 +0100)]
Minor File.ReadAllBytes* improvements (#61519)

* switch from FileStream to RandomAccess

* use Array.MaxLength as a limit for File.ReadAllBytes and fix an edge case bug for files: Array.MaxLength < Length < int.MaxValue

* there is no gain of using FileOptions.SequentialScan on Unix, as it requires an additional sys call

Co-authored-by: Dan Moseley <danmose@microsoft.com>
2 years ago[wasm][debugger] Fix evaluation of a static class attribute; using current namespace...
Ilona Tomkowicz [Wed, 17 Nov 2021 09:10:22 +0000 (10:10 +0100)]
[wasm][debugger] Fix evaluation of a static class attribute; using current namespace for evaluation (#61252)

* Using current namespace as the default place to serach for the resolved class.

* Add tests for static class, static fields and pausing in async method.

* Added tests for class evaluation.

* Fixing support to the current namespace and adding tests for it

* Assuing that we search within the current assembly first. Removed tests that fail in Consol App.

* Remove a test-duplicate that was not testing static class or static fields.

* Fixing indentation.

* Refixing indentation.

* Refix indentations again.

* Applied the advice about adding new blank lines.

* Changed the current assembly check.

* Extracting the check from the loop. One time check is enough.

* Simplifying multiple test cases into one call.

* Using local function as per review suggestion.

* Added test that was skipped by mistake.

* Added looking for the namespace in all assemblies because there is a chance it will be located out of the current assembly.

* Extracting value based on the current frame, not the top of stack location.

* Test for classes evaluated from different frames.

* Fixing indentation and spaces.

* Applied review comments for values evaluation.

* Compressed two tests into one with MemberData.

* Added test case of type without namespace (failing).

* Addressed Ankit advices from the review.

Co-authored-by: DESKTOP-GEPIA6N\Thays <thaystg@gmail.com>
2 years ago[mono][aot] Fix the inclusion of generic instances when doing profiled AOT. (#61627)
Zoltan Varga [Wed, 17 Nov 2021 07:11:19 +0000 (02:11 -0500)]
[mono][aot] Fix the inclusion of generic instances when doing profiled AOT. (#61627)

If a profile contained a method like List<AnInst>:.ctor () and the
'profile-only' option was used, the fully shared version of the method
needs to be added to the aot image.

2 years ago[wasm] renames and cleanup before modularization (#61596)
Pavel Savara [Wed, 17 Nov 2021 05:52:25 +0000 (06:52 +0100)]
[wasm] renames and cleanup before modularization (#61596)

- no imports from outer scope
- move dotnet to -extern-pre-js
- re-enable JS minification with ES2018
- rename main javaScript files to main.js and test-main.js
- sample and test script cleanup
- rename set_exit_code method
- rewrite test start as async method
- improve script loading via script element on page in test
- use BINDING.bind_static_method instead of INTERNAL where possible
- better .d.ts exports
- formatted html files
- renamed modules.ts to imports.ts which makes more sense
- improved error propagation
- renamed __initializeImportsAndExports
- delayed exit and stdout flush

2 years agoUpdate SPCL to use GeneratedDllImport where possible. (#61640)
Aaron Robinson [Wed, 17 Nov 2021 01:35:01 +0000 (18:35 -0700)]
Update SPCL to use GeneratedDllImport where possible. (#61640)

* Update SPCL to use GeneratedDllImport where possible.

2 years agoJIT: don't import IL for partial compilation blocks (#61572)
Andy Ayers [Wed, 17 Nov 2021 01:03:18 +0000 (17:03 -0800)]
JIT: don't import IL for partial compilation blocks (#61572)

Adjust partial comp not to import IL instead of importing it and then
deleting the IR. Saves some time and also sometimes a bit of stack
space as we won't create as many temps.

Update both PC and OSR to check for blocks in handlers early, rather
than pretending to support these and then backing out later.

2 years agoAdd [Fact] attributes to all remaining ilproj tests (#61625)
Tomáš Rylek [Wed, 17 Nov 2021 00:07:43 +0000 (01:07 +0100)]
Add [Fact] attributes to all remaining ilproj tests (#61625)

2 years agoAdd .runsettings file to be able to run and debug tests on vscode in codespace with...
Santiago Fernandez Madero [Tue, 16 Nov 2021 22:34:52 +0000 (14:34 -0800)]
Add .runsettings file to be able to run and debug tests on vscode in codespace with prebuilt (#61684)

2 years ago[DllImportGenerator] Stop ignoring QCalls when looking for methods to convert to...
Elinor Fung [Tue, 16 Nov 2021 22:12:40 +0000 (15:12 -0700)]
[DllImportGenerator] Stop ignoring QCalls when looking for methods to convert to GeneratedDllImport (#61678)

2 years agoLocalized file check-in by OneLocBuild Task: Build definition ID 679: Build ID 147267...
dotnet bot [Tue, 16 Nov 2021 21:42:46 +0000 (13:42 -0800)]
Localized file check-in by OneLocBuild Task: Build definition ID 679: Build ID 1472678 (#61680)

* Localized file check-in by OneLocBuild Task: Build definition ID 679: Build ID 1472242

* Localized file check-in by OneLocBuild Task: Build definition ID 679: Build ID 1472678

2 years agoUse GeneratedDllImport for blittable p/invokes in System.IO.Compression, System.IO...
Elinor Fung [Tue, 16 Nov 2021 21:01:42 +0000 (14:01 -0700)]
Use GeneratedDllImport for blittable p/invokes in System.IO.Compression, System.IO.Compression.Brotli, System.Net.Http, System.Net.NameResolution (#61638)

2 years agoUpdate WASM README.md (#61681)
Aaron Robinson [Tue, 16 Nov 2021 18:49:00 +0000 (11:49 -0700)]
Update WASM README.md (#61681)

* Update WASM README.md

2 years ago[wasm][debugger] View multidimensional array when debugging (#60983)
Thays Grazia [Tue, 16 Nov 2021 18:15:08 +0000 (15:15 -0300)]
[wasm][debugger] View multidimensional array when debugging (#60983)

* It's working when debug from chrome but not when debug from VS, because it uses callFunctionOn

* Remove unrelated change.

* Working also on VS.

* Working also on VS.

* Addressing @lewing and @radical comments

* Change ArrayDimensions to be a record and not a class as suggested by @radical.

* Addressing @radical comments.

2 years ago[wasm][debugger] Improvement of memory consumption while Evaluating Expressions ...
Thays Grazia [Tue, 16 Nov 2021 18:14:37 +0000 (15:14 -0300)]
[wasm][debugger] Improvement of memory consumption while Evaluating Expressions (#61470)

* Fix memory consumption.

* Fix debugger-tests

* Fix compilation.

* Addressing @lewing PR.

* Address @lewing comment

* Addressing @radical comment.

* Addressing comments.

* Addressing @radical comments.

* missing return.

* Addressing @radical comments

* Adding test case

Co-authored-by: Larry Ewing <lewing@microsoft.com>
* Fixing tests.

* Adding another test case. Thanks @lewing.

* Reuse the script.

Co-authored-by: Larry Ewing <lewing@microsoft.com>
2 years ago[wasm] Rework fetch (#61639)
Larry Ewing [Tue, 16 Nov 2021 18:06:25 +0000 (12:06 -0600)]
[wasm] Rework fetch (#61639)

* Unify some code and load mono-config.json using our _fetch_asset

2 years agoFix poisoning for very large structs (#61521)
Jakob Botsch Nielsen [Tue, 16 Nov 2021 12:49:58 +0000 (13:49 +0100)]
Fix poisoning for very large structs (#61521)

For very large structs poisoning could end up generating instructions
requiring larger local var offsets than we can handle which would hit an
IMPL_LIMIT that throws InvalidProgramException. Switch to using rep
stosd (x86/x64)/memset helper (other platforms) when a local needs more
than a certain number of mov instructions to poison.

Also includes a register allocator change to mark killed registers as
modified in addRefsForPhysRegMask instead of by the (usually) calling
function, since this function is used directly in the change.

2 years agoDisable fgMorphCastedBitwiseOp opt for floats (#61657)
Egor Bogatov [Tue, 16 Nov 2021 11:22:28 +0000 (14:22 +0300)]
Disable fgMorphCastedBitwiseOp opt for floats (#61657)

2 years ago[arm64] JIT: Make 0.0 containable for fcmp (#61617)
Egor Bogatov [Tue, 16 Nov 2021 07:52:31 +0000 (10:52 +0300)]
[arm64] JIT: Make 0.0 containable for fcmp (#61617)

2 years agoGive create codespaces prebuild action right permissions (#61651)
Santiago Fernandez Madero [Tue, 16 Nov 2021 04:36:45 +0000 (20:36 -0800)]
Give create codespaces prebuild action right permissions (#61651)

2 years agoFix SuperPMI Python script Azure usage (#61650)
Bruce Forstall [Tue, 16 Nov 2021 04:31:25 +0000 (20:31 -0800)]
Fix SuperPMI Python script Azure usage (#61650)

The on-demand Azure module load was refactored to jitutil.py,
but that requires some cross-module importing to work. Do the
minimal required to make this work.

2 years agoProvide locations for src-gen diagnostic output (#61430)
Layomi Akinrinade [Tue, 16 Nov 2021 02:25:53 +0000 (18:25 -0800)]
Provide locations for src-gen diagnostic output (#61430)

* Provide locations for src-gen diagnostic output

* Fix tests and address feedback

* Add defensive check for context type location

2 years agoXArch: Trim the code block to match the actual code length (#61523)
Kunal Pathak [Tue, 16 Nov 2021 01:25:05 +0000 (17:25 -0800)]
XArch: Trim the code block to match the actual code length (#61523)

* Trim the hot code size to the actual code length

* Remove allocatedHotCodeSize field

* Remove verbose logging

* Perform trimming only for xarch

* Include more comment about armarch

* Fix the condition for arm64

2 years agoAdd tests for CNG symmetric key algorithm mismatches
Kevin Jones [Tue, 16 Nov 2021 01:09:50 +0000 (20:09 -0500)]
Add tests for CNG symmetric key algorithm mismatches

2 years agoObsolete thumbtacked AssemblyName properties (#59522)
Bar Arnon [Tue, 16 Nov 2021 01:06:46 +0000 (03:06 +0200)]
Obsolete thumbtacked AssemblyName properties (#59522)

* Obsolete thumbtacked AssemblyName properties

Fix #59061

* Ignore obsoletion

* Fix pragma

* Merge the AssemblyName member obsoletions into a single diagnostic id

* Fix pragma to use updated diagnostic id

* Suppress SYSLIB0037 in reflection tests

* Suppress SYSLIB0037 warnings

Co-authored-by: Jeff Handley <jeffhandley@users.noreply.github.com>
Co-authored-by: Jeff Handley <jeff.handley@microsoft.com>
2 years agoOnly run JIT formatting job if there are JIT changes (#61632)
Bruce Forstall [Tue, 16 Nov 2021 00:13:42 +0000 (16:13 -0800)]
Only run JIT formatting job if there are JIT changes (#61632)

2 years agoAllow for backport to report progress to PR (#61637)
Juan Hoyos [Mon, 15 Nov 2021 23:48:08 +0000 (15:48 -0800)]
Allow for backport to report progress to PR (#61637)

2 years agoRestrict GITHUB_TOKEN in markdownlint action (#61622)
Kevin Jones [Mon, 15 Nov 2021 23:40:48 +0000 (18:40 -0500)]
Restrict GITHUB_TOKEN in markdownlint action (#61622)

Currently, Actions in the dotnet/runtime repository have read/write
access by default, unless their permissions have been explicitly declared.

The markdownlint workflow can be restricted from all access except the
repository contents. This limits what the 3rd party `markdownlint-cli`
npm package can do which is installed as part of the workflow.

2 years agoUse GeneratedDllImport in Microsoft.Win32.SystemEvents (#61609)
Elinor Fung [Mon, 15 Nov 2021 23:03:07 +0000 (15:03 -0800)]
Use GeneratedDllImport in Microsoft.Win32.SystemEvents (#61609)

2 years agoEnable SymbolicRegexNode.IsNullableFor fast path to inline (#61605)
Stephen Toub [Mon, 15 Nov 2021 22:54:53 +0000 (17:54 -0500)]
Enable SymbolicRegexNode.IsNullableFor fast path to inline (#61605)

2 years agoDelete impCheckForNullPointer (#61576)
SingleAccretion [Mon, 15 Nov 2021 22:42:51 +0000 (01:42 +0300)]
Delete impCheckForNullPointer (#61576)

The comment above the method mentions "many problems" with leaving
null pointers around, but it is unclear what kind of problems. I can
only speculate those were the problems in legacy codegen which "could
not handle constant op1".

It also mentions that "we cannot even fold (null+offset)", which is
incorrect: "gtFoldExprConst" does in fact fold such expressions to
zero byrefs. It is also the case that spilling the null into a local
affects little as local assertion propagation happily propagates the
null back into its original place.

There was also a little bug associated with the method that got fixed:
morph was trying to use it, and in the process created uses of a local
that was not initialized, since the statement list used by the method
is the importer's one, invalid in morph.

2 years ago[wasm] parallel asset loading (#61610)
Pavel Savara [Mon, 15 Nov 2021 22:22:48 +0000 (23:22 +0100)]
[wasm] parallel asset loading (#61610)

2 years agoAdding support for X86Base.Pause() and ArmBase.Yield() (#61065)
Tanner Gooding [Mon, 15 Nov 2021 22:15:00 +0000 (14:15 -0800)]
Adding support for X86Base.Pause() and ArmBase.Yield() (#61065)

* Adding support for X86Base.Pause() and ArmBase.Yield()

* Applying formatting patch

* Ensure NI_ArmBase_Yield actually gets through to codegen on arm64

2 years agoCreate runtime staging clone to manually kick off full test runs (#61443)
Steve Pfister [Mon, 15 Nov 2021 22:10:19 +0000 (14:10 -0800)]
Create runtime staging clone to manually kick off full test runs (#61443)

This change allows devs to manually kick off full test runs on the configurations that only execute smoke tests per PR.

/azp runtime-staging-manual will do the trick

2 years agoGive write access to backport action explicitly (#61626)
Juan Hoyos [Mon, 15 Nov 2021 21:38:50 +0000 (13:38 -0800)]
Give write access to backport action explicitly (#61626)

2 years agoLoop refactoring and commenting improvements (#61496)
Bruce Forstall [Mon, 15 Nov 2021 21:25:51 +0000 (13:25 -0800)]
Loop refactoring and commenting improvements (#61496)

- Remove unneeded FIRST concept in loop table; it was always equal to TOP.
- Rename optMarkLoopsBlocks to optScaleLoopBlocks to more accurately describe
what it does. More consistently report block scaling in the dump
- Create optMarkLoopHeads. This was refactored out of fgRemoveUnreachableBlocks so
it can be called in a more logical location (at the beginning of optFindLoops),
and only does one thing.
- fgMakeOutgoingStructArgCopy: remove unused `argIndex` argument; reorder calls to
fgMightHaveLoop.
- Update and write a bunch of comments; convert away from `/* */` style comments.

2 years agoThere shouldn't be a 'lib' prefix on Windows .lib files (#61618)
Jo Shields [Mon, 15 Nov 2021 20:15:50 +0000 (20:15 +0000)]
There shouldn't be a 'lib' prefix on Windows .lib files (#61618)

2 years agoDelete dead code (#61533)
SingleAccretion [Mon, 15 Nov 2021 20:11:22 +0000 (23:11 +0300)]
Delete dead code (#61533)

* Delete regArgList

Unused.

* Delete CountSharedStaticHelper

Unused.

* Delete GTF_RELOP_QMARK

Unused.

* Delete lvaPromotedStructAssemblyScratchVar

Unused.

* Delete dead code from fgMorphSmpOp

The conditions tested constitute invalid IR.

* Delete gtCompareTree

Unused.

* Delete gtAssertColonCond

Unused.

* Delete IsSuperPMIException

Unused.

2 years agoImprove System.Speech trimmability (#61566)
Andrii Kurdiumov [Mon, 15 Nov 2021 19:50:53 +0000 (01:50 +0600)]
Improve System.Speech trimmability (#61566)

by removing obvious warnings

2 years agoFix LastWriteTime and LastAccessTime of a symlink on Windows and Unix (#52639)
Hamish Arblaster [Mon, 15 Nov 2021 19:45:31 +0000 (06:45 +1100)]
Fix LastWriteTime and LastAccessTime of a symlink on Windows and Unix (#52639)

* Implement most of the fix for #38824

Reverts the changes in the seperate PR https://github.com/dotnet/runtime/commit/a617a01195b4dad3cb5f300962ad843b46d4f175 to fix #38824.
Does not re-enable the test because that relies on #49555, will add a seperate commit to whichever is merged last to enable the SettingUpdatesPropertiesOnSymlink test.

* Most of the code for PR #52639 to fix #38824

• Deal with merge conflicts
• Add FSOPT_NOFOLLOW for macOS and use it in setattrlist
• Use AT_SYMLINK_NOFOLLOW with utimensat (note: there doesn't seem to be an equivalent for utimes)
• Add SettingUpdatesPropertiesOnSymlink test to test if it actually sets it on the symlink itself (to the best that we can anyway ie. write + read the times)
• Specify FILE_FLAG_OPEN_REPARSE_POINT for CreateFile in FileSystem.Windows.cs (is there any other CreateFile calls that need this?)

* Remove additional FILE_FLAG_OPEN_REPARSE_POINT

I added FILE_FLAG_OPEN_REPARSE_POINT before and it was then added in another PR, this removes the duplicate entry.

* Add missing override keywords

Add missing override keywords for abstract members in the tests.

* Fix access modifiers

Fix access modifiers for tests - were meant to be protected rather than public

* Add more symlink tests, rearrange files

• Move symlink creation api to better spot in non-base files
• Add IsDirectory property for some of the new tests
• Change abstract symlink api to CreateSymlink that accepts path and target
• Create a CreateSymlinkToItem method that creates a symlink to an item that may be relative that uses the new/modified abstract CreateSymlink method
• Add SettingUpdatesPropertiesCore to avoid code duplication
• Add tests for the following variants: normal/symlink, target exists/doesn't exist, absolute/relative target
• Exclude nonexistent symlink target tests on Unix for Directories since they are counted as files

* Fix return type of CreateSymlink in File/GetSetTimes.cs

* Remove browser from new symlink tests as it doesn't support creation of symlinks

Remove browser from new symlink tests as it doesn't support creation of symlinks

* Use lutimes, improve code readability, simplify tests

• Use lutimes when it's available
• Extract dwFlagsAndAttributes to a variable
• Use same year for all tests
• Checking to delete old symlink is unnecessary, so don't
• Replace var with explicit type

* Change year in test to 2014 to reduce diff

* Rename symlink tests, use 1 core symlink times function, and check that target times don't change

Rename symlink tests, use 1 core symlink times function, and check that target times don't change

* Inline RunSymlinkTestPart 'function'

Inline RunSymlinkTestPart 'function' so that the code can be reordered so the access time test can be valid.

* Share CreateSymlinkToItem call in tests and update comment for clarity

* Update symlink time tests

• Make SettingUpdatesPropertiesOnSymlink a theory
• Remove special case for Unix due to https://github.com/dotnet/runtime/pull/52639#discussion_r739009259 (will revert if fails)
• Rename isRelative to targetIsRelative for clarity

* Remove unnecessary Assert.All

* Changes to SettingUpdatesPropertiesOnSymlink test

• Rename item field to link field
• Don't use if one-liner
• Use all time functions since only using UTC isn't necessary
• Remove the now-defunct IsDirectory property since we aren't checking it anymore

* Remove unnecessary fsi.Refresh()

• Remove unnecessary fsi.Refresh() since atime is only updated when reading a file

* Updates to test and pal_time.c

• Remove targetIsRelative cases
• Multi-line if statement
• Combine HAVE_LUTIMES and #else conditions to allow more code charing

* Remove trailing space

2 years agoFix CharInClass reference in regex emitter (#61559)
Stephen Toub [Mon, 15 Nov 2021 19:21:34 +0000 (14:21 -0500)]
Fix CharInClass reference in regex emitter (#61559)

We've tried to consistently use global:: whenever referring to core library types in the regex generator emitted code.  I'd missed these two.

(That said, these make the code a lot harder to read, especially in places where we're unable to use extension methods as extensions, so we'll want to revisit this policy.)

2 years agoExclude the managed code around libproc on iOS/tvOS (#61590)
Maxim Lipnin [Mon, 15 Nov 2021 19:03:59 +0000 (22:03 +0300)]
Exclude the managed code around libproc on iOS/tvOS (#61590)

Since libproc is a private Apple API, it is not available on iOS/tvOS and should be excluded (see #61265 (comment) and above for more details).
This PR excludes $(CommonPath)Interop\OSX\Interop.libproc.cs on the iOS/tvOS as well as makes some methods in Process, ProcessManager, and ProcessThread classes calling that API throw PNSE so that for iOS/tvOS it's possible to re-use the respective *.UnknownUnix.cs parts.

2 years agoFileSystem.Unix: improve CopyFile. (#59695)
Tom Deseyn [Mon, 15 Nov 2021 17:26:16 +0000 (18:26 +0100)]
FileSystem.Unix: improve CopyFile. (#59695)

* FileSystem.Unix: improve CopyFile.

Like the upcoming version of GNU coreutils 'cp' prefer a copy-on-write clone.
This shares the physical storage between files, which means no data needs to copied.
CoW-clones are supported by a number of Linux file systems, like Btrfs, XFS, and overlayfs.

Eliminate a 'stat' call that is always performed for checking if the target is a directory
by only performing the check when the 'open' syscall reports an error.

Eliminate a 'stat' call for retrieving the file size of the source by passing through
the length that was retrieved when checking the opened file is not a directory.

Create the destination with file permissions that match the source.
We still need to fchmod due to umask being applied to the open mode.

When performing a manual copy, limit the allocated buffer for small files.
And, avoid the last 'read' call by checking when we've copied the expected nr of bytes.

* Don't FICLONE for zero sourceLength

* PR feedback

* When using sendfile, don't loop when source file gets truncated.

* Fall through when FICLONE fails.

* Don't stop CopyFile_ReadWrite until read returns zero.

* Revert all changes to CopyFile_ReadWrite

* Move comment a few lines up.

* Fix unused error.

2 years agoUpdate workflow docs to indicate ARM64 macOS works (#61575)
Kevin Jones [Mon, 15 Nov 2021 17:09:02 +0000 (12:09 -0500)]
Update workflow docs to indicate ARM64 macOS works (#61575)

2 years agoUse GeneratedDllImport for blittable p/invokes in System.Diagnostics.Process, System...
Elinor Fung [Mon, 15 Nov 2021 16:41:11 +0000 (08:41 -0800)]
Use GeneratedDllImport for blittable p/invokes in System.Diagnostics.Process, System.Diagnostics.Process, System.Diagnostics.FileVersionInfo, System.Runtime.InteropServices.RuntimeInformation (#61532)

2 years agoUse Span.Fill in String(Char, Int32) constructor (#60269)
Steve Dunn [Mon, 15 Nov 2021 16:35:57 +0000 (16:35 +0000)]
Use Span.Fill in String(Char, Int32) constructor  (#60269)

* Apply suggestions from code review

Co-authored-by: Adam Sitnik <adam.sitnik@gmail.com>
Co-authored-by: Jeremy Koritzinsky <jkoritzinsky@gmail.com>
2 years agoRemove the "anything + null => null" optimization (#61518)
SingleAccretion [Mon, 15 Nov 2021 16:35:28 +0000 (19:35 +0300)]
Remove the "anything + null => null" optimization (#61518)

This optimization is only legal if:
1) "Anything" is a sufficiently small constant itself.
2) We are in a context where we know the address will in
   fact be used for an indirection.

It is the second point that is problematic - one would
like to use MorphAddrContext, but it is not suitable
for this purpose, as an unknown context is counted as
an indirecting one. Additionally, the value of this
optimization is rather low. I am guessing it was meant
to support the legacy nullchecks, before GT_NULLCHECK
was introduced, and had higher impact then.

So, just remove the optimization and leave the 5 small
regressions across all of SPMI be.

2 years agoSortedList<TKey, TValue> added GetKeyAtIndex, GetValueAtIndex, and SetValueAtIndex...
rhaokiel [Mon, 15 Nov 2021 15:52:40 +0000 (09:52 -0600)]
SortedList<TKey, TValue> added GetKeyAtIndex, GetValueAtIndex, and SetValueAtIndex (#60520)

* SortedList<TKey, TValue> added GetKeyAtIndex, GetValueAtIndex, and SetValueAtIndex

* Update src/libraries/System.Collections/src/System/Collections/Generic/SortedList.cs

Co-authored-by: Eirik Tsarpalis <eirik.tsarpalis@gmail.com>
2 years agoDisable poisoning for large structs (#61589)
Jakob Botsch Nielsen [Mon, 15 Nov 2021 15:28:07 +0000 (16:28 +0100)]
Disable poisoning for large structs (#61589)

For very large structs (> 64K in size) poisoning could end up generating
instructions requiring larger local var offsets than we can handle. This
hits IMPL_LIMIT that throws InvalidProgramException. Turn off poisoning
for larger structs that require more than 16 movs to also avoid the
significant code bloat by the singular movs.

This is a less risky version of #61521 for backporting to .NET 6.

Fix #60852

2 years agoRewrite selection for fields (#61370)
SingleAccretion [Mon, 15 Nov 2021 15:24:55 +0000 (18:24 +0300)]
Rewrite selection for fields (#61370)

The issue was that VNApplySelectors uses the types
of fields when selecting, but that's not valid for
"the first field" maps.

Mirror how the stores to fields are numbered.

2 years ago[main] Update dependencies from 3 repositories (#61568)
dotnet-maestro[bot] [Mon, 15 Nov 2021 15:13:35 +0000 (16:13 +0100)]
[main] Update dependencies from 3 repositories (#61568)

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
2 years agoDelete `__DoCrossgen2` (#61582)
Michal Strehovský [Mon, 15 Nov 2021 14:35:10 +0000 (23:35 +0900)]
Delete `__DoCrossgen2` (#61582)

`__DoCrossgen2` appears to be redundant with `__TestBuildMode=crossgen2`.

2 years agoAdd JsonSerializerOptions.Default (#61434)
Eirik Tsarpalis [Mon, 15 Nov 2021 11:16:33 +0000 (11:16 +0000)]
Add JsonSerializerOptions.Default (#61434)

* Add JsonSerializerOptions.Default

* address feedback

* address feedback

2 years ago[main] Update dependencies from dotnet/linker (#61094)
dotnet-maestro[bot] [Mon, 15 Nov 2021 09:39:39 +0000 (10:39 +0100)]
[main] Update dependencies from dotnet/linker (#61094)

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
2 years agoAlternative fix of #60182 (#60298)
SRV [Mon, 15 Nov 2021 05:37:33 +0000 (07:37 +0200)]
Alternative fix of #60182 (#60298)

2 years agoEnable 54910 tests (#61564)
Adeel Mujahid [Sun, 14 Nov 2021 23:47:27 +0000 (01:47 +0200)]
Enable 54910 tests (#61564)

2 years agoAdd [Fact] attributes to JIT regression tests (#61540)
Tomáš Rylek [Sun, 14 Nov 2021 23:46:03 +0000 (00:46 +0100)]
Add [Fact] attributes to JIT regression tests (#61540)

For now there's no functional change to the behavior of the tests,
I have just copied the bits to inject from Jeremy's example in his
pending PR.

I have spot-checked that some of the tests use Main with the
command-line args argument. I'm not changing them in this PR, the
signature only becomes important once we start actually merging
the IL tests and I presume we'll clean that up at that point.

Thanks

Tomas

Contributes to: https://github.com/dotnet/runtime/issues/54512

2 years agoAdd [Fact] attributes to methodical JIT tests (#61536)
Tomáš Rylek [Sun, 14 Nov 2021 23:42:34 +0000 (00:42 +0100)]
Add [Fact] attributes to methodical JIT tests (#61536)

For now there's no functional change to the behavior of the tests,
I have just copied the bits to inject from Jeremy's example in his
pending PR.

Thanks

Tomas

Contributes to: https://github.com/dotnet/runtime/issues/54512

2 years agoCompletely lock-free ClassLoader::LookupTypeKey (#61346)
Vladimir Sadov [Sun, 14 Nov 2021 22:32:50 +0000 (14:32 -0800)]
Completely lock-free ClassLoader::LookupTypeKey (#61346)

* embedded size

* next array

* read consistency while rehashing

* comments

* remove CRST_UNSAFE_ANYMODE and COOP mode in the callers

* typo

* fix 32bit builds

* couple changes from review.

* Walk the buckets in resize.

* remove a `REVIEW:` comment.

* Update src/coreclr/vm/dacenumerablehash.inl

PR review suggestion

Co-authored-by: Jan Kotas <jkotas@microsoft.com>
* remove use of `auto`

* DAC stuff

* Constructor and GrowTable are not called by DAC, no need for DPTR, added a comment about a cast.

* SKIP_SPECIAL_SLOTS

* More compact dac_cast in GetNext

Co-authored-by: Jan Kotas <jkotas@microsoft.com>
2 years agoAdd [Fact] attributes on TypeGeneratorTests (#61534)
Tomáš Rylek [Sun, 14 Nov 2021 21:27:23 +0000 (22:27 +0100)]
Add [Fact] attributes on TypeGeneratorTests (#61534)

For now there's no functional change to the behavior of the tests,
I have just copied the bits to inject from Jeremy's example in his
pending PR.

Thanks

Tomas

2 years agoEnable new analyzers in global configs (#60914)
Stephen Toub [Sun, 14 Nov 2021 12:07:47 +0000 (07:07 -0500)]
Enable new analyzers in global configs (#60914)

* Enable new analyzers in global configs

* Address PR feedback

2 years ago[mono] Disable partial generic sharing for gparams with non-enum constraints. (#59437)
Zoltan Varga [Sun, 14 Nov 2021 02:31:32 +0000 (21:31 -0500)]
[mono] Disable partial generic sharing for gparams with non-enum constraints. (#59437)

If a generic argument is a primitive type, and it has an interface constraint
that enums don't implement, then partial sharing for that instance is not
useful, since only the specific primitive type instance will be able
to use the shared version.

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

2 years ago[mono] Add a 'inline_method' profiler event. (#61454)
Zoltan Varga [Sat, 13 Nov 2021 19:30:09 +0000 (14:30 -0500)]
[mono] Add a 'inline_method' profiler event. (#61454)

Emit it in the interpreter when a method is inlined or replaced with
an intrinsic. This is needed so the AOT profiler can track these
methods.

2 years agoUpdate how OSR and PGO interact (#61453)
Andy Ayers [Sat, 13 Nov 2021 19:17:25 +0000 (11:17 -0800)]
Update how OSR and PGO interact (#61453)

When both OSR and PGO are enabled:
* Enable instrumenting OSR methods, so that the combined profile data from
Tier0 plus any OSR variants provide a full picture for subsequent Tier1
optimization.
* Use block profiles for both Tier0 methods that are likely to have patchpoints
and OSR methods.
* Fix phase ordering so partially jitted methods don't lose probes.
* A few more fixes for partial compilation, because the number of things
we think we might instrument and the number of things we end up instrumenting
can differ.
* Also improve the DumpJittedMethod output for OSR, and allow selective dumping
of a particular OSR variant by specifying its IL offset.

The updates on the runtime side are to pass BBINSTR to OSR methods, and to
handle the (typical) case where the OSR method instrumentation schema is a subset
of the Tier0 method schema.

We are still allowing OSR methods to read the profile data. So they are both
profile instrumented and profile optimized. Not clear if this is going to work
well as the Tier0 data will be incomplete and optimization quality may be poor.
Something to revisit down the road.

2 years ago[mini] Allow MONO_VERBOSE_METHOD='*:*' (#61520)
Aleksey Kliger (λgeek) [Sat, 13 Nov 2021 18:25:31 +0000 (13:25 -0500)]
[mini] Allow MONO_VERBOSE_METHOD='*:*' (#61520)

Implement method name wildcard matching for method descriptions

Globbing doesn't work because we don't have g_pattern_match_simple in eglib.
But a plain '*' wildcard does work.

2 years ago[DllImportGenerator] Treat pointer fields in structs as blittable regardless of what...
Elinor Fung [Sat, 13 Nov 2021 03:08:39 +0000 (19:08 -0800)]
[DllImportGenerator] Treat pointer fields in structs as blittable regardless of what they point at (#61538)

2 years agoUpdate exception docs (#61278)
Genevieve Warren [Fri, 12 Nov 2021 23:47:55 +0000 (15:47 -0800)]
Update exception docs (#61278)

2 years agoFix optIsLoopEntry to skip removed loops (#61527)
Bruce Forstall [Fri, 12 Nov 2021 22:39:52 +0000 (14:39 -0800)]
Fix optIsLoopEntry to skip removed loops (#61527)

This was preventing block compaction with loop entry blocks in loops
that had been previously optimized away (and thus removed from the
loop table).

There are a few cases where we now delete dead code that was previously
left in the function. There are a number of spurious local weighting
and IG textual asm diffs changes, possibly due to how PerfScore is implemented
(there are some surprisingly large PerfScore changes in a few cases,
despite no change in (most) generated code).

2 years ago[mono][jit] Optimize calls to Type:get_IsValueType () on gshared constrained types...
Zoltan Varga [Fri, 12 Nov 2021 22:11:29 +0000 (17:11 -0500)]
[mono][jit] Optimize calls to Type:get_IsValueType () on gshared constrained types. (#61514)

These are used for example in Span<T>:.ctor ().

2 years ago[mono][jit] Optimize constrained calls to object.GetHashCode () where the receiver...
Zoltan Varga [Fri, 12 Nov 2021 19:47:49 +0000 (14:47 -0500)]
[mono][jit] Optimize constrained calls to object.GetHashCode () where the receiver is a gshared type constrained to a primitive type/enum. (#61513)

2 years agoRemove all DLLIMPORTGENERATOR_ENABLED usage. (#61476)
Aaron Robinson [Fri, 12 Nov 2021 19:08:39 +0000 (11:08 -0800)]
Remove all DLLIMPORTGENERATOR_ENABLED usage. (#61476)

* Remove all DLLIMPORTGENERATOR_ENABLED usage.

* Explicitly set EnableDllImportGenerator to true in test project.

2 years agoLock non localizable strings on regex resources (#61489)
Santiago Fernandez Madero [Fri, 12 Nov 2021 18:06:15 +0000 (10:06 -0800)]
Lock non localizable strings on regex resources (#61489)

2 years agoRemove explicit '.exe' extension from assembly names in ilproj tests (#61479)
Tomáš Rylek [Fri, 12 Nov 2021 17:41:55 +0000 (18:41 +0100)]
Remove explicit '.exe' extension from assembly names in ilproj tests (#61479)

2 years agoSystem.IO files cleanup (#61413)
Adam Sitnik [Fri, 12 Nov 2021 15:13:09 +0000 (16:13 +0100)]
System.IO files cleanup (#61413)

* Environment.SystemPageSize returns cached value

* we are no longer shipping MS.IO.Redist, so we can use Array.MaxLength directly

* we are no longer shipping MS.IO.Redist, there is no need for File to be partial

* we are no longer shipping MS.IO.Redist, there is no need for FileInfo to be partial

* there is no need for .Win32.cs and .Windows.cs file anymore

2 years ago[wasm] Add AppStart task to the bench Sample (#61481)
Radek Doulik [Fri, 12 Nov 2021 14:34:56 +0000 (15:34 +0100)]
[wasm] Add AppStart task to the bench Sample (#61481)

Measure browser app start times, 2 measurements implemented.

First to measure till the JS window.pageshow event, second to measure
time when we reach managed C# code.

Example ouput:

    | measurement | time |
    |-:|-:|
    |                    AppStart, Page show |   108.1400ms |
    |                AppStart, Reach managed |   240.2174ms |

2 years agoImplement Narrow and Widen using SIMDAsHWIntrinsic (#60094)
Tanner Gooding [Fri, 12 Nov 2021 04:32:49 +0000 (20:32 -0800)]
Implement Narrow and Widen using SIMDAsHWIntrinsic (#60094)

* Moving Narrow to implemented using SIMDAsHWIntrinsic

* Moving Widen to implemented using SIMDAsHWIntrinsic

* Fix some handling of Narrow/Widen hwintrinsics

* Ensure that Vector.Widen is still treated as an intrinsic

* Fixing NI_VectorT128_WidenUpper on ARM64 to actually call gtNewSimdWidenUpper

2 years agoXARCH: Remove redudant tests for GT_LT/GT_GE relops. (#61152)
anthonycanino [Fri, 12 Nov 2021 01:41:39 +0000 (17:41 -0800)]
XARCH: Remove redudant tests for GT_LT/GT_GE relops. (#61152)

* XARCH: Remove redudant tests for GT_LT/GT_GE relops.

We can now optimize cases such as `(x + y < 0)` or `for (int x = v; x >= 0; x--)`
using the flag tracking logic during the emit stage. Notably, cases that
would generate...

```
add     reg0, reg1
test    reg0, reg0
jge     LABEL
```

now transform to

```
add     reg0, reg1
jns     LABEL
```

This transform is valid for signed GE and signed LT only.

* Add a few asserts related to flag reuse optimizations.

2 years agoUpdating src/tests/Interop/PInvoke/Generics/GenericsNative.Vector* to annotate indivi...
Tanner Gooding [Thu, 11 Nov 2021 23:33:25 +0000 (15:33 -0800)]
Updating src/tests/Interop/PInvoke/Generics/GenericsNative.Vector* to annotate individual methods as requiring AVX (#61259)

* Updating src/tests/Interop/PInvoke/Generics/GenericsNative.Vector* to annotate individual methods as requiring AVX

* Always use __m256i on XARCH

2 years agoAdd PEM PKCS#8 and SPKI exports for AsymmetricAlgorithm
Kevin Jones [Thu, 11 Nov 2021 21:42:40 +0000 (16:42 -0500)]
Add PEM PKCS#8 and SPKI exports for AsymmetricAlgorithm

2 years agoAdd tests for metricseventsource HistogramLimitReached(#60752, #61199) (#61449)
Yusuke Ito [Thu, 11 Nov 2021 21:05:31 +0000 (06:05 +0900)]
Add tests for metricseventsource HistogramLimitReached(#60752, #61199) (#61449)

2 years agoEnable sourcelink in source-build for '.version' file (#60944)
Davis Goodin [Thu, 11 Nov 2021 19:48:08 +0000 (13:48 -0600)]
Enable sourcelink in source-build for '.version' file (#60944)

2 years agoRefine superpmi-replay trigger (#61469)
Bruce Forstall [Thu, 11 Nov 2021 19:41:38 +0000 (11:41 -0800)]
Refine superpmi-replay trigger (#61469)

Don't run if the JIT-EE GUID has changed, since there won't be any collections
to download, so the downloads will fail.

Also update the superpmi-asmdiffs trigger comment.

2 years agoUse DllImportGenerator in System.Diagnostics.PerformanceCounter (#61389)
Elinor Fung [Thu, 11 Nov 2021 16:18:30 +0000 (08:18 -0800)]
Use DllImportGenerator in System.Diagnostics.PerformanceCounter (#61389)

2 years ago[main] Update dependencies from 5 repositories (#61463)
dotnet-maestro[bot] [Thu, 11 Nov 2021 15:48:27 +0000 (16:48 +0100)]
[main] Update dependencies from 5 repositories (#61463)

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
2 years agoFix bug where we reference the entry #0 in the pinned plug queue (#60966)
Peter Sollich [Thu, 11 Nov 2021 15:02:07 +0000 (16:02 +0100)]
Fix bug where we reference the entry #0 in the pinned plug queue (#60966)

We reference entry #0 in the pinned plug queue even if there are no pinned plugs at all and thus the pinned plug queue contains left-over data from the mark phase.

The fix is to initialize saved_pinned_plug_index to a value that is invalid as a pinned plug queue index, and only use saved_pinned_plug_index as an index if  is valid.

2 years ago[Mono] Skip flaky android tests (#61460)
Simon Rozsival [Thu, 11 Nov 2021 14:10:34 +0000 (15:10 +0100)]
[Mono] Skip flaky android tests (#61460)

There are connectivity issues on some physical Android devices. We should disable the affected tests until the issue isn't resolved.

Ref #61343

2 years agoSome more precise debug info improvements (#61419)
Jakob Botsch Nielsen [Thu, 11 Nov 2021 11:00:35 +0000 (12:00 +0100)]
Some more precise debug info improvements (#61419)

* We were not recording precise info in inlinees except for at IL offset
  0 because most of the logic that handles determining when to attach
  debug info did not run for inlinees. There are no changes in what the
  EE sees since we were normalizing debug info back to the root anyway.

* Propagate debug info even further than just until rationalization, to
  make it simpler to dump the precise debug info. This means we create
  some more GT_IL_OFFSET nodes, in particular when the inlinee debug
  info is valid but the root info is invalid. This is currently
  happening for newobj IL instructions when the constructor is inlined.
  We generate two statements:
  GT_ASG(GT_LCL_VAR(X), ALLOCOBJ(CLS));
  GT_CALL(CTOR, GT_LCL_VAR(X))
  and the first statement ends up "consuming" the debug info, meaning we
  end up with no debug info for the GT_CALL, which eventually propagates
  into the inline tree. I have held off on fixing this for now since it
  causes debug info diffs in the data reported back to the EE.

  The additional nodes in LIR result in 0.15% more memory use and 0.015%
  more instructions retired for SPMI over libraries.

There is also a small fix in gtlist.h for GT_BFIZ when
MEASURE_NODE_SIZES is defined.

No SPMI diffs.

2 years agoInclude the "TargetingPack" folder in the mobile apps. (#61432)
Jeremy Koritzinsky [Thu, 11 Nov 2021 08:48:41 +0000 (00:48 -0800)]
Include the "TargetingPack" folder in the mobile apps. (#61432)

Fixes #61322
Fixes #61299

2 years agoClean up tests under Interop/PInvoke/BestFitMapping (#61390)
Elinor Fung [Thu, 11 Nov 2021 02:23:47 +0000 (18:23 -0800)]
Clean up tests under Interop/PInvoke/BestFitMapping (#61390)