Jan Jahoda [Mon, 20 Sep 2021 17:48:25 +0000 (10:48 -0700)]
Suppress SendPacketsElement_FileStreamMultiPartMixed_MultipleFileStreams_Success test on windows 11 (#59203)
Adeel Mujahid [Mon, 20 Sep 2021 17:46:34 +0000 (20:46 +0300)]
Ignore MSBuild_Logs/ directory (#59323)
This is a new directory used by msbuild for logging since https://github.com/dotnet/msbuild/commit/
cdb5077c451180ab38161e0b5e70f5448e70355b.
Elinor Fung [Mon, 20 Sep 2021 17:27:47 +0000 (10:27 -0700)]
Remove some unnecessary allocations / copies on startup (#59270)
SingleAccretion [Mon, 20 Sep 2021 16:40:42 +0000 (19:40 +0300)]
Delete dead code (#56865)
* Delete dead QMARK optimization
It is checking for both sides of GT_COLON being identical,
but QMARKs are only created in some very limited circumstances
today, and certainly not with identical then and else clauses.
No diffs.
* Delete dead code from fgSetTreeSeqHelper
QMARKs are rationalized before it is ever called.
Likewise, GT_INDs with "a special structure" are a thing of the past.
No diffs.
* Delete unused variable
* Delete unused impAssignSmallStructTypeToVar
* Delete unused gtIsVtableRef & getObjectHandleNodeFromAllocation
* Delete unused IsTreeAlwaysHoistable
* IsAddWithI32Const
* Delete unused Jit config values
* Delete unused fgEstimateCallStackSize
* Delete unused parameters in fgMorphStmts
* Delete unused StripExOp
SingleAccretion [Mon, 20 Sep 2021 16:35:25 +0000 (19:35 +0300)]
Refactor subrange assertion generation and propagation (#55186)
* Refactor subrange generation
Move it into its own function.
No diffs.
* Stop generating assertions for TYP_U/INT ranges
They are not useful: they do not tell us anything about the value.
They can be harmful: code operating on the assertions can wrongly
remove a checked cast because of an assertion for a non-checked one.
* Add the header for optTryExtractSubrangeAssertion
* Refactor subrange assertions
This change completely refactors the way subrange assertions are
generated and consumed. It rationalizes and generalizes the model
for subrange assertions which are generated and propagated for casts,
makes AssertionDsc::Range into an actual abstraction, eliminates bugs
related to wrong assertions generated for TYP_BOOL (without CQ loss),
enables propagation for checked casts to non-small types both on 64
and 32 bit, all the while making the AssertionDsc structure smaller.
There are quite a few moving parts, but at the heart of this change
are following items:
1. Make ranges symbolic, i. e. made up of symbolic upper and lower
bounds, represented by the new SymbolicIntegerValue enum class.
This is necessary to not regress memory consumption and throughput
of operations on 32 bit while handling long subranges.
2. Split the concept of "input" and "output" for a cast node.
To properly handle checked cast and make the code "obviously correct",
it is necessary to split the two values, one the cast node produces
and one it consumes, apart. The old code only handles the "easy" case
of the "input" and "output" ranges matching (such is the case for small
types), the new code must be, and is, robust in reasoning about, e. g.
CAST_OVF(uint <- ulong) vs CAST_OVF(int <- long). The ranges that
represent these values are consistently in the "signed" format, making
handling them easy.
3. Tweak the propagation code to not remove representation-changing casts,
make it explicit and obvious in what cases (and why) it retypes the
local under the cast.
As a side-effect of the above changes, TYP_BOOL is now treated as TYP_UBYTE
in propagation, as it should be. Actually, the old code didn't remove
redundant casts to TYP_BOOL, the new code does, which is also where the
bulk of the positive diffs come from.
The old code also generated "useless" ranges like [INT_MIN..INT_MAX], the new
code only generates ranges that could be used in subsequent propagation.
Also, some miscellaneous cleanup, such as adding function headers, was performed.
* Use correct ranges for global subrange assertions
In global assertion propagation, tentative assertions are
created for casts, with the expectation that proving them
via implication will allow for removing the cast.
The old code did this through the common path with local
assertions, however, this cannot be done the same way anymore
because the two types of assertions are fundamnetally different.
In local assertion propagation, subranges are derived from ASGs,
where the cast is on the RHS and the local - LHS, so the "output"
range for the cast must be used - local is assigned value the cast
**produces**.
In contrast, global subrange assertions say that the value the
cast **consumes** is within the correct bounds for the cast to
become a no-op or non-overflowing.
Because of this fundamnetal distinction, I chose to make global
assertions for casts in a new method instead of plumbing it
through "optCreateAssertion". Note that it would be possible to
do it via "optCreateAssertion" as well - global propagation
always passes OAK_SUBRANGE to it, while local - OAK_EQUAL, but
I decided against that option for the reason that it seems
unintuitive to me that it would work the way it would. These
tentative assertions are a very special case, so I think it is
better to treat them that way. This leads to some minor code
duplication, but I think that's ok.
No diffs for this commit, though that's expected as "proving"
the generated assertion is quite rare.
* Refactor AssertionDsc::Range into its own class
Make IntegralRange the owner of the logic for various
methods relating to it and decouple it from AssertionDsc.
IntegralRange will be useful in the future for other code
that deals with cast removal, e. g. in fgMorphCast.
Also some miscellaneous formatting fixups.
* Change the implementation of SymbolicToRealValue
Using a static array results in smaller and more
efficient code on all compilers.
* FP & GC castees in IntegralRange::ForCastOutput
This change is for completeness, since "fgMorphCast" decomposes
casts from FP types to small types today and as such assertions
are generated for them anyway.
No diffs for this commit as expected.
* Add the TYP_BOOL quirk
To avoid regressions.
* Fix the input ranges for non-overflowing casts
They did not handle "long" cases and as such were too conservative.
* Add missing function headers
* Remove a TODO now that BOX import has been fixed
* Use gtEffectiveVal & ChangeType to simplify code
* Fix build break
* Add a more detailed comment
* Tweak the comment
Vlad Brezae [Mon, 20 Sep 2021 16:05:45 +0000 (19:05 +0300)]
[mono][interp] Add checks for endfinally opcode (#59332)
* [interp] Add checks for endfinally opcode
Throw invalid IL if endfinally is not within a finally block.
* [tests] Re-enable test
Richard Šefr [Mon, 20 Sep 2021 15:35:58 +0000 (17:35 +0200)]
Use correct NumberStyle when parsing double and float (#59205)
* User correct NumberStyle when parsing double and float
IParseable<float> and IParseable<double> would fail when parsing
a decimal point number due to incorrect NumberStyles parameter.
E.g. IParseable<double>.TryParse would fail as opposed to
IParseable<double>.Parse because the former explicitly states to use
NumberStyles.Integer
* Adding tests covering parse for float/double/half
* Delete MSBuild_pid-37116_6904092b1c9a481da960c9e28eba2a27.failure.txt
Co-authored-by: Tanner Gooding <tagoo@outlook.com>
dotnet-maestro[bot] [Mon, 20 Sep 2021 15:07:13 +0000 (17:07 +0200)]
[main] Update dependencies from 4 repositories (#58999)
Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: Premek Vysoky <premek.vysoky@microsoft.com>
Přemek Vysoký [Mon, 20 Sep 2021 14:44:47 +0000 (16:44 +0200)]
Use PowerShell in Android arm64 XHarness Helix payloads (#59340)
Pavel Savara [Mon, 20 Sep 2021 11:11:13 +0000 (13:11 +0200)]
cmake list separator (#59317)
kronic [Mon, 20 Sep 2021 09:21:09 +0000 (12:21 +0300)]
Bring XmlReader{Async} to one behavior (#51736)
* Replace XmlUntypedStringConverter to XmlUntypedConverter
* Add more test
* add more tests
* remove unssoprt test
* feedback review
Co-authored-by: kronic <kronic@softland.ru>
Grégoire [Sun, 19 Sep 2021 22:59:37 +0000 (00:59 +0200)]
Fix indentation in api prososal template (#59318)
5 spaces were used when 4 is the convention.
dotnet bot [Sun, 19 Sep 2021 20:24:14 +0000 (13:24 -0700)]
Localized file check-in by OneLocBuild Task (#59286)
Nathan Ricci [Sun, 19 Sep 2021 03:45:04 +0000 (23:45 -0400)]
[MONO][WASM] Changed wasmapp.LocalBuild.props to use net6.0 (#59213)
Co-authored-by: Ankit Jain <radical@gmail.com>
Pavel Savara [Sat, 18 Sep 2021 15:40:21 +0000 (17:40 +0200)]
- reimplementation of BrowserWebSocket (#58199)
- CC0 notice for JavaScript queue
- feedback
Andrii Kurdiumov [Sat, 18 Sep 2021 14:00:07 +0000 (20:00 +0600)]
Cleanup defines in DirectoryServices.AccountManager (#59265)
Related to #39174
All defines does not used anywhere else and did not changed values.
From what I can find, they are from initial code dump
Michal Strehovský [Sat, 18 Sep 2021 05:47:04 +0000 (14:47 +0900)]
Make GCMemoryInfoData blittable (#58738)
The runtime side makes assumptions about the layout of this class, but since the class is not blittable, the runtime is free to reorder the fields however it sees fit (`StructLayout(LayoutKind.Sequential)` only affects the *managed* layout of blittable classes - it's not documented to do anything to the managed layout of non-blittable classes).
This prevents improvements to managed layout such as #51416.
Co-authored-by: Jan Kotas <jkotas@microsoft.com>
Andy Ayers [Sat, 18 Sep 2021 01:42:06 +0000 (18:42 -0700)]
JIT: update debug dumping for loop hoisting (#59287)
I kept adding stuff like this whenever I wanted to understand why hosting was
doing what it was doing, so figured it likely had lasting value.
Alex Covington [Sat, 18 Sep 2021 01:12:03 +0000 (18:12 -0700)]
Use AVX2 in codegen for GT_STORE_BLK (#55604)
* Saving current state, current state does not currently pass tests
* Getting available vector register size from compiler instance instead, resolves failing tests.
* Emit vzeroupper if there is potentially an AVX-SSE transition
* Copy remainder using same tempReg allocated during SIMD moves instead of allocating a GPR
* Better guard for maximum SIMD register size
* Fix typo
* Remove commented out lines
* Insert vzeroupper if using AVX2
* Add another vzeroupper
* Remove vzeroupper, inserting the instruction hurts performance
* Adding vzeroupper again for testing
* Remove debug lines
* Add assert before copying remaining bytes, change regSize condition to depend on AVX, remove vzeroupper inserts.
* Fix typo
* Added check to ensure size is not 0 to prevent allocating register for structs of size 0.
* Using YMM registers during init block if block is large enough
* Add some comments
* Formatting
* Rename remainder variable to shiftBack, better describes the logic for the block.
* Use shift-back technique for init block as well.
* Add assert for init block
* Use xmm register to move remainder if it fits, shift-back for GPR for remainder instead of step-down
* Use xmm in init block for remainder if it is an appropriate size, shift-back for GPR in init instead of step-down register size
* Avoid allocating GPR during LSRA for BlkOpKindUnroll
* Remove shift-back of GPR for remainder, added back the step-down to resolve test failures on x86
* Shift-back GPR when handling remainder for AMD64 only
SingleAccretion [Sat, 18 Sep 2021 00:26:04 +0000 (03:26 +0300)]
Fix a minor assert issue in long decomposition (#57326)
* Add test
* Fix the issue
Rotation decomposition was risking hitting an
assert in LIR::Use::ReplaceWithLclVar when it
was removing the gtLong node from the linear
order too early.
* Revert "Add test"
No point testing what is not a correctness issue.
* Fix the same issue in shift decomposition as well
t-mustafin [Sat, 18 Sep 2021 00:21:31 +0000 (03:21 +0300)]
Fix x86 linux tests build and run (#57244)
[unix x86] Fix tests build
[unix x86] Add register map for crossgen2
Fixes readytorun/coreroot_determinism/coreroot_determinism/coreroot_determinism.sh on x86 linux
[unix x86] Fix tail calls tests
[unix x86] Fix unmanaged callconv
[unix x86] Fix passing implicit args via stack
[unix x86] Pop hidden retbuff arg on cdecl callconv
[unix x86] Fix WriteBarrier call
[x86] Add calling convention name print to dump
[x86] Use ebx to pass VASigCookie to GenericPInvokeCalliHelper
It fixes stack alignment in GenericPInvokeCalliHelper on unix x86
Fix storageType overflow assertion in TinyArray
Robin Lindner [Fri, 17 Sep 2021 23:31:07 +0000 (01:31 +0200)]
Expose nint/nuint overloads for BitOperations (#58733)
* Change access modifier of BitOperations.IsPow2
* Add CLSCompliant(false) attribute to BitOperations.IsPow2
* Add BitOperations.RoundUpToPowerOf2 method for nuint
* Add BitOperations.LeadingZeroCount method for nuint
* Add BitOperations.Log2 method for nuint
* Add BitOperations.PopCount method for nuint
* Add BitOperations.TrailingZeroCount for nint and nuint
* Add BitOperations.RotateLeft and BitOperations.RotateRight for nuint
* Replace Environment.Is64BitProcess check with preprocessor variable TARGET_64BIT and reimplement accidentally removed comment
* Fix formatting
* Remove last Environment.Is64BitProcess check
* Add tests
* Remove [CLSCompliant(false)] Attribute from BitOperations which use nint (not nuint)
* Add refs
* Add refs
* Fix RotateLeft and RotateRight test
* Add IgnoreOnArchitectureTheoryAttribute and remove checks for not existing preprocessor variable
* Replace custom TheoryAttribute with ConditionalTheory
* Add unchecked syntax due CS8778
* Fix parameter type in BitOperationsTests.BitOps_RoundUpToPow2_nuint_64
* Fix Test values
* Fix expectation parameter
* Fix 32-bit expectation
* Fix 32-bit test
Michal Strehovský [Fri, 17 Sep 2021 23:27:29 +0000 (08:27 +0900)]
Get rid of ModuleDesc.GetTypeResolutionFailure (#59249)
`ModuleDesc.GetTypeResolutionFailure` is bug prone (see #50845). It feels easier to just have `ModuleDesc.GetType` return `object`.
Most consumer will want to just call a helper that returns `MetadataType` and takes a `bool` though.
Jo Shields [Fri, 17 Sep 2021 20:52:43 +0000 (16:52 -0400)]
Work around for forbidden "Roslyn4.0" in test name on Android (#59263)
Android apk names must be valid Java class names, and It is forbidden in Java for a class name component to have a leading numeric digit. So whilst "net.dot.foo3_1" is legal, "net.dot.foo3.1" is illegal. Use a Regex to detect and rewrite all cases of this in AndroidAppBuilder
SingleAccretion [Fri, 17 Sep 2021 20:19:18 +0000 (23:19 +0300)]
Allow folding of `LONG` nodes with field sequences (#57605)
* Allow folding of LONG nodes with field sequences
Apparently, such folding was disallowed, for unclear reasons
likely pertaining to the fact that "gtFoldExprConst" is very old.
* Drop the special case from fgMorphCommutative
Eric StJohn [Fri, 17 Sep 2021 19:39:10 +0000 (12:39 -0700)]
Only set path in x64 mac installer when installing on x64 (#59210)
* Only set path in x64 mac installer when installing on x64
In other words don't set the path for x64 installer on ARM64
* Remove postinstall script from hostfxr
There should be no need for both the host and hostfxr to set the path to dotnet.
Since the host installs dotnet, it should be the only package responsible for this.
* Make postinstall set install_location on mac
Also refactor script to use a template so that we don't need to fork the script.
* fix some syntax errors in script
* Update src/installer/pkg/sfx/installers/dotnet-host.proj
Co-authored-by: Adeel Mujahid <3840695+am11@users.noreply.github.com>
* Refine uname regular expressions
Co-authored-by: Adeel Mujahid <3840695+am11@users.noreply.github.com>
Zoltan Varga [Fri, 17 Sep 2021 19:29:02 +0000 (21:29 +0200)]
[mono] Remove some of the restrictions on constrained calls from (#59182)
* [mono] Remove some of the restrictions on constrained calls from
gsharedvt methods.
Fixes https://github.com/dotnet/runtime/issues/58204.
* Reenable tests.
Kevin Jones [Fri, 17 Sep 2021 17:02:16 +0000 (13:02 -0400)]
Refactor symmetric one-shots for improved performance
This refactors the symmetric one shots to do less work. This removes the
calls to Reset for the one shots since the cipher will not be reused,
and in the Unix cases, removes keeping a copy of the IV around.
Aleksey Kliger (λgeek) [Fri, 17 Sep 2021 16:35:48 +0000 (12:35 -0400)]
[interp] Add wide data item index static load and stores (#59220)
Add `ldsdfld.w` and `stsfld.w` opcodes to the interpreter. These are needed for some machine-generated methods in Android projects that use AndroidX, MAUI, SkiaSharp or other toolkits. The app's `Resource::UpdateIdValues` can grow to exceed 64k interpreter data items, which means that 16-bit data item indices will roll over.
A typical snippet from the method body:
```
IL_8413: ldc.i4 0x7f0f02fc
IL_8418: stsfld int32 [Microsoft.Maui.Controls.Compatibility]Microsoft.Maui.Controls.Compatibility.Resource/Style::Widget_MaterialComponents_Toolbar_Surface
IL_841d: ldc.i4 0x7f0f02fd
IL_8422: stsfld int32 [Microsoft.Maui.Controls.Compatibility]Microsoft.Maui.Controls.Compatibility.Resource/Style::Widget_MaterialComponents_Tooltip
IL_8427: ldc.i4 0x7f0f02fe
IL_842c: stsfld int32 [Microsoft.Maui.Controls.Compatibility]Microsoft.Maui.Controls.Compatibility.Resource/Style::Widget_Support_CoordinatorLayout
IL_8431: ldsfld int32[] TestApp.Resource/Styleable::ActionBar
IL_8436: stsfld int32[] [Microsoft.Maui.Controls.Compatibility]Microsoft.Maui.Controls.Compatibility.Resource/Styleable::ActionBar
IL_843b: ldsfld int32[] TestApp.Resource/Styleable::ActionBarLayout
IL_8440: stsfld int32[] [Microsoft.Maui.Controls.Compatibility]Microsoft.Maui.Controls.Compatibility.Resource/Styleable::ActionBarLayout
IL_8445: ldc.i4.0
IL_8446: stsfld int32 [Microsoft.Maui.Controls.Compatibility]Microsoft.Maui.Controls.Compatibility.Resource/Styleable::ActionBarLayout_android_layout_gravity
```
The "wide" opcodes use 32-bit data item indices.
Resolves https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1398069
* [interp] Add stsfld.w interpreter opcode
For methods that require more than 64k data items, add a variant stsfld instruction that stores data item indices as 32-bit integers instead of 16-bit.
To solve this problem in general, we need wide variants of more opcodes, but for specific (machine generated) methods, a wide stsfld instruction is sufficient.
* Add ldsfld.w opcode
* [mono] Log debug message when running .cctors
* Address review feedback
Use stackval_from_data and stackval_to_data instead of memcpy.
Don't duplicate code get_data_item_wide_index.
Only use the wide opcodes if any of the data item indices of a given instruction need it, not just when the method total number of indices overflows.
* Fix wide index boundary conditions
Tom Deseyn [Fri, 17 Sep 2021 15:46:12 +0000 (17:46 +0200)]
Remove mostly unused SafeFileHandleHelper.Unix class (#59254)
Tomas Weinfurt [Fri, 17 Sep 2021 15:10:19 +0000 (08:10 -0700)]
update crossfs for FreeBSD 12.2 (#59240)
Vlad Brezae [Fri, 17 Sep 2021 14:07:09 +0000 (17:07 +0300)]
[interp] Disable optimization if the var index is greater than G_MAXUINT16 (#59225)
We store the var index in the guint16 slots of the instruction
Aleksey Kliger (λgeek) [Fri, 17 Sep 2021 13:01:13 +0000 (09:01 -0400)]
[docs] Add instructions for debugging native runtime code on Android (#59183)
Tom Deseyn [Fri, 17 Sep 2021 10:44:18 +0000 (12:44 +0200)]
File.Unix: save a syscall on the File.{Write*,Append*} methods. (#59247)
FileOptions.SequentialScan tunes the kernel read ahead. Since we're writing
the whole file it doesn't bring anything, and it costs us a syscall on Unix.
kronic [Fri, 17 Sep 2021 10:25:11 +0000 (13:25 +0300)]
Refactor XmlWriter{Async} (#58105)
* Refactor XmlWriter
* Refactor XmlWriterAsync
* -
* review feedback
Co-authored-by: kronic <kronic@softland.ru>
Peter Sollich [Fri, 17 Sep 2021 06:49:42 +0000 (08:49 +0200)]
Fix ro segments with regions (#58811)
There were a couple places in the mark and relocation phases where the regions logic couldn't cope with objects outside of the memory range reserved for the GC heap. These objects may occur in read-only segments (but only if FEATURE_BASICFREEZE is enabled).
The check for objects within the address range reserved for the GC is centralized in helper is_in_heap_range. If FEATURE_BASICFREEZE is enabled, this helper checks that the object is actually in the address range for the heap, otherwise a simple check for non-null is sufficient. There are asserts to make sure that objects are either null, in range, or in a read-only segment if FEATURE_BASICFREEZE is enabled.
dotnet-maestro[bot] [Fri, 17 Sep 2021 06:32:41 +0000 (06:32 +0000)]
[main] Update dependencies from 8 repositories (#59195)
[main] Update dependencies from 8 repositories
Stephen Toub [Fri, 17 Sep 2021 05:17:35 +0000 (01:17 -0400)]
Fix corner-case handling of cancellation exception in ForEachAsync (#59065)
* Fix corner-case handling of cancellation exception in ForEachAsync
If code in Parallel.ForEachAsync throws OperationCanceledExceptions containing the CancellationToken passed to the iteration and that token has _not_ had cancellation requested (so why are they throwing with it) and there are no other exceptions, the ForEachAsync will effectively hang after failing to complete the task returned from it.
The issue stems from how we treat cancellation. If the user-supplied token hasn't been canceled but we have OperationCanceledExceptions for the token passed into the iteration (the "internal" token), it can only have been canceled because an exception occurred. We filter out these cancellation exceptions, leaving just the exceptions that are deemed to have caused the failure in the first place. But the code doesn't currently account for the possibility that the developer is (arguably erroneously) throwing such an OperationCanceledException with the internal cancellation token as that root failure. The fix is to only filter out these OCEs if there are other exceptions besides them.
* Stop filtering out cancellation exceptions in Parallel.ForEachAsync
Layomi Akinrinade [Fri, 17 Sep 2021 04:18:23 +0000 (21:18 -0700)]
Update source-gen APIs according to review (#59042)
* Update source-gen APIs according to review
* Rename fast-path func name and add src-gen/JsonNode interop support
* Address review feedback
* Disable src-gen tests in browser target OS
Jason Pugsley [Fri, 17 Sep 2021 01:21:57 +0000 (11:21 +1000)]
FreeBSD fix for AF_UNIX IPC socket permission (#58688)
FreeBSD does not support changing AF_UNIX socket permissions with
chmod()/fchmod() so use the same umask() method as __APPLE__ builds.
SingleAccretion [Thu, 16 Sep 2021 23:46:52 +0000 (02:46 +0300)]
Improve morphing of comparisons (#54204)
* Add SetIntegralValue helper to GenTreeIntCommon
* Fix a potential CSE issue
* Enable comparisons against GT_CNS_LNG
* Optimize unsigned compares with int/long.MaxValue
Replace LE_UN/GT_UN(OP, int/long.MaxValue) with GE/LT(OP, 0)
as that generates smaller code on all targets.
* Relocate fgOptimizeRelationalComparisonWithConst
So that it is next to fgOptimizeEqualityComparisonWithConst.
Purely cosmetic change.
* Use the fgUpdateConstTreeValueNumber helper
* Fix formatting...
Ankit Jain [Thu, 16 Sep 2021 23:38:26 +0000 (23:38 +0000)]
[wasm] Add support for native relinking after Build, and… (#59153)
… AOT after publish (#58913)
Forward port #58913
(cherry picked from commit f38d58f)
Andrii Kurdiumov [Thu, 16 Sep 2021 22:54:55 +0000 (04:54 +0600)]
Fix link (#59200)
Andrii Kurdiumov [Thu, 16 Sep 2021 22:53:54 +0000 (04:53 +0600)]
Remove usused rd.xml files (#59201)
Closes #51112
Bruce Forstall [Thu, 16 Sep 2021 22:28:44 +0000 (15:28 -0700)]
Disable the clrinterpreter pipeline schedule (#59229)
Allan Targino [Thu, 16 Sep 2021 22:27:53 +0000 (19:27 -0300)]
Failing test for DI's site call factory cache (#59164)
* adding failing test for issue #57333
* using public api for di callsite test
* Update src/libraries/Microsoft.Extensions.DependencyInjection/tests/DI.Tests/CallSiteTests.cs
Co-authored-by: Eric Erhardt <eric.erhardt@microsoft.com>
xiabin [Thu, 16 Sep 2021 20:54:22 +0000 (04:54 +0800)]
support FEATURE_INTERPRETER on linux-x64 (#59137)
* Fix compile issue with interpreter.cpp
* implement FEATURE_INTERPRETER under linux-x64
Carlos Sanchez [Thu, 16 Sep 2021 20:11:04 +0000 (13:11 -0700)]
Bump intellisense version to RC1 (main) (#59115)
* Bump intellisense version to RC1
* Use package pushed to correct feed (dotnet6-transport)
Co-authored-by: carlossanlop <carlossanlop@users.noreply.github.com>
Miha Zupan [Thu, 16 Sep 2021 19:11:08 +0000 (12:11 -0700)]
Implement UriCreationOptions (#59173)
* Add UriCreationOptions
Includes DangerousDisablePathAndQueryCanonicalization
* Add /// comments
Adeel Mujahid [Thu, 16 Sep 2021 18:35:27 +0000 (21:35 +0300)]
Update gcc CI to use gcc-11 container (#59202)
Adeel Mujahid [Thu, 16 Sep 2021 17:40:24 +0000 (20:40 +0300)]
Use getpwuid(3) in corehost for the $HOME-less user (#59036)
In other parts of dotnet/runtime repo <sup>[[1](https://github.com/dotnet/runtime/blob/
57bfe474518ab5b7cfe6bf7424a79ce3af9d6657/src/libraries/Native/Unix/System.Native/pal_networking.c#L3038-L3056)] [[2](https://github.com/dotnet/runtime/blob/
57bfe474518ab5b7cfe6bf7424a79ce3af9d6657/src/libraries/System.Private.CoreLib/src/System/IO/PersistedFiles.Unix.cs#L125-L137)] [[3](https://github.com/dotnet/runtime/blob/
57bfe474518ab5b7cfe6bf7424a79ce3af9d6657/src/libraries/Native/Unix/System.Native/pal_uid.c#L65-L68)]</sup>, we attempt to retrieve user home directory from `getpwuid_r` when the environment variable `HOME` is not set. Use the same fallback in corehost.
Pent Ploompuu [Thu, 16 Sep 2021 16:59:34 +0000 (19:59 +0300)]
Use unsigned casts for array/Span indexers (#57970)
* Improve TP for Span_get_Item
* Use unsigned casts for array length/index
* Use unsigned cast for Span_get_Item
Vladimir Sadov [Thu, 16 Sep 2021 16:53:04 +0000 (09:53 -0700)]
Do not use copy-on-write on windows (#59033)
Adeel Mujahid [Thu, 16 Sep 2021 16:29:00 +0000 (19:29 +0300)]
Share init-compiler with arcade (#59018)
* Share init-compiler with arcade
* Fixup merge conflict
* typo
Steve Pfister [Thu, 16 Sep 2021 16:14:14 +0000 (12:14 -0400)]
[iOS] Make sure IPGlobalProperties and NetworkInterface.GetIsNetworkAvailable methods return the correct info (#57096)
This change makes sure some of the IPGlobalProperties stop throwing exceptions and return the correct values.
GetIPv4GlobalStatistics, GetIcmpV4Statistics, GetTcpIPv4Statistics, GetUdpIPv4Statistics no longer throw NetworkInformationException.
GetActiveTcpConnections no longer returns TcpConnectionInformation instances only with the State of Unknown.
GetActiveTcpListeners return the correct IPEndPoint details for the IPV6 loopback.
NetworkInterface.GetIsNetworkAvailable no longer returns false for every call.
The reason these methods were behaving incorrectly on iOS is due to Apple not including the public headers for icmp_var.h, ip_var.h, tcp_fsm.h, if_media.h, and udp_var.h in the iOS SDK. This would lead to, for example, pal_tcpstate.c always returning TcpState_Unknown even if the underlying native value was TCPS_ESTABLISHED. This change includes the missing public headers in our build.
Fixes #36890
Radek Doulik [Thu, 16 Sep 2021 11:48:11 +0000 (13:48 +0200)]
[wasm] Unify BuildWasmRuntimes target and use cmake (#58878)
Add new cmake file to build native parts of `BuildWasmRuntimes` target. That unifies the build on windows and mac/linux.
Implements https://github.com/dotnet/runtime/issues/51553
* [wasm] Add cmake file for runtime native build
* Use the new cmake file
* Set the emcc configuration flags
The ninja generator is not multi-configuration cmake generator, so we
have to pass them from msbuild
* Update Makefile
* Fix few build issues
* Copy ICU files to native bin dir
* Copy source files to native bin dir
* Copy required header file
* Make all settings target specific
Juan Hoyos [Thu, 16 Sep 2021 11:35:56 +0000 (04:35 -0700)]
Undo breaking change compat in GetMethodNativeMap (#59114)
* Undo breaking change compat when adding tiered aware behaviors to obtaining IL -> native maps.
monojenkins [Thu, 16 Sep 2021 07:14:56 +0000 (03:14 -0400)]
Fix ordinal imports on Windows. (#54808)
Co-authored-by: madewokherd <madewokherd@users.noreply.github.com>
Theodore Tsirpanis [Thu, 16 Sep 2021 06:48:06 +0000 (09:48 +0300)]
Remove legacy light-up code from `System.Reflection.Metadata` et.al. (#56587)
* Remove legacy light-up code for the pointer-based Encoding.GetString.
* Remove legacy light-up code for the memory-mapped file block code.
* Remove FileStreamLightUp.IsFileStream and the need for it.
* Address PR feedback.
* Use hardware-accelerated population count where available.
* Remove a try/finally with an empty try where CERs are not supported.
* Use named arguments when constructing a memory-mapped file.
Michal Strehovský [Thu, 16 Sep 2021 06:35:58 +0000 (15:35 +0900)]
Move Android SDK logic to /eng (#58700)
WizardBrony [Thu, 16 Sep 2021 06:33:48 +0000 (01:33 -0500)]
Remove a volatile access from TaskScheduler.Id (#58991)
Dan Moseley [Thu, 16 Sep 2021 06:29:44 +0000 (00:29 -0600)]
Update area-owners.md (#59131)
Filip Navara [Thu, 16 Sep 2021 06:28:25 +0000 (08:28 +0200)]
[MonoVM] Reduce P/Invoke GC transition asserts in release builds (#59029)
Ankit Jain [Thu, 16 Sep 2021 01:20:58 +0000 (01:20 +0000)]
[main] WasmAppBuilder: Use $(CopyLocalLockFileAssemblies) instead of … (#59181)
Michal Strehovský [Thu, 16 Sep 2021 01:18:28 +0000 (10:18 +0900)]
Fix BinSkim warnings in System.IO.Compression.Native.dll (#59188)
Koundinya Veluri [Wed, 15 Sep 2021 23:18:48 +0000 (16:18 -0700)]
Harden native gate thread against affinity mask growth (#59129)
Hardened ThreadpoolMgr::GateThreadStart against the possibility that the observed group-local affinity mask contains set bits at positions higher than the total group-local CPU count that was captured during earlier initialization.
This fixes customer-reported crashes which have occurred on multi-group machines with heterogenous CPU counts across groups (but the same crash can probably also occur on single-group VMs if CPUs are hot-added and are then manually added to the process affinity mask).
Matt Mitchell [Wed, 15 Sep 2021 22:36:05 +0000 (15:36 -0700)]
Set the publishing infra version to 3 (#59165)
Before this was not important because runtime was calling its own publishing tasks with the property explicitly set, but since the introduction of arcade powered source build this property is needed to avoid ArPow from defaulting to v2.
David Fowler [Wed, 15 Sep 2021 22:33:48 +0000 (15:33 -0700)]
Fix race condition with cancellation tokens in Read/Flush operations (#59090)
* Fix race condition with cancellation tokens in Read/Write operations
- There's a tight race where UnsafeRegister can fire inline and then ReadAsync never completes. This is because the cancellation token property has not been assigned yet so the callback noops. This change checks the result of the UnsafeRegister operation to see if ran synchronously and throws if it did. We also move any state transitions to after these checks to make sure the PipeAwaitable state doesn't change before throwing.
* Add a debug assert to make sure there's no state change.
* Add if debug
* More if DEBUG
Drew Scoggins [Wed, 15 Sep 2021 22:07:26 +0000 (15:07 -0700)]
Change channel passed to ci_setup to track runtime branch (#59070)
With this change we move to specifing the channel that is passed to ci_setup,
instead of it always being main. The allows us to have the runtime branch
help decide the correct version of the sdk that we should pull down with
dotnet-install. This means that going forward, we will need to have channels
that match the names of all branches that we plan to run from the runtime
side. If we do not, the sdk installation step will fail during ci_setup.
Fan Yang [Wed, 15 Sep 2021 22:07:03 +0000 (18:07 -0400)]
Fix env var syntax (#59169)
Mikhail Filippov [Wed, 15 Sep 2021 21:14:06 +0000 (00:14 +0300)]
Fix StackOverflowException in Crossgen2 when assemblies has circular … (#58268)
* Fix StackOverflowException in Crossgen2 when assemblies has circular dependencies in exported types.
* Update EcmaModule.cs
Co-authored-by: Michal Strehovský <MichalStrehovsky@users.noreply.github.com>
Andy Ayers [Wed, 15 Sep 2021 21:11:03 +0000 (14:11 -0700)]
JIT: simple VN budget stress mode (#59051)
Under jit stress, randomly set the VN memory disambiguation budget to a
smaller value, to try better and expose issues like #58877.
Prashanth Govindarajan [Wed, 15 Sep 2021 18:54:05 +0000 (11:54 -0700)]
Runtime changes for DetectPreviewFeaturesAnalyzer (#59062)
* Turn on DetectPreviewFeaturesAnalyzer and runtime changes
* Missed decimal
* Add comments and update S.Runtime.csproj
* sq
* sq
Eirik Tsarpalis [Wed, 15 Sep 2021 18:20:07 +0000 (19:20 +0100)]
Remove exception messages from resource strings (#59104)
* remove exception messages from resource strings
* fix alphabetical ordering
Jo Shields [Wed, 15 Sep 2021 16:59:00 +0000 (12:59 -0400)]
Create and publish missing symbols (#58866)
* Fix symbols for Microsoft.MonoTargets.Sdk
* Build and include .pdb file on Windows builds of mono-aot-cross
* Output directly "mono-aot-cross.exe", don't rename "mono-sgen.exe"
Kevin Jones [Wed, 15 Sep 2021 16:33:45 +0000 (12:33 -0400)]
Require UTF8 encoding in GetX509NameInfo.
David Wrighton [Wed, 15 Sep 2021 15:34:08 +0000 (08:34 -0700)]
Add dependency graph viewer tool (#55304)
* Add dependency graph viewer tool
- This is a minimally functional tool used to view the dependency graphs produced by crossgen2
- This was previously present in the CoreRT repo, but did not make the transition to this repo when the type system was moved
* Code review comments
Kunal Pathak [Wed, 15 Sep 2021 14:23:52 +0000 (07:23 -0700)]
Arm64: Fix perfscore and display logic for LARGELDC (#59134)
Tomas Weinfurt [Wed, 15 Sep 2021 13:13:48 +0000 (06:13 -0700)]
disable tests unstable on Windows 11 (#59135)
Eric StJohn [Wed, 15 Sep 2021 12:55:16 +0000 (05:55 -0700)]
Add SetLastError to GdiPlus methods (#59096)
System.Drawing uses the last Win32 error in CheckErrorStatus to try to
guess at why a GdiPlus draw method failed and ignore some failures.
This was broken in .NETCore when SetLastError was removed from PINvokes.
Bring back SetLastError for all PInvokes that use CheckErrorStatus.
Zoltan Varga [Wed, 15 Sep 2021 06:51:59 +0000 (08:51 +0200)]
[mono] Remove duplicates from the AOT data blob. (#58982)
Kunal Pathak [Wed, 15 Sep 2021 05:10:14 +0000 (22:10 -0700)]
Relax assert to check for simd8 or return type (#58966)
Kunal Pathak [Wed, 15 Sep 2021 04:19:48 +0000 (21:19 -0700)]
Initialize compCurBB during fgInsertGCPoll (#57334)
* Initialize compCurBB during InsertGCPoll
* Update src/coreclr/jit/flowgraph.cpp
Co-authored-by: Egor Bogatov <egorbo@gmail.com>
* minor fix
* fix inifinite loop
* return 100
Co-authored-by: Egor Bogatov <egorbo@gmail.com>
Tomas Weinfurt [Wed, 15 Sep 2021 03:12:23 +0000 (20:12 -0700)]
fix SendAsync from inpersonificated context with default credentials (#58922)
* fix SendAsync from inpersonificated context and default credentials
* add missing file
* remove dead code
* feedback from review
* name cleanup
Kunal Pathak [Wed, 15 Sep 2021 01:16:27 +0000 (18:16 -0700)]
Change back to net6.0 (#59130)
imhameed [Tue, 14 Sep 2021 21:14:08 +0000 (17:14 -0400)]
[mono] Use SROA-friendly struct type declarations (#59007)
LLVM's SROA can decompose loads and stores of aggregate type into a
sequence of aggregate-element-typed loads and stores. Before this
change, Mono translated .NET-level value types into LLVM IR-level
structs containing nothing but `i8` elements.
When a value type field has reference type, and a value of this value
type is copied using a `memcpy` intrinsic or an LLVM IR load followed by
a store, LLVM will emit code that loads managed references in multiple
byte-sized fragments before reconstructing the original pointer using a
sequence of ALU ops. This causes sgen to fail to pin the referent.
This change works around this by translating value types to LLVM IR
structs with pointer-sized fields. Packed value types with non-standard
alignment will be translated into LLVM IR structs containing
alignment-sized fields.
Note that this does not completely guarantee that the code we generate
will respect sgen's requirements. No specific guarantees are provided
about the translation of non-atomic LLVM IR loads and stores to machine
code. And we'll need some alternative means (perhaps a special
`gc_copy_unaligned` runtime call or similar) to copy packed or
misaligned value types that contain managed references. For stronger
LLVM IR-level guarantees, we'll want to make use of unordered atomic
loads and stores and unordered atomic memcpy, but that work is out of
scope for this change.
Fixes #58062, but see the previous paragraph for caveats.
See:
- https://github.com/dotnet/llvm-project/blob/release/11.x/llvm/lib/Transforms/Scalar/SROA.cpp#L3371-L3388
- https://github.com/dotnet/llvm-project/blob/release/11.x/llvm/lib/Transforms/Scalar/SROA.cpp#L3327-L3340
Andrew Au [Tue, 14 Sep 2021 21:04:16 +0000 (14:04 -0700)]
Eliminate PROJECTK_BUILD from RF (#59057)
imhameed [Tue, 14 Sep 2021 20:40:48 +0000 (16:40 -0400)]
[mono] Update attribute name used for controlling frame pointer elimination (#59069)
LLVM 8 introduced `"frame-pointer"="all"` as a substitute for
`"no-frame-pointer-elim"="true"`. LLVM 10 outright removed
`"no-frame-pointer-elim"`.
Fixes https://github.com/dotnet/runtime/issues/58998.
Anirudh Agnihotry [Tue, 14 Sep 2021 20:25:09 +0000 (13:25 -0700)]
Use arcade power source build infra (#58651)
* add yml files
* add file version and condition package reference on source build
* to avoid copying the file from the cache
Jan Vorlicek [Tue, 14 Sep 2021 19:59:55 +0000 (21:59 +0200)]
Change macOS activatin injection failure handling (#59045)
The pthread_kill can fail with ENOTSUP on macOS when the target thread
is a dispatch queue thread. Instead of aborting the process, it is
better to fail to inject the activation and rely on return address
hijacking and other means of syncing with GC.
Bar Arnon [Tue, 14 Sep 2021 19:32:22 +0000 (22:32 +0300)]
Elide SocketFlags in Socket API (#57634)
* Elide SocketFlags in Socket API
Fix #43934
* Fix SocketAsyncEventArgs tests
* Cosmetics
* Elide SocketFlags in tests
* Comments
Daniel Genkin [Tue, 14 Sep 2021 18:31:21 +0000 (14:31 -0400)]
[WASM] Enabled strict mode on all JS files (#54011)
"use strict" for all wasm JavaScript
Co-authored-by: Daniel Genkin <t-dgenkin@microsoft.com>
Co-authored-by: Pavel Savara <pavelsavara@microsoft.com>
Adam Sitnik [Tue, 14 Sep 2021 15:27:44 +0000 (17:27 +0200)]
Extend MemoryCacheOptions with TrackLinkedCacheEntries (#57648)
* add the property to reference assembly
* update tests
* implementation
* Apply suggestions from code review
Co-authored-by: Stephen Toub <stoub@microsoft.com>
* Apply suggestions from code review
Co-authored-by: Eric Erhardt <eric.erhardt@microsoft.com>
* update comment
Co-authored-by: Stephen Toub <stoub@microsoft.com>
Co-authored-by: Eric Erhardt <eric.erhardt@microsoft.com>
Eirik Tsarpalis [Tue, 14 Sep 2021 14:40:21 +0000 (15:40 +0100)]
Fix broken API proposal template link (#59083)
Eirik Tsarpalis [Tue, 14 Sep 2021 14:23:52 +0000 (15:23 +0100)]
Add missing docs to System.Text.Json (#59053)
Eirik Tsarpalis [Tue, 14 Sep 2021 14:22:41 +0000 (15:22 +0100)]
Add missing System.Linq API docs (#59038)
Steve Pfister [Tue, 14 Sep 2021 13:49:54 +0000 (09:49 -0400)]
Use caching ConsoleStream for both iOS and Android (#58967)
Expands on #56713 by moving the caching implementation to a separate internal class leaving only the interop calls in ConsolePal.iOS and ConsolePal.Android
Fixes https://github.com/dotnet/runtime/issues/57304
Eric Erhardt [Tue, 14 Sep 2021 12:12:45 +0000 (06:12 -0600)]
UpdateJson and CompilerServices.Unsafe versions (#59067)
This unblocks the SDK ingestion now that we are targeting net7.0. Microsoft.NET.HostModel needs to update 7.0 versions of these libraries.
Adam Sitnik [Tue, 14 Sep 2021 11:30:39 +0000 (13:30 +0200)]
Align preallocationSize behavior (#58726)
Co-authored-by: Stephen Toub <stoub@microsoft.com>
Eric Erhardt [Tue, 14 Sep 2021 03:05:45 +0000 (21:05 -0600)]
Multi-target Json and Logger Source Generators between Roslyn v3.11 and v4.0 (#58446)
* Multi-target LoggerMessageGenerator between Roslyn v3.11 and v4.0
* Include a .targets file in NuGet packages which will select the correct analyzer assembly depending on which Roslyn version will be used to compile.
* Multi-target JsonSourceGenerator between Roslyn v3.11 and v4.0
* Fix restore
* Update NuGet package MSBuild logic to detect when SupportsRoslynComponentVersioning is not available, and use the lowest analyzer available.
* Handle non-SDK projects by running after ResolveNuGetPackageAssets
* Respond to PR feedback
- Name .cs and .csproj files with Roslyn in the name
- Upgrade to Roslyn 3.11 so IsExplicitlyNamedTupleElement API is available
- Fix some references to the test projects
- Fix incremental pack of the analyzer targets