platform/upstream/dotnet/runtime.git
19 months agoUpdate owners and fabricbot (#83732)
Arthur Vickers [Wed, 22 Mar 2023 18:27:30 +0000 (18:27 +0000)]
Update owners and fabricbot (#83732)

19 months agoAdd MemoryMappedFile.CreateFromFile(SafeFileHandle) overload (#83134), fixes #79187
Amal Abeygunawardana [Wed, 22 Mar 2023 15:40:18 +0000 (02:40 +1100)]
Add MemoryMappedFile.CreateFromFile(SafeFileHandle) overload (#83134), fixes #79187

19 months agoMove optimize bools pass to a new file (#83768)
Alan Hayward [Wed, 22 Mar 2023 13:04:34 +0000 (13:04 +0000)]
Move optimize bools pass to a new file (#83768)

No code changes, just moving.

19 months agoIncreased max length of OP_STOREX_MEMBASE to 16 on arm64, (#83770)
Jan Dupej [Wed, 22 Mar 2023 12:31:39 +0000 (13:31 +0100)]
Increased max length of OP_STOREX_MEMBASE to 16 on arm64, (#83770)

19 months ago[NativeAOT] Support exporting methods from referenced assemblies in a formal way...
Ivan Povazan [Wed, 22 Mar 2023 09:02:35 +0000 (10:02 +0100)]
[NativeAOT] Support exporting methods from referenced assemblies in a formal way (#83396)

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

19 months ago[wasm] Cache files in simple server (#83744)
Radek Doulik [Wed, 22 Mar 2023 08:53:42 +0000 (09:53 +0100)]
[wasm] Cache files in simple server (#83744)

* [wasm] Cache files in simple server

This improves measurements comparison between hosts with different
storage speeds. In our case local storage vs NFS storage
on the otherwise equal hardware.

The cache is filled during initial runs of browser-bench.

Also do not prefetch `icudt.dat` as it is not used anymore.

* Use StringComparer.OrdinalIgnoreCase for the cache

19 months agoAdd LinkerFlavor to NativeAOT (#83558)
Adeel Mujahid [Wed, 22 Mar 2023 06:15:16 +0000 (08:15 +0200)]
Add LinkerFlavor to NativeAOT (#83558)

* Add ability to specify linker via -p:LinkerFlavor

* Set linux default to bfd

19 months agoImprove string.Substring (#83758)
Egor Bogatov [Wed, 22 Mar 2023 04:29:55 +0000 (05:29 +0100)]
Improve string.Substring (#83758)

19 months agoCorrect formatting of config binder generator (#83614)
Layomi Akinrinade [Wed, 22 Mar 2023 01:13:01 +0000 (18:13 -0700)]
Correct formatting of config binder generator (#83614)

* Correct formatting of config binder generator

* Use span tokenization in multi-line emission logic

19 months agoUse an aka.ms link for the breaking change doc issue template (#83757)
Jeff Handley [Wed, 22 Mar 2023 00:29:51 +0000 (17:29 -0700)]
Use an aka.ms link for the breaking change doc issue template (#83757)

19 months agoAvoid losing messages for memory-mapped stress log (#81038)
Andrew Au [Tue, 21 Mar 2023 22:36:00 +0000 (15:36 -0700)]
Avoid losing messages for memory-mapped stress log (#81038)

19 months agoBump main pre-release version iteration to preview4 (#83691)
Carlos Sánchez López [Tue, 21 Mar 2023 21:44:42 +0000 (14:44 -0700)]
Bump main pre-release version iteration to preview4 (#83691)

* Bump main version to preview4

* Bump to P4 of emsdk manifest

---------

Co-authored-by: Steve Pfister <steve.pfister@microsoft.com>
19 months ago[wasm] Jiterpreter monitoring phase take 2 (#83489)
Katelyn Gadd [Tue, 21 Mar 2023 20:47:40 +0000 (13:47 -0700)]
[wasm] Jiterpreter monitoring phase take 2 (#83489)

* Add a monitoring phase to jiterpreter traces, that monitors an approximate number of opcodes executed before specific types of bailouts.
If a trace bails out frequently without executing enough opcodes, it will be rejected and turned into a nop to improve performance.
* Fix assert when running out of TraceInfo space

19 months ago[browser] partial reversal of PR #82826 (#83637)
Pavel Savara [Tue, 21 Mar 2023 20:36:44 +0000 (21:36 +0100)]
[browser] partial reversal of PR #82826 (#83637)

19 months ago[mono][jit] Add some barriers to the delegate invoke code. (#83673)
Zoltan Varga [Tue, 21 Mar 2023 19:06:30 +0000 (15:06 -0400)]
[mono][jit] Add some barriers to the delegate invoke code. (#83673)

Re: https://github.com/dotnet/runtime/issues/81123.

19 months agoArm64: Combine if conditions into compare chains (#79283)
Alan Hayward [Tue, 21 Mar 2023 18:23:05 +0000 (18:23 +0000)]
Arm64: Combine if conditions into compare chains (#79283)

Add a new stage optOptimizeCompareChainCondBlock in pass optOptimizeBools.

This aims to reduced the number of conditional jumps by joining cases when multiple conditions gate the execution of a block.

Example 1:
If ( a > b || c == d) { x = y; }

Will be represented in IR as:

 ------------ BB01 -> BB03 (cond), succs={BB02,BB03}
 *  JTRUE (GT a,b)

 ------------ BB02 -> BB04 (cond), preds={BB01} succs={BB03,BB04}
 *  JTRUE (NE c,d)

 ------------ BB03, preds={BB01, BB02} succs={BB04}
 *  ASG (x,y)
These operands will be combined into a single AND in the first block (with the first
condition inverted), wrapped by the test condition (NE(...,0)). Giving:

 ------------ BB01 -> BB03 (cond), succs={BB03,BB04}
 *  JTRUE (NE (AND (LE a,b), (NE c,d)), 0)

 ------------ BB03, preds={BB01} succs={BB04}
 *  ASG x,y
Example 2:
If ( a > b && c == d) { x = y; } else { x = z; }

Here the && conditions are connected via an OR. After the pass:

 ------------ BB01 -> BB03 (cond), succs={BB03,BB04}
 *  JTRUE (NE (OR (LE a,b), (NE c,d)), 0)

 ------------ BB03, preds={BB01} succs={BB05}
 *  ASG x,y

 ------------ BB04, preds={BB01} succs={BB05}
 *  ASG x,z
Example 3:
If ( a > b || c == d || e < f ) { x = y; }
The first pass of the optimization will combine two of the conditions. The
second pass will then combine remaining condition the earlier chain.

 ------------ BB01 -> BB03 (cond), succs={BB03,BB04}
 *  JTRUE (NE (OR ((NE (OR (NE c,d), (GE e,f)), 0), (LE a,b))), 0)

 ------------ BB03, preds={BB01} succs={BB04}
 *  ASG x,y
This optimization means that every condition within the IF statement is always evaluated,
as opposed to stopping at the first positive match.
Theoretically there is no maximum limit on the size of the generated chain. Therefore cost
checking is used to limit the maximum number of conditions that can be chained together.

Currently the cost checking limits to a maximum of three simple conditions. This is the same behaviour as GCC. Note that LLVM allows chains of much longer length.

19 months agoJIT: Expand handling of non-value commas in gtSplitTree (#83725)
Jakob Botsch Nielsen [Tue, 21 Mar 2023 18:21:59 +0000 (19:21 +0100)]
JIT: Expand handling of non-value commas in gtSplitTree (#83725)

We can have a 'value'-typed COMMA whose RHS operand is actually an
assignment. gtSplitTree would create illegal IR for this case.

For example:

N018 ( 38, 33) [000327] -ACXGO----- arg1 setup              ├──▌  COMMA     simd32
N011 ( 28, 25) [000328] -ACXGO-----                         │  ├──▌  COMMA     void
N008 ( 24, 22) [000320] -ACXG---R--                         │  │  ├──▌  ASG       byref
N007 (  3,  2) [000319] D------N---                         │  │  │  ├──▌  LCL_VAR   byref  V50 tmp45
N006 ( 20, 19) [000126] --CXG------                         │  │  │  └──▌  CALL help byref  CORINFO_HELP_UNBOX
N004 (  3,  2) [000124] ----------- arg1 in rsi             │  │  │     ├──▌  LCL_VAR   ref    V02 loc1
N005 (  3, 10) [000125] H---------- arg0 in rdi             │  │  │     └──▌  CNS_INT(h) long   0x7f6e4bb0e500 class
N010 (  4,  3) [000322] ---X-O-----                         │  │  └──▌  NULLCHECK byte
N009 (  3,  2) [000321] -----------                         │  │     └──▌  LCL_VAR   byref  V50 tmp45
N017 ( 10,  8) [000331] -A-XGO--R--                         │  └──▌  ASG       simd32 (copy)
N016 (  3,  2) [000330] D------N---                         │     ├──▌  LCL_VAR   simd32 V51 tmp46
N015 (  6,  5) [000329] ---XGO-N---                         │     └──▌  IND       simd32
N014 (  4,  3) [000326] -----O-N---                         │        └──▌  ADD       byref
N012 (  3,  2) [000324] -----O-----                         │           ├──▌  LCL_VAR   byref  V50 tmp45
N013 (  1,  1) [000325] -----------                         │           └──▌  CNS_INT   long   32

gtSplitTree would believe that [000327] was a value and would create the
following IR shape:

N016 ( 14, 11) [000428] -A-XGO--R--                         ▌  ASG       simd32 (copy)
N015 (  3,  2) [000427] D------N---                         ├──▌  LCL_VAR   simd32 V76 tmp71
N014 ( 10,  8) [000331] -A-XGO-NR--                         └──▌  ASG       simd32 (copy)
N013 (  3,  2) [000330] D------N---                            ├──▌  LCL_VAR   simd32 V51 tmp46
N012 (  6,  5) [000329] ---XGO-N---                            └──▌  IND       simd32
N011 (  4,  3) [000326] -----O-N---                               └──▌  ADD       byref
N009 (  3,  2) [000324] -----O-----                                  ├──▌  LCL_VAR   byref  V50 tmp45
N010 (  1,  1) [000325] -----------                                  └──▌  CNS_INT   long   32

Fix #83576

19 months agoDelete Mono/RuntimeMarshal.cs (#83678)
Jan Kotas [Tue, 21 Mar 2023 17:34:08 +0000 (10:34 -0700)]
Delete Mono/RuntimeMarshal.cs (#83678)

The methods in this file were partially redundant and partially specific to AssemblyName.

19 months agoUnroll Buffer.Memmove for constant lengths (#83638)
Egor Bogatov [Tue, 21 Mar 2023 16:52:34 +0000 (17:52 +0100)]
Unroll Buffer.Memmove for constant lengths (#83638)

Co-authored-by: SingleAccretion <62474226+SingleAccretion@users.noreply.github.com>
Co-authored-by: Jakob Botsch Nielsen <Jakob.botsch.nielsen@gmail.com>
19 months ago[mono][aot] Load AOT module of a container assembly using assembly name (#83711)
Milos Kotlar [Tue, 21 Mar 2023 15:50:34 +0000 (16:50 +0100)]
[mono][aot] Load AOT module of a container assembly using assembly name (#83711)

* Load AOT module of a container assembly using assembly name

* Use mono_image_init to init the image

* Implement mono_loader_lock on load_container_amodule

* Avoid recursive invocation by setting container_assm_name to NULL

19 months ago[browser] Fix encoding problem when publishing with AOT (#83510)
Ilona Tomkowicz [Tue, 21 Mar 2023 14:53:21 +0000 (15:53 +0100)]
[browser] Fix encoding problem when publishing with AOT (#83510)

* Fix.

* Regex approach is not necessary.

* Fix encoding on Windows.

* Fixed build error.

* Reverted unnecessary changes. Blocked relink with unicode.

* Revet + nit.

* Applied @kg's review.

19 months ago[mono][jit] Add vector horizontal sums and ToScalar on arm64. (#83675)
Jan Dupej [Tue, 21 Mar 2023 14:49:00 +0000 (15:49 +0100)]
[mono][jit] Add vector horizontal sums and ToScalar on arm64. (#83675)

* SN_Sum operation on arm64. Fixed dup. Replaced addv, addp, faddp with their generalized variants. Added OP_EXTRACTx opcodes to arm64 codegen. Added horizontal sums.

* Fixed smov macro. Added SN_ToScalar. Fixed code style.

* Fixed vector sums of nint/nuint.

* Temporarily disable intrinsics, until all are implemented.

19 months ago[tvOS] Bump to new OSX 13 AppleTV queue (#83272)
Steve Pfister [Tue, 21 Mar 2023 14:14:30 +0000 (10:14 -0400)]
[tvOS] Bump to new OSX 13 AppleTV queue (#83272)

19 months agoReplace a load with cheaper mov instruction when possible (#83458)
SwapnilGaikwad [Tue, 21 Mar 2023 12:39:01 +0000 (12:39 +0000)]
Replace a load with cheaper mov instruction when possible (#83458)

19 months ago[mono][jit] Adding compare all/any intrinsics. (#83515)
Jan Dupej [Tue, 21 Mar 2023 09:37:45 +0000 (10:37 +0100)]
[mono][jit] Adding compare all/any intrinsics. (#83515)

* xxAny, xAll comparisons in progress.

* xxAny, xxAll comparisons, part 2.

* [mono][jit] Adding compare all/any operations. Fixed umov,smov macros.

* Removed superfluous changes.

* Restored newline at the end of HelloWorld.

* Fixed unmatched brace.

* Indentation.

* Normalized boolean values to 0/1. SIMD_EXTR_ constants have friendlier names. Equality/Inequality are now also intrinsics.

* Fixed element type for comparisons.

* Temporarily disabled intrinsics. Will be permanenty reenabled once all are implemented.

19 months agoLocalized file check-in by OneLocBuild Task: Build definition ID 679: Build ID 214003...
dotnet bot [Tue, 21 Mar 2023 07:53:26 +0000 (00:53 -0700)]
Localized file check-in by OneLocBuild Task: Build definition ID 679: Build ID 2140030 (#83703)

19 months agoCorrect doc comment for IMultiplyOperators returns (#83693)
Marc Brooks [Tue, 21 Mar 2023 03:33:39 +0000 (22:33 -0500)]
Correct doc comment for IMultiplyOperators returns (#83693)

Replaced _divided-by_ with _multiplied-by_ in both
IMultiplyOperators.cs and NFloat.cs.
Fixes https://github.com/dotnet/runtime/issues/80521

19 months agoCleanup some HWIntrinsic logic to ensure the right gtType and simdSize are being...
Tanner Gooding [Tue, 21 Mar 2023 02:16:57 +0000 (19:16 -0700)]
Cleanup some HWIntrinsic logic to ensure the right gtType and simdSize are being set (#83516)

* Cleanup some HWIntrinsic logic to ensure the right gtType and simdSize are being set

* Apply formatting patch

* Add a missing GetLower call

* Fix an assert for lowering TYP_SIMD12 where its handled as TYP_SIMD16

* Ensure GetLower is used in Dot for TYP_SIMD32

* Apply formatting patch

* Insert after, not before, for the _GetLower to avoid a codegen regression

* Put the _GetLower in the right place to avoid the codegen regression

* Don't change the simd size of TYP_SIMD8/12 DotProduct unnecessarily

19 months agoUse BitOperations::PopCount() in genCountBits() (#83661)
Kunal Pathak [Tue, 21 Mar 2023 02:08:44 +0000 (19:08 -0700)]
Use BitOperations::PopCount() in genCountBits() (#83661)

19 months agoImprove RA for LowerBlockStore (#83627)
Egor Bogatov [Tue, 21 Mar 2023 00:49:42 +0000 (01:49 +0100)]
Improve RA for LowerBlockStore (#83627)

19 months agoSyntaxValueProvider: avoid performance issue with syntax list containing many items...
Charles Stoner [Tue, 21 Mar 2023 00:08:42 +0000 (17:08 -0700)]
SyntaxValueProvider: avoid performance issue with syntax list containing many items (#83483)

19 months agoRemove calling convention modifiers from cpuid sig (#83672)
Adeel Mujahid [Tue, 21 Mar 2023 00:03:59 +0000 (02:03 +0200)]
Remove calling convention modifiers from cpuid sig (#83672)

> /runtime/src/coreclr/vm/cgensys.h:107:26: error: stdcall calling convention is not supported on builtin function [-Werror,-Wignored-attributes]

19 months agoHandle recursive type graphs in config binding generator (#83644)
Layomi Akinrinade [Mon, 20 Mar 2023 22:25:17 +0000 (15:25 -0700)]
Handle recursive type graphs in config binding generator (#83644)

19 months agoRevert "[mono][aot] Load AOT module of a container assembly using assembly name ...
Milos Kotlar [Mon, 20 Mar 2023 21:42:54 +0000 (22:42 +0100)]
Revert "[mono][aot] Load AOT module of a container assembly using assembly name (#83511)" (#83686)

This reverts commit 1e601c5101e1f0573cd03560615aa8f6cb38fa64.

19 months ago[mono] Fix a race in gparam construction. (#83688)
Zoltan Varga [Mon, 20 Mar 2023 20:08:25 +0000 (16:08 -0400)]
[mono] Fix a race in gparam construction. (#83688)

Re: https://github.com/dotnet/runtime/issues/81123.

19 months agoImplement support for unspeakable types. (#83631)
Eirik Tsarpalis [Mon, 20 Mar 2023 20:08:09 +0000 (20:08 +0000)]
Implement support for unspeakable types. (#83631)

* Implement support for unspeakable types.

* Remove unneeded declarations.

* Record ambiguity information in exception message.

* Fix error message testing in wasm.

* Address feedback.

* Add test case for interface POCOs

* Update src/libraries/System.Text.Json/src/Resources/Strings.resx

Co-authored-by: Dan Moseley <danmose@microsoft.com>
---------

Co-authored-by: Dan Moseley <danmose@microsoft.com>
19 months agoReduce the size of some Http header values (#83640)
Miha Zupan [Mon, 20 Mar 2023 19:45:43 +0000 (20:45 +0100)]
Reduce the size of some Http header values (#83640)

* Reduce the size of some Http header values

* PR feedback

19 months agoupdate mariner Linux image to 2.0 (#81973)
Tomas Weinfurt [Mon, 20 Mar 2023 19:23:04 +0000 (12:23 -0700)]
update mariner Linux image to 2.0 (#81973)

* update mariner Linux image to 2.0

* product

* test

* force run

* centos

* update

19 months agoJIT: revise inlinee block numbering, enable synthesis for inlinees (#83610)
Andy Ayers [Mon, 20 Mar 2023 19:06:31 +0000 (12:06 -0700)]
JIT: revise inlinee block numbering, enable synthesis for inlinees (#83610)

Start numbering inlinee blocks from 1 instead of 1 + the root compiler's
max BB num. Update inlinee block bbNums when they are inserted into the
root compiler's graph.

Adjust computations in various places that knew about the old approach
and looked from inlinee compiler to root compiler for bitset, epochs and
the like.

Enable synthesis for inlinees, now that regular bitsets on inlinee compiler
instances behave sensibly.

There is still some messiness around inlinees inheriting root compiler
EH info which requires special checks. I will clean this up separately.

Fixes #82755.
Contributes to #82964.

19 months agoFix 'x < 0' for unsigned (#83656)
Will Smith [Mon, 20 Mar 2023 19:05:29 +0000 (12:05 -0700)]
Fix 'x < 0' for unsigned (#83656)

19 months agoFix porting from servicing release (#83633)
Tarek Mahmoud Sayed [Mon, 20 Mar 2023 18:08:42 +0000 (11:08 -0700)]
Fix porting from servicing release (#83633)

19 months agoPrint the state when the align instructions don't match up (#83286)
Kunal Pathak [Mon, 20 Mar 2023 17:58:52 +0000 (10:58 -0700)]
Print the state when the align instructions don't match up (#83286)

* Print the state when the align instructions don't match up

* build fix

* Update loop number during block compaction

* Adjust the ifdef

* Fix #ifdef with #if

* TEMP COMMIT

* Revert "TEMP COMMIT"

This reverts commit c10b70dc4787f734bb99d5d4bb69b1a545d6516d.

19 months agoAdd linux-musl-riscv64 RID (#83465)
Antoine Martin [Mon, 20 Mar 2023 16:51:16 +0000 (12:51 -0400)]
Add linux-musl-riscv64 RID (#83465)

19 months ago[mono][aot] Load AOT module of a container assembly using assembly name (#83511)
Milos Kotlar [Mon, 20 Mar 2023 16:22:38 +0000 (17:22 +0100)]
[mono][aot] Load AOT module of a container assembly using assembly name (#83511)

* Load AOT module of a container assembly using assembly name

* Use mono_image_init to init the image

* Implement mono_loader_lock on load_container_amodule

* Avoid recursive invocation by setting container_assm_name to NULL

19 months agoAdd new MemoryExtension.Replace(src, dst, ...) overload (#83120)
Stephen Toub [Mon, 20 Mar 2023 15:39:16 +0000 (11:39 -0400)]
Add new MemoryExtension.Replace(src, dst, ...) overload (#83120)

* Add new MemoryExtension.Replace(src, dst, ...) overload

* Address PR feedback

19 months agoUse escape sequence instead of char in utf-8 tests. (#83595)
Ilona Tomkowicz [Mon, 20 Mar 2023 15:24:55 +0000 (16:24 +0100)]
Use escape sequence instead of char in utf-8 tests. (#83595)

19 months agoFix ToString handling of [Flags] enums with negative values (#83616)
Stephen Toub [Mon, 20 Mar 2023 11:25:43 +0000 (07:25 -0400)]
Fix ToString handling of [Flags] enums with negative values (#83616)

* Fix ToString handling of [Flags] enums with negative values

Our Enum rewrite earlier in .NET 8 broke the handling of ToString for [Flags] enums with negative values.  Prior to that rewrite, all of the enum values were stored as a sorted array of ulongs, regardless of the enum's underlying type. Now, they're stored as a sorted array of the underlying type.  However, that means that for signed underlying types, the position of negative values moved from the end to the beginning.  We knew this, and accordingly updated tests that reflected that order (which as an implementation detail is observable via APIs that get the underlying values).  But what we didn't notice because we didn't have tests covering it is that the logic for formatting [Flags] enums actually depends on those negative values being after the non-negative ones.  That's for two reasons.  First, there's logic that special-cases 0 and assumes that an enum value of 0 must be in the first slot of the values array if it exists.  Second, the logic for deciding which enum values should be included starts at the largest unsigned value and walks down subtracting out matching bit patterns as they're found; if the values are sorted differently, the resulting strings are different.  Not only might different names be included, but a number might be rendered if the order of evaluation means that no perfect subsetting is found even if there would have been had a different order been used.

This fixes the issues by restoring the ordering based on the values being unsigned.  When we sort, we sort based on the unsigned version of the underlying primitive, even if it's signed.

* Collapse GetEnumInfo for integer types to only be unsigned

Rather than 13 possible `EnumInfo<T>`, we consolidate down to just 8, such that for all of the underlying types that are signed integers, we instead always use their unsigned counterparts.  This then ensures that the data for the values is always sorted according to the unsigned representation and all logic in Enum that performs searches based on value is always doing so consistently.

19 months agoDelete dead GetUserFeatureDirectory functions (#83660)
Stephen Toub [Mon, 20 Mar 2023 11:17:54 +0000 (07:17 -0400)]
Delete dead GetUserFeatureDirectory functions (#83660)

The only overload that's used is the one taking two arguments.

19 months ago[eventpipe] Perform endian aware serialization of structs and arrays above FireETW...
Stefan Schulze Frielinghaus [Mon, 20 Mar 2023 08:31:51 +0000 (09:31 +0100)]
[eventpipe] Perform endian aware serialization of structs and arrays above FireETW layer (#80493)

19 months agoFix missing comparer when creating FrozenDictionary (#83651)
Stephen Toub [Sun, 19 Mar 2023 22:05:03 +0000 (18:05 -0400)]
Fix missing comparer when creating FrozenDictionary (#83651)

19 months agoUpdate xarch to track more instruction metadata as flags (#83473)
Tanner Gooding [Sun, 19 Mar 2023 14:30:51 +0000 (07:30 -0700)]
Update xarch to track more instruction metadata as flags (#83473)

* Reorder entries in instrsxarch to make finding SIMD instructions easier

* Remove unused instructions: cvtpd2pi, cvtpi2pd, cvtpi2ps, cvtps2pi, cvttpd2pi, and cvttps2pi

* Updating the xarch SIMD instructions to track flags indicating REX.W bit encoding and VEX/EVEX support

* Update the emitter to take advantage of the new insFlags

* Ensure TakesRexWPrefix works on x86

* Properly track REX.W encoding for VEX vs EVEX

* Ensure supportsVEX is set before supportsEVEX

* Ensure canUseVexEncoding is true when ForceEVEXEncoding is set

* Track how some special EVEX instructions are handled differently

* Apply formatting patch

* Ensure REX.WX is handled for EVEX where required

19 months agoAdd async post to deep-dive-blog-posts.md (#83506)
Stephen Toub [Sun, 19 Mar 2023 12:34:46 +0000 (08:34 -0400)]
Add async post to deep-dive-blog-posts.md (#83506)

19 months ago[Mono] Intrinsify As* on ARM64 with mini JIT (#83544)
Fan Yang [Sat, 18 Mar 2023 19:37:20 +0000 (15:37 -0400)]
[Mono] Intrinsify As* on ARM64 with mini JIT (#83544)

* Intrinsify As* on arm64

* Address review feedback

* Uncomment

19 months agoImprove and enable writing test wrappers to disk (#83444)
Mark Plesko [Sat, 18 Mar 2023 17:00:39 +0000 (10:00 -0700)]
Improve and enable writing test wrappers to disk (#83444)

`CodeBuilder` utility (mainly handles indentation) was lifted from the [PROSE codebase](https://msdata.visualstudio.com/PROSE/_git/PROSE?version=GCa244bb231dcaabe04b4825d4e093beaceed434d8&path=/Microsoft.ProgramSynthesis/Common/Utils/CodeBuilder.cs).  I omitted the last two revisions to it as they opened a few API questions for me and I didn't need the functionality anyway.

Then use it to format the generated code in `XUnitWrapperGenerator`.  Diffs are probably best viewed with whitespace ignored.  Writing simple text (`Append`/`AppendLine`) is the same as `StringBuilder`.  Indentation is specified (usually with a `using` that cleans up) and then added automatically.

Interesting tidbits:
- Factored `AppendAliasMap` from the 3 identical uses
- The loop structure for breaking the tests into groups of 50 doesn't allow `using`.  I did the push/pop of indentation manually rather than trying to restructure it.

Add a new MergedTestRunner.targets for relevant logic.  Enable `EmitCompilerGeneratedFiles` in it.

19 months agoInclude args in hostfxr entry point tracing (#83605)
Elinor Fung [Sat, 18 Mar 2023 15:40:27 +0000 (08:40 -0700)]
Include args in hostfxr entry point tracing (#83605)

19 months ago[android][ios] Add SDK and workload to support library mode (#83487)
Steve Pfister [Sat, 18 Mar 2023 03:39:51 +0000 (23:39 -0400)]
[android][ios] Add SDK and workload to support library mode (#83487)

Introduces the experimental workload mobile-librarybuilder-experimental that supports building self-contained shared or static native libraries on iOS and Android.

Once installed, the workload can be activated when the runtime identifier is android, ios, tvos, or maccatalyst based and the project contains the property <NativeLib>true</NativeLib>. NativeLib is a property NativeAOT uses to activate library mode and we will use that for consistency.

The Microsoft.NET.Runtime.LibraryBuilder.Sdk is a new nuget package will contain all of the necessary msbuild props and targets that drive the whole library builder process.

19 months agoUse Environment.SystemDirectory from GetFolderPath(System) on Windows (#83593)
Stephen Toub [Sat, 18 Mar 2023 00:49:26 +0000 (20:49 -0400)]
Use Environment.SystemDirectory from GetFolderPath(System) on Windows (#83593)

* Use Environment.SystemDirectory from GetFolderPath(System) on Windows

* Address PR feedback and fix up a few other occurrences

* Remove KnownFolders.System

19 months agoUnsigned division for IndexOf offsets (#83612)
Miha Zupan [Sat, 18 Mar 2023 00:02:07 +0000 (01:02 +0100)]
Unsigned division for IndexOf offsets (#83612)

19 months agoBump webpack in /src/mono/sample/wasm/browser-webpack (#83420)
dependabot[bot] [Fri, 17 Mar 2023 22:04:08 +0000 (23:04 +0100)]
Bump webpack in /src/mono/sample/wasm/browser-webpack (#83420)

Bumps [webpack](https://github.com/webpack/webpack) from 5.68.0 to 5.76.0.
- [Release notes](https://github.com/webpack/webpack/releases)
- [Commits](https://github.com/webpack/webpack/compare/v5.68.0...v5.76.0)

---
updated-dependencies:
- dependency-name: webpack
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
19 months agoVarious jiterpreter optimizations (#83322)
Katelyn Gadd [Fri, 17 Mar 2023 21:25:32 +0000 (14:25 -0700)]
Various jiterpreter optimizations (#83322)

* Implement CALL_HANDLER and CALL_HANDLER_S, since upon closer inspection they turned out to basically be a slightly more complex version of BR.
* Introduce persistent imported functions (similar to persistent types), which reduces the amount of time defining imports before compiling a trace.
* Don't call into C in order to emit single-byte unsigned LEB values (appendULeb is one of the hottest parts of the trace compiler).
* Track bailouts on a per-trace basis when bailout counting is enabled. This makes it easier to understand which traces have the worst performance problems. This does make bailout counting more expensive, but it was already expensive. (This probably needs more improvement to be truly useful, but it was helpful already.)
* Don't abort trace compiles for simple icalls, since in my testing many of them are in rarely-taken branches. They become bailouts instead.
* Unify the implementation of compressed names to simplify things.
* When defining an import you now pass the actual function (or function pointer) instead of manually providing it when instantiating the module.
* Various small optimizations to remove temporary JS allocations.
* Improve message formatting in the branch trace messages (off by default)

19 months agoSwitch tests for --additionalprobingpath to mocked components (#83541)
Elinor Fung [Fri, 17 Mar 2023 19:47:41 +0000 (12:47 -0700)]
Switch tests for --additionalprobingpath to mocked components (#83541)

19 months ago[mono][interp] Correctly track livness of vars used with MINT_MOV_8_* (#83597)
Vlad Brezae [Fri, 17 Mar 2023 19:29:29 +0000 (21:29 +0200)]
[mono][interp] Correctly track livness of vars used with MINT_MOV_8_* (#83597)

These instructions are defined as having no svars/dvars, even though they have multiple svars/dvars. We were failing to remove svars used by these instructions from the set of active vars, leading to vars remaining alive until the end of the basic block. This could lead to the consuming of the entire stack space available for interp vars.

19 months ago[Mono] Intrinsify max/min on ARM64 with mini JIT (#83468)
Fan Yang [Fri, 17 Mar 2023 17:15:23 +0000 (13:15 -0400)]
[Mono] Intrinsify max/min on ARM64 with mini JIT (#83468)

* Seperate smax/smin and umax/umin

* Intrinsify max/min on arm64

* Enforce rd == rn

* Replace comments with asserts

* Address review feedback

* Fix test failure

* Remove unused macros

* uncomment

19 months agoRename VirtualMethodTableManagedImplementation and add manual CCW to test generated...
Jackson Schuster [Fri, 17 Mar 2023 16:43:24 +0000 (09:43 -0700)]
Rename VirtualMethodTableManagedImplementation and add manual CCW to test generated RCW in ComInterfaceGenerator (#83285)

19 months ago[wasm] Fix dotnet.withRuntimeOptions (#83586)
Marek Fišera [Fri, 17 Mar 2023 16:35:52 +0000 (17:35 +0100)]
[wasm] Fix dotnet.withRuntimeOptions (#83586)

19 months ago[main] Update dependencies from dotnet/roslyn-analyzers (#83300)
dotnet-maestro[bot] [Fri, 17 Mar 2023 15:57:25 +0000 (10:57 -0500)]
[main] Update dependencies from dotnet/roslyn-analyzers (#83300)

* Update dependencies from https://github.com/dotnet/roslyn-analyzers build 20230310.2

Microsoft.CodeAnalysis.Analyzers , Microsoft.CodeAnalysis.NetAnalyzers
 From Version 3.3.5-beta1.23158.3 -> To Version 3.3.5-beta1.23160.2

* Update dependencies from https://github.com/dotnet/roslyn-analyzers build 20230312.1

Microsoft.CodeAnalysis.Analyzers , Microsoft.CodeAnalysis.NetAnalyzers
 From Version 3.3.5-beta1.23158.3 -> To Version 3.3.5-beta1.23162.1

* Update dependencies from https://github.com/dotnet/roslyn-analyzers build 20230314.1

Microsoft.CodeAnalysis.Analyzers , Microsoft.CodeAnalysis.NetAnalyzers
 From Version 3.3.5-beta1.23158.3 -> To Version 3.3.5-beta1.23164.1

* Update dependencies from https://github.com/dotnet/roslyn-analyzers build 20230315.1

Microsoft.CodeAnalysis.Analyzers , Microsoft.CodeAnalysis.NetAnalyzers
 From Version 3.3.5-beta1.23158.3 -> To Version 3.3.5-beta1.23165.1

---------

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
19 months ago[main] Update dependencies from 9 repositories (#83299)
dotnet-maestro[bot] [Fri, 17 Mar 2023 15:52:18 +0000 (10:52 -0500)]
[main] Update dependencies from 9 repositories (#83299)

* Update dependencies from https://github.com/dotnet/emsdk build 20230310.2

Microsoft.NET.Workload.Emscripten.Current.Manifest-8.0.100.Transport
 From Version 8.0.0-preview.3.23160.1 -> To Version 8.0.0-preview.3.23160.2

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

Microsoft.NET.ILLink.Tasks , Microsoft.NET.Sdk.IL , Microsoft.NETCore.App.Runtime.win-x64 , Microsoft.NETCore.ILAsm , runtime.native.System.IO.Ports , System.Text.Json
 From Version 8.0.0-preview.3.23155.6 -> To Version 8.0.0-preview.3.23162.2

* Update dependencies from https://github.com/dotnet/llvm-project build 20230313.3

runtime.linux-arm64.Microsoft.NETCore.Runtime.JIT.Tools , runtime.linux-arm64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk , runtime.linux-arm64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools , runtime.linux-arm64.Microsoft.NETCore.Runtime.ObjWriter , runtime.linux-musl-arm64.Microsoft.NETCore.Runtime.JIT.Tools , runtime.linux-musl-arm64.Microsoft.NETCore.Runtime.ObjWriter , runtime.linux-musl-x64.Microsoft.NETCore.Runtime.JIT.Tools , runtime.linux-musl-x64.Microsoft.NETCore.Runtime.ObjWriter , runtime.linux-x64.Microsoft.NETCore.Runtime.JIT.Tools , runtime.linux-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk , runtime.linux-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools , runtime.linux-x64.Microsoft.NETCore.Runtime.ObjWriter , runtime.osx-arm64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk , runtime.osx-arm64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools , runtime.osx-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk , runtime.osx-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools , runtime.win-arm64.Microsoft.NETCore.Runtime.JIT.Tools , runtime.win-arm64.Microsoft.NETCore.Runtime.ObjWriter , runtime.win-x64.Microsoft.NETCore.Runtime.JIT.Tools , runtime.win-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk , runtime.win-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools , runtime.win-x64.Microsoft.NETCore.Runtime.ObjWriter
 From Version 14.0.0-alpha.1.23158.1 -> To Version 14.0.0-alpha.1.23163.3

* Update dependencies from https://github.com/dotnet/icu build 20230313.3

Microsoft.NETCore.Runtime.ICU.Transport
 From Version 8.0.0-preview.3.23160.1 -> To Version 8.0.0-preview.3.23163.3

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

Microsoft.DotNet.XHarness.CLI , Microsoft.DotNet.XHarness.TestRunners.Common , Microsoft.DotNet.XHarness.TestRunners.Xunit
 From Version 1.0.0-prerelease.23157.1 -> To Version 1.0.0-prerelease.23163.1

* Update dependencies from https://github.com/dotnet/runtime-assets build 20230313.1

Microsoft.DotNet.CilStrip.Sources , System.ComponentModel.TypeConverter.TestData , System.Data.Common.TestData , System.Drawing.Common.TestData , System.Formats.Tar.TestData , System.IO.Compression.TestData , System.IO.Packaging.TestData , System.Net.TestData , System.Private.Runtime.UnicodeData , System.Runtime.Numerics.TestData , System.Runtime.TimeZoneData , System.Security.Cryptography.X509Certificates.TestData , System.Text.RegularExpressions.TestData , System.Windows.Extensions.TestData
 From Version 8.0.0-beta.23156.1 -> To Version 8.0.0-beta.23163.1

* Update dependencies from https://github.com/dotnet/cecil build 20230313.1

Microsoft.DotNet.Cecil
 From Version 0.11.4-alpha.23156.1 -> To Version 0.11.4-alpha.23163.1

* Update dependencies from https://github.com/dotnet/llvm-project build 20230315.1

runtime.linux-arm64.Microsoft.NETCore.Runtime.JIT.Tools , runtime.linux-arm64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk , runtime.linux-arm64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools , runtime.linux-arm64.Microsoft.NETCore.Runtime.ObjWriter , runtime.linux-musl-arm64.Microsoft.NETCore.Runtime.JIT.Tools , runtime.linux-musl-arm64.Microsoft.NETCore.Runtime.ObjWriter , runtime.linux-musl-x64.Microsoft.NETCore.Runtime.JIT.Tools , runtime.linux-musl-x64.Microsoft.NETCore.Runtime.ObjWriter , runtime.linux-x64.Microsoft.NETCore.Runtime.JIT.Tools , runtime.linux-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk , runtime.linux-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools , runtime.linux-x64.Microsoft.NETCore.Runtime.ObjWriter , runtime.osx-arm64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk , runtime.osx-arm64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools , runtime.osx-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk , runtime.osx-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools , runtime.win-arm64.Microsoft.NETCore.Runtime.JIT.Tools , runtime.win-arm64.Microsoft.NETCore.Runtime.ObjWriter , runtime.win-x64.Microsoft.NETCore.Runtime.JIT.Tools , runtime.win-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk , runtime.win-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools , runtime.win-x64.Microsoft.NETCore.Runtime.ObjWriter
 From Version 14.0.0-alpha.1.23158.1 -> To Version 14.0.0-alpha.1.23165.1

* Update dependencies from https://github.com/dotnet/msquic build 20230315.1

System.Net.MsQuic.Transport
 From Version 8.0.0-alpha.1.23156.1 -> To Version 8.0.0-alpha.1.23165.1

* Update dependencies from https://dev.azure.com/dnceng/internal/_git/dotnet-optimization build 20230316.4

optimization.linux-arm64.MIBC.Runtime , optimization.linux-x64.MIBC.Runtime , optimization.windows_nt-arm64.MIBC.Runtime , optimization.windows_nt-x64.MIBC.Runtime , optimization.windows_nt-x86.MIBC.Runtime , optimization.PGO.CoreCLR
 From Version 1.0.0-prerelease.23068.4 -> To Version 1.0.0-prerelease.23166.4

* Update dependencies from https://github.com/dotnet/emsdk build 20230317.1

Microsoft.NET.Workload.Emscripten.Current.Manifest-8.0.100.Transport
 From Version 8.0.0-preview.3.23160.1 -> To Version 8.0.0-preview.3.23167.1

* Update dependencies from https://github.com/dotnet/msquic build 20230316.1

System.Net.MsQuic.Transport
 From Version 8.0.0-alpha.1.23156.1 -> To Version 8.0.0-alpha.1.23166.1

---------

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
19 months agoJIT: profile synthesis blend and repair modes (#83567)
Andy Ayers [Fri, 17 Mar 2023 15:24:38 +0000 (08:24 -0700)]
JIT: profile synthesis blend and repair modes (#83567)

Implement blend and repair modes for synthesis. Blend merges a bit of
synthesized data into an existing PGO data set; repair tries to fix any
local inconsistencies (via heuristics). Both run count construction
afterwards.

Trust blended data like we trust dynamic data. Probably will want more
nuance here (eg trust dynamic blend, but not static blend) but this is
sufficent for now.

Also implement random and reverse modes; these will ultimately be used
for stress testing (not called anywhere yet).

Parameterize some of the magic constants that have cropped up.

Add blend mode as a new weekend pgo stress mode; fix the other synthesis
mode I added recently to pgo stress to set the config properly.

Contributes to #82964.

19 months ago[browser] disable memorySnapshot for WS test (#83583)
Pavel Savara [Fri, 17 Mar 2023 15:24:16 +0000 (16:24 +0100)]
[browser] disable memorySnapshot for WS test (#83583)

* disable memorySnapshot for WS test
* Update src/mono/wasm/test-main.js

Co-authored-by: Radek Doulik <radek.doulik@gmail.com>
19 months agoRuntime lookup clean up, enable for helper-based tail calls (#83430)
Egor Bogatov [Fri, 17 Mar 2023 13:30:52 +0000 (14:30 +0100)]
Runtime lookup clean up, enable for helper-based tail calls (#83430)

19 months ago[tasks] Add auto runtime initialization template to LibraryBuilder (#83050)
Mitchell Hwang [Fri, 17 Mar 2023 13:27:10 +0000 (09:27 -0400)]
[tasks] Add auto runtime initialization template to LibraryBuilder (#83050)

* [tasks] Add auto runtime initialization template to LibraryBuilder

* Grab shared library directory

* [tasks] Extend auto initialization template to account for customization

* Revert "Grab shared library directory"

This reverts commit bc86f2b91c76f0e40ad60516dcb1031d02e7054b.

* Remove platform specific naming

* [tasks] Move App Context setup back to autoinit.c

* Remove registering bundled modules and debugging until they can be validated

* Remove unnecessary wrapper

* Grab bundle_path later without eglib

Setting bundle_path in constructor may be too early for environment variables to be set
so grab it first thing when initializing the runtime.

Use getenv directly instead of calling into eglib with just one api

* Rename AssetsPath to AssembliesLocation

* Move assembly loading into separate function

* Remove unnecessary function

* Cleanup CMakeLists template indentation

* Add dotnet header to autoinit.c

* Default bundle_path if assemblies path environment variable not set

* Pass bundle_path to load assemblies

* Add logging and abort on failures

* Load assemblies with partial name

* Clean up targets and unneeded properties

* Rename source file

* Remove preload hook and make out of memory error more generic

* Throw when no exported symbols are found

* Remove aot data load prehook and aotdata generation

* Address feedback

* Address more feedback

* Add various fixes and make bundle_path a local variable

* Reintroduce load aot data hook in autoinit with guard

* Fix closing tag

* Include guard library-builder.h

* Fix typo

19 months ago[nodejs] add active issue (#83580)
Pavel Savara [Fri, 17 Mar 2023 13:21:56 +0000 (14:21 +0100)]
[nodejs] add active issue (#83580)

19 months ago [browser] fix advanced sample for MT (#83582)
Pavel Savara [Fri, 17 Mar 2023 13:19:46 +0000 (14:19 +0100)]
 [browser] fix advanced sample for MT (#83582)

19 months agoSlightly improve struct zeroing & copying (#83488)
Egor Bogatov [Fri, 17 Mar 2023 12:38:12 +0000 (13:38 +0100)]
Slightly improve struct zeroing & copying (#83488)

19 months agoUse nameof in attributes (#83566)
Stephen Toub [Fri, 17 Mar 2023 12:28:19 +0000 (08:28 -0400)]
Use nameof in attributes (#83566)

19 months ago[wasm] Implement rotate left/right immediate interp intrinsics in jiterpreter; implem...
Katelyn Gadd [Fri, 17 Mar 2023 10:06:19 +0000 (03:06 -0700)]
[wasm] Implement rotate left/right immediate interp intrinsics in jiterpreter; implement clz/ctz/popcnt (#83573)

* Implement rotate left/right immediate interp intrinsics
* Implement clz/ctz/popcnt

19 months agoEnsure free buffer space when reading TLS messages (#83480)
Radek Zikmund [Fri, 17 Mar 2023 08:17:18 +0000 (09:17 +0100)]
Ensure free buffer space when reading TLS messages (#83480)

* Ensure free buffer space when reading TLS messages

* Move buffer expansion outside of the loop to prevent unbounded grow

* Fix failing tests

The initial size is not enough to cover later TLS frames

19 months ago[wasm] Post 3.1.30 emscripten bump feedback (#83391)
Radek Doulik [Fri, 17 Mar 2023 06:39:24 +0000 (07:39 +0100)]
[wasm] Post 3.1.30 emscripten bump feedback (#83391)

* [wasm] Post 3.1.30 emscripten bump feedback

Make the minimal build env vars item group "private".

Enable simd for old v8 in tests

* Add jsvu binaries to the path

Do not use experimental flags, as we should get newer v8

* Export PATH and echo it

* Use webassembly helix image

19 months agodisable NTLM tests on RedHat.7 (#83559)
Tomas Weinfurt [Fri, 17 Mar 2023 05:40:49 +0000 (22:40 -0700)]
disable NTLM tests on RedHat.7 (#83559)

* disable NTLM tests on RedHat.7

* Package_Unsupported_NTLM

19 months agoUse Environment.SystemDirectory to get system directory (#83564)
Jan Kotas [Fri, 17 Mar 2023 03:25:53 +0000 (20:25 -0700)]
Use Environment.SystemDirectory to get system directory (#83564)

Environment.SystemDirectory is a lot more efficient than Environment.GetFolderPath(System.Environment.SpecialFolder.System).

Contributes to https://github.com/dotnet/aspnetcore/issues/47269

19 months agoRevert "ActiveIssue for BuildInvalidSignatureTwice on mono interpreter. (#82864)...
Kevin Jones [Fri, 17 Mar 2023 01:34:47 +0000 (21:34 -0400)]
Revert "ActiveIssue for BuildInvalidSignatureTwice on mono interpreter. (#82864)" (#83542)

This reverts commit ac226b4c14a81dd101a54a619baa349101c7aa5b.

19 months ago[mono] Allow a single call when inlining methods (#83548)
Katelyn Gadd [Fri, 17 Mar 2023 01:20:12 +0000 (18:20 -0700)]
[mono] Allow a single call when inlining methods (#83548)

Allow a single call when inlining methods, this makes it theoretically possible to inline List.get_Item
Don't allow doesnotreturn method calls to disable inlining, since we know they are unlikely to be called

19 months agoupdate msquic (#83493)
Tomas Weinfurt [Fri, 17 Mar 2023 00:45:09 +0000 (17:45 -0700)]
update msquic (#83493)

* update msquic

* update

19 months agoFixed wrong date format in XUnitWrapperLibrary Test Summary. (#83553)
Ivan Diaz Sanchez [Fri, 17 Mar 2023 00:16:58 +0000 (17:16 -0700)]
Fixed wrong date format in XUnitWrapperLibrary Test Summary. (#83553)

19 months ago[JIT] ARM64 - Optimize `x < 0` and `x >= 0` (#83176)
Will Smith [Thu, 16 Mar 2023 23:59:39 +0000 (16:59 -0700)]
[JIT] ARM64 - Optimize `x < 0` and `x >= 0` (#83176)

* Initial work that allows optimizing x < 0

* Few tweaks

* Optimized x < 0 and x >= 0 for conditionals

* Removed old commented code. Switched tbz and tbnz

* Simplified

* Fix build

* Check for possible interference

* Reverse

* Check invariant-range

* Cleanup

* Cleanup

* Handle new JCMP flags in gtReverseCond

* Comment update

* Remove extra flags

* Simplify further

* Fix warning

* Update src/coreclr/jit/lower.cpp

Co-authored-by: Jakob Botsch Nielsen <Jakob.botsch.nielsen@gmail.com>
* Fix warning

* Fixing assert

---------

Co-authored-by: Jakob Botsch Nielsen <Jakob.botsch.nielsen@gmail.com>
19 months agoConvert to GeneratedRegexAttribute fixer should preserve references to const string...
Badre BSAILA [Thu, 16 Mar 2023 23:35:23 +0000 (00:35 +0100)]
Convert to GeneratedRegexAttribute fixer should preserve references to const string fields (#81997)

* Convert to GeneratedRegexAttribute fixer should preserve references to const string fields

* add test to cover external const case

* fix double slashes

* simplify verbatime string generation

* delete unused quote

19 months agoRaise inlining length limit in the interpreter from 20 to 30. (#83490)
Katelyn Gadd [Thu, 16 Mar 2023 23:24:53 +0000 (16:24 -0700)]
Raise inlining length limit in the interpreter from 20 to 30. (#83490)

This is enough to allow List<T>.get_Item to be inlined (as long as we also allow calls), among other critical methods, and enables big speedups for some benchmarks.

19 months agofix a bug where totalCPU count was being used for cachesize computation (#83528)
Manish Godse [Thu, 16 Mar 2023 21:46:36 +0000 (14:46 -0700)]
fix a bug where totalCPU count was being used for cachesize computation (#83528)

19 months agoCoreCLR support for InlineArrayAttribute. (struct layout part) (#82744)
Vladimir Sadov [Thu, 16 Mar 2023 21:45:39 +0000 (14:45 -0700)]
CoreCLR support for InlineArrayAttribute.  (struct layout part) (#82744)

* initial port from the prototype

* parse the attribute in MT builder

* validate replicated size

* aot changes

* refmap

* validate total size in ilc

* add the actual attribute

* Apply suggestions from code review

Co-authored-by: Jan Kotas <jkotas@microsoft.com>
* add a small use of InlineArray in CoreLib - to get some crossgen coverage.

* a few more uses in CorLib

* fix for sequential layout

* Standardize on use of "InlineArray" in the implementation

* simpler layout replication

* some initial tests (will add more)

* more tests

* limit the max size of array instance to 1MiB

* fix an assert in importercalls.cpp

* "result" in GC layout should track the pointer count, not the size

* error messages

* fixed uses of "value array" in comments.

* PR feedback on StackAllocedArguments

* use the same size limit for inline arrays in the typeloader

* more PR feedback

* remove SetCannotBeBlittedByObjectCloner

* moving GetInlineArrayLength to MetadataType and related changes

* use  type.Context.Target.PointerSize

* lost resources change

* fix for x86

* Do not make InlineArrayType an inline array just yet.

* CORINFO_FLG_INDEXABLE_FIELDS

---------

Co-authored-by: Jan Kotas <jkotas@microsoft.com>
19 months agoCreate source generator for configuration binding (#82179)
Layomi Akinrinade [Thu, 16 Mar 2023 21:42:38 +0000 (14:42 -0700)]
Create source generator for configuration binding (#82179)

* Create source generator for configuration binding

* Add baseline tests

* Rename test project folders

* Avoid passing entire compilation to generator execute method

* Enable nullable

* Add logic to include generator in nuget package and enable it conditionally

* Address feedback

19 months agoRemove S.S.Permissions reference from S.DirectoryServices (#82453)
Steve Harter [Thu, 16 Mar 2023 21:26:58 +0000 (16:26 -0500)]
Remove S.S.Permissions reference from S.DirectoryServices (#82453)

19 months agodisable startupMemoryCache by default (#83536)
Pavel Savara [Thu, 16 Mar 2023 20:37:56 +0000 (21:37 +0100)]
disable startupMemoryCache by default (#83536)

19 months agoAdding support for Vector512 bitwise operations: And, AndNot, Or, OnesComplement...
Tanner Gooding [Thu, 16 Mar 2023 20:36:24 +0000 (13:36 -0700)]
Adding support for Vector512 bitwise operations: And, AndNot, Or, OnesComplement, and Xor (#83354)

* Adding support for Vector512 bitwise operations: And, AndNot, Or, OnesComplement, and Xor

* Adding AVX512F APIs for And, AndNot, Load, Or, Store, and Xor

* Fix the "throw new PlatformNotSupported" expressions for Avx512F

* Fixing some test build failures

* Ensure the Avx512F and related classes can lightup in import

* Ensure that JitStressEvexEncoding is only checked in debug

* Allow 64-bit alignment in the test data table types and fix the AVX512 enablement check

19 months ago[node] unblock WS tests (#83518)
Pavel Savara [Thu, 16 Mar 2023 20:34:31 +0000 (21:34 +0100)]
[node] unblock WS tests (#83518)

* active issue https://github.com/dotnet/runtime/issues/83517
Co-authored-by: Marek Fišera <mara@neptuo.com>
19 months agoFix System.Management wminet_utils.dll lookup code for arm64 (#83522)
Viktor Hofer [Thu, 16 Mar 2023 20:27:16 +0000 (21:27 +0100)]
Fix System.Management wminet_utils.dll lookup code for arm64 (#83522)

* Fix System.Management wminet_utils.dll lookup code for arm64

* Update ManagementScope.cs

19 months agoUse SOS to dump managed stack traces from a dump on Windows (#82867)
Jeremy Koritzinsky [Thu, 16 Mar 2023 20:14:39 +0000 (13:14 -0700)]
Use SOS to dump managed stack traces from a dump on Windows (#82867)

19 months agoImplements Requires*Attribute on class behavior for NativeAOT (#83417)
Vitek Karas [Thu, 16 Mar 2023 13:49:47 +0000 (06:49 -0700)]
Implements Requires*Attribute on class behavior for NativeAOT (#83417)

Implements most of the missing pieces to get Requires on class working correctly in NativeAOT.

Major changes:
* Detect Requires mismatch between derived and base class
* Warn on field access if the owning class has Requires
* Changes to reflection marking to warn on more cases (instance methods on Requires classes for example)

Supportive changes:
* The helpers to detect Requires attributes now return the found attribute view out parameter

Fixes #81158

Still two missing pieces - tracked by https://github.com/dotnet/runtime/issues/82447:
* Requires on attributes - NativeAOT doesn't handle this at all yet, part of it is Requires on the attribute class
* Avoid warning when DAM marking an override method which has Requires (or its class has) - this avoids lot of noise, NativeAOT currently generates these warnings in full

19 months ago[mono][interp] Lower div.un to shr.un.imm (#83498)
Vlad Brezae [Thu, 16 Mar 2023 13:05:44 +0000 (15:05 +0200)]
[mono][interp] Lower div.un to shr.un.imm (#83498)

* [mono][interp] Remove redundant opcode

Generate sub opcode instead which is detected by other optimizations.

* [mono][interp] Lower div.un to shr.un

19 months agoChange LSRA to more efficiently initialize the availableRegs array (#83479)
Tanner Gooding [Thu, 16 Mar 2023 12:59:31 +0000 (05:59 -0700)]
Change LSRA to more efficiently initialize the availableRegs array (#83479)

* Change LSRA to more efficiently initialize the availableRegs array

* Apply formatting patch

19 months agoUpdated generated interop files from msquic (#83092)
Marie Píchová [Thu, 16 Mar 2023 10:20:48 +0000 (11:20 +0100)]
Updated generated interop files from msquic (#83092)