Marek Fišera [Tue, 2 May 2023 18:38:27 +0000 (20:38 +0200)]
Remove SelfContained from pack (#85636)
Egor Bogatov [Tue, 2 May 2023 18:10:44 +0000 (20:10 +0200)]
Implement ICorProfilerInfo14::GetNonGCHeapBounds (#85434)
dotnet-maestro[bot] [Tue, 2 May 2023 17:27:38 +0000 (19:27 +0200)]
[main] Update dependencies from dnceng/internal/dotnet-optimization (#85470)
Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Viktor Hofer [Tue, 2 May 2023 16:48:09 +0000 (18:48 +0200)]
Remove unnecessary dependency in M.Bcl.TimeProvider (#85639)
see https://github.com/dotnet/runtime/pull/84235/files#r1182370236
dotnet-maestro[bot] [Tue, 2 May 2023 16:39:55 +0000 (18:39 +0200)]
Update dependencies from https://github.com/dotnet/arcade build
20230426.4 (#85459)
Microsoft.DotNet.Arcade.Sdk , Microsoft.DotNet.Build.Tasks.Archives , Microsoft.DotNet.Build.Tasks.Feed , Microsoft.DotNet.Build.Tasks.Installers , Microsoft.DotNet.Build.Tasks.Packaging , Microsoft.DotNet.Build.Tasks.TargetFramework , Microsoft.DotNet.Build.Tasks.Templating , Microsoft.DotNet.Build.Tasks.Workloads , Microsoft.DotNet.CodeAnalysis , Microsoft.DotNet.GenAPI , Microsoft.DotNet.GenFacades , Microsoft.DotNet.Helix.Sdk , Microsoft.DotNet.PackageTesting , Microsoft.DotNet.RemoteExecutor , Microsoft.DotNet.SharedFramework.Sdk , Microsoft.DotNet.VersionTools.Tasks , Microsoft.DotNet.XUnitConsoleRunner , Microsoft.DotNet.XUnitExtensions
From Version 8.0.0-beta.23224.5 -> To Version 8.0.0-beta.23226.4
Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Layomi Akinrinade [Tue, 2 May 2023 15:18:41 +0000 (11:18 -0400)]
Address misc feedback for config binder implementation (#84737)
* Move type graph specs into subfolder
* Address misc feedback for config binder implementation
Viktor Hofer [Tue, 2 May 2023 14:28:08 +0000 (16:28 +0200)]
Remove unnecessary dependencies in System.Text.Json (#85640)
* Remove unnecessary dependencies in System.Text.Json
The `System.ValueTuple` dependency is already provided in-box in .NET Standard and therefore the down-level applicable package doesn't need to be referenced.
* Update System.Text.Json.csproj
* Update Versions.props
Will Smith [Tue, 2 May 2023 14:22:58 +0000 (07:22 -0700)]
[JIT] X64 Fix - Handle 'imul' instruction variants to determine if a register was written to (#85610)
Thays Grazia [Tue, 2 May 2023 12:51:17 +0000 (09:51 -0300)]
[mono][debugger] Support step over and pause multiple times in same line but different columns (#85484)
* Support step over and pause multiple times in a like like this: for (int i = 0; i < 10; i++)
* Fix name on wasm code.
* Adding support to new message MDBGPROT_CMD_STACK_FRAME_GET_COUNT
* Changing position of create_file_to_check_memory_address function
* Adding another command MDBGPROT_CMD_STACK_FRAME_GET_PARAMETERS_COUNT
* Fix arguments count
Tanner Gooding [Tue, 2 May 2023 11:34:35 +0000 (04:34 -0700)]
Ensure zroSimd12Elm3 is explicitly nulled out (#85625)
Aaron Robinson [Tue, 2 May 2023 10:35:24 +0000 (03:35 -0700)]
ComWrappers test that allocate object can't inline (#85583)
* ComWrappers test that allocate object can't inline
There are some JIT stress settings that aggressively
inline functions, regardless of size/complexity. This
inlining can perturb the subtle GC assumptions
inherent in the COM wrappers tests.
Jakob Botsch Nielsen [Tue, 2 May 2023 10:29:09 +0000 (12:29 +0200)]
JIT: Prefer block copies for unenregisterable locals even with GC pointers (#85620)
This comment seems outdated/wrong, the backend's block copy strategy
when GC pointers are involved is highly tuned and often no helper is
necessary at all.
Jan Dupej [Tue, 2 May 2023 09:19:46 +0000 (11:19 +0200)]
[mono][jit] ArmBase methods are now intrinsic. (#85458)
* ArmBase methods are now intrinsic.
* Arm.Yield maps to a NOP.
* Adding hint operation for arm64's yield.
Michal Strehovský [Tue, 2 May 2023 06:41:32 +0000 (15:41 +0900)]
Allow emitting function pointers in TypeSystemMetadataEmitter (#85626)
This is handled. It's unclear to me why it was disallowed.
Unfortunately, this means `IlcGenerateMstatFile` is going to be completely broken in .NET 8 Preview 4.
Michal Strehovský [Tue, 2 May 2023 06:40:30 +0000 (15:40 +0900)]
Make generic composition information more efficient (#85623)
Before this PR, we tracked information about generic composition of a `MethodTable` this way:
* Each generic instance `MethodTable` had a pointer to the generic definition `MethodTable`.
* Each generic instance `MethodTable` had a pointer to its generic composition: a variable sized data structure that had a small header (number of elements, a flag whether it's variant), followed by pointers to `MethodTable`s of components, optionally followed by variance information for each argument.
This works, but it's not particularly efficient, especially in light of some facts that didn't exist at the time this scheme was introduced.
In particular:
* The number of generic parameters can be obtained from the generic definition, no need to duplicate it into instances.
* The variance information can be obtained from the generic definition, no need to duplicate it into instances.
* It makes no sense to indirect to a single-element list - the list can be bypassed if arity is 1.
This PR addresses all of the above.
Saves about 0.5% in size for BasicMinimalApi, improves startup (the composition no longer needs to be dehydrated because it's relative pointers now), and improves working set (the composition stuff accounted for 100 kB of private dehydrated working set in BasicMinimalApi).
Buyaa Namnan [Tue, 2 May 2023 04:25:00 +0000 (21:25 -0700)]
Fix new warnings found with CA1854 improvement. (#85613)
* Fix new warnings found with CA1854 improvement
Bruce Forstall [Tue, 2 May 2023 04:13:17 +0000 (21:13 -0700)]
Fix Helix command lines error code handling (#85622)
The `HelixCommandLines` group must not call `exit` on the script
or the HelixPostCommands and potentially other injected commands
will not run.
Instead, figure out what the exit code should be, and set it properly
(as `ERRORLEVEL` on Windows or `$?` on non-Windows).
Fixes #85621
Tanner Gooding [Tue, 2 May 2023 00:34:35 +0000 (17:34 -0700)]
Cleanup some xarch emit logic (#85536)
* Ensure floating-point codegen uses the VEX aware path
* Fix `IF_RRW_RRW_CNS` to be `IF_RWR_RRD_CNS`
* Fixup emitfmtsxarch.h to have a more consistent layout
* Allow querying the scheduling info for an insFormat
* Ensure the new insFormats are handled
* Ensure we consistently use `emitInsModeFormat`
* Ensure instructions which write to a mask register are EVEX only
* Improve REX.W handling for EVEX only instructions
* Ensure that instructions use the right update mode and tuple type
* Apply formatting patch
* Ensure DstSrcSrc is still handled correctly
* Ensure BLSI/BLSR are still handled in emitOutputAM
* Use static_assert_no_msg
* Fixing the disassembly for IF_RRW_SHF
* Fixing the IF check for shld/shrd on x86
* Use the correct name: inst_RV_TT_IV
* Ensure the 4 operand insFormats include the necessary constant
* Resolve an insFormat check on x86
* Ensure other SIMD code paths are VEX aware
* Improve throughput by using a less expensive emitSizeOfInsDsc
* Apply formatting patch
* Ensure emitSizeOfInsDsc_CNS is used for RWR_RRD_*RD_CNS
* Ensure genSimd12UpperClear uses `andps` for the pre-SSE4.1 path
Mitch Capper (they, them) [Mon, 1 May 2023 22:42:06 +0000 (15:42 -0700)]
DependencyGraphViewer: Fix catastrophic designer fail for NodeForm (#84539)
Fixes experimental designer failure due to having multiple classes in
NodeForm.cs.
Fixes #84538
Theodore Tsirpanis [Mon, 1 May 2023 22:26:58 +0000 (01:26 +0300)]
Support encoding `TypedReference`s in signatures. (#85360)
* Add `SignatureTypeEncoder.TypedReference`.
* Stop failing when encoding a `PrimitiveTypeCode.TypedReference`.
Since we have a dedicated method for typed references, there is no reason to prohibit it.
* Update the documentation of `SignatureTypeEncoder`.
Co-authored-by: Buyaa Namnan <buyankhishig.namnan@microsoft.com>
Zoltan Varga [Mon, 1 May 2023 22:14:38 +0000 (00:14 +0200)]
Remove a RequiresProcessIsolation which is not required. (#85606)
Edouard Choinière [Mon, 1 May 2023 21:33:58 +0000 (17:33 -0400)]
Fix typo in SafeHandle.cs (#85607)
Fixes #85593
Change `providng` to `providing` in a comment.
Buyaa Namnan [Mon, 1 May 2023 20:52:13 +0000 (13:52 -0700)]
Save interfaces implementations and nested types (#85596)
* Save interfaces implemented and nested type
WhiteBlackGoose [Mon, 1 May 2023 20:30:06 +0000 (22:30 +0200)]
NativeAOT instruction for NixOS (#81485)
* NativeAOT instruction for NixOS
* Update compiling.md
* Reworded
* Update src/coreclr/nativeaot/docs/compiling.md
---------
Co-authored-by: Andy Gocke <angocke@microsoft.com>
Co-authored-by: Jan Kotas <jkotas@microsoft.com>
Tanner Gooding [Mon, 1 May 2023 20:22:55 +0000 (13:22 -0700)]
Ensure that IF_*WR_RRD formats support 4-byte SIMD instructions (#85594)
* Ensure that IF_*WR_RRD formats support 4-byte SIMD instructions
* Apply formatting patch
Gérald Barré [Mon, 1 May 2023 19:43:38 +0000 (15:43 -0400)]
Compare host using OrdinalIgnoreCase instead of InvariantCultureIgnoreCase (#85574)
Andy Ayers [Mon, 1 May 2023 18:56:14 +0000 (11:56 -0700)]
JIT: one phi arg per pred (#85546)
Revise SSA to add one phi arg per pred instead of one phi arg per ssa def.
This unlocks some cases for redundant branch opts.
In some pathological cases we may see extremely long phi arg lists. Will
keep an eye out for that and perhaps modify the strategy if we end up
with hundreds or thousands of phi args.
Addresses an issue noted in #48115.
Zoltan Varga [Mon, 1 May 2023 18:34:58 +0000 (20:34 +0200)]
Reenable a test which doesn't seem to fail any more. (#85576)
Re: https://github.com/dotnet/runtime/pull/82663.
dotnet-maestro[bot] [Mon, 1 May 2023 18:20:45 +0000 (13:20 -0500)]
Update dependencies from https://github.com/dotnet/roslyn build
20230426.15 (#85460)
Michał Petryka [Mon, 1 May 2023 17:54:00 +0000 (19:54 +0200)]
Set lvSingleDef for non TYP_REF locals (#85398)
* Set lvSingleDef for non TYP_REF locals
* Apply suggestions from code review
Co-authored-by: Andy Ayers <andya@microsoft.com>
* Rewrite an if
---------
Co-authored-by: Andy Ayers <andya@microsoft.com>
Michal Strehovský [Mon, 1 May 2023 16:58:14 +0000 (01:58 +0900)]
Fix trimmability issues in Quic test (#85579)
Stephen Toub [Mon, 1 May 2023 16:56:20 +0000 (12:56 -0400)]
Enable regex to use IndexOf(..., OrdinalIgnoreCase) for prefix searching (#85438)
As one of its many ways of finding the next possible match starting location, Regex recognizes a string known to start the expression and uses IndexOf to find it. With this change, it can also do so for OrdinalIgnoreCase. With improvements to IndexOf(..., OrdinalIgnoreCase), this now yields significantly faster searches through longer inputs, in addition to leading to simpler code in source generated regexes.
Shreyas Jejurkar [Mon, 1 May 2023 15:45:46 +0000 (21:15 +0530)]
fix: Change severity for SYSLIB1006 to Info instead of warning (#85581)
Zoltan Varga [Mon, 1 May 2023 15:42:23 +0000 (17:42 +0200)]
Revert "[mono][llvm] Enable the cold calling conv on osx/linux. (#83519)" (#85554)
This reverts commit
a2acc6c6529fc25ed350b239efe459b08b0310a6.
Revert this as it causes an assert on osx.
Stephen Toub [Mon, 1 May 2023 14:36:52 +0000 (10:36 -0400)]
Improve vectorization of IndexOf(chars, StringComparison.OrdinalIgnoreCase) (#85437)
* Improve vectorization of IndexOf(chars, StringComparison.OrdinalIgnoreCase)
Use the same general "Algorithm 1: Generic SIMD" that we do for StringComparison.Ordinal, adapter for OrdinalIgnoreCase.
* Fix duplicate local
Kunal Pathak [Mon, 1 May 2023 12:29:50 +0000 (05:29 -0700)]
Do not set pre-decided consecutive registers as busy (again) (#85566)
SwapnilGaikwad [Mon, 1 May 2023 12:29:28 +0000 (13:29 +0100)]
Fix processing of x86 test results (#82301)
Huo Yaoyuan [Mon, 1 May 2023 11:57:34 +0000 (19:57 +0800)]
Remove cached Type instances (#85557)
* Remove the Type cache in Convert
* Remove Type cache in MaskedTextProvider
* Remove Type cache in DataSetUtil
* Remove Type cache in ResourceManager
* Remove Type cache in XmlBinaryReader
* Remove Type cache in XsltConvert
* Remove Type cache in DataTypeImplementation
* Introduce a local variable for typeof(string)
Michal Strehovský [Mon, 1 May 2023 11:56:46 +0000 (20:56 +0900)]
Translate AV in RhpByRefAssignRef to NullReferenceException (#85575)
Fixes dotnet/runtimelab#197.
Ran into this again when curiosity made my try a newly added JIT test with NativeAOT.
Milos Kotlar [Mon, 1 May 2023 11:36:32 +0000 (14:36 +0300)]
[mono][aot] Refactor deduplication to use enum instead of flags (#85384)
* Use enum instead of multiple dedup flags
Michal Strehovský [Mon, 1 May 2023 10:17:01 +0000 (19:17 +0900)]
Delete finally blocks in EcmaSignatureParser (#85577)
These lightweight structs are not meant to be reusable.
Michal Strehovský [Mon, 1 May 2023 10:16:39 +0000 (19:16 +0900)]
Emission and reading of custom modifiers (#85504)
Fixes #71883.
* Emit custom modifiers to the native metadata format
* Read custom modifiers at runtime
* Bugfix in the type loader
SingleAccretion [Mon, 1 May 2023 10:04:12 +0000 (13:04 +0300)]
Split assignment rationalization into a separate phase (#85180)
* General IR support
* Introduce GTK_STORE
And make "OperIsStore" means exactly these opers:
GT_STORE_LCL_VAR
GT_STORE_LCL_FLD
GT_STOREIND
GT_STORE_BLK
Notable: GT_STORE_DYN_BLK is excluded as it does
not follow conventions of all other stores (e. g.
is VOID-typed) and acts more like opaque atomic
operations instead.
Also fix an old bug with gtNodeHasSideEffects.
* Fix OperExceptions
* Introduce and use gtNewStoreLclFldNode
* gtNewStoreLclVar -> gtNewStoreLclVarNode
* Use OperIsAnyLocal in more places
* Introduce ASG rationalization phase
* Introduce switch for stress-morphing
* Fix formatting
Egor Bogatov [Mon, 1 May 2023 08:37:51 +0000 (10:37 +0200)]
JIT: Make optAssertionPropGlobal_RelOp less conservative for side-effects (#85532)
Co-authored-by: SingleAccretion <62474226+SingleAccretion@users.noreply.github.com>
Michal Strehovský [Mon, 1 May 2023 04:40:42 +0000 (13:40 +0900)]
Delete more type equivalence logic (#85507)
* Delete more type equivalence logic
In .NET Native times we could have a situation where two different `MethodTable` pointers represented the same type. This could happen for cloned types, or structurally equivalent parameterized types. The cloned type concept was never used in Native AOT. The structural equivalence disappeared in https://github.com/dotnet/runtimelab/commit/
0ef7bd6cfe129f4c308f5d6dae1eccf48c3cdff4. Neither of those seems useful. So getting rid of some of the vestiges.
* Delete more stuff
* Remember statically present pointer and mdarrays
Michal Strehovský [Mon, 1 May 2023 04:39:37 +0000 (13:39 +0900)]
Delete `arrayArgumentsFound` logic from type loader (#85509)
I think this was handling a situation where we're trying to find an existing `MethodTable` for `Foo<SomeType[]>` and such `MethodTable` does statically exist but we didn't have a mapping table entry for `SomeType[]` and we couldn't get a `MethodTable` for it, even though it statically exists in the image. Since the compiler optimization to skip emitting this mapping got commented out, it wasn't actually possible to end up in a situation where we wouldn't know how to find a `MethodTable` for an existing array at runtime. We therefore don't need the slow path that tries to find the type without having `MethodTable`s for all generic arguments.
Gérald Barré [Sun, 30 Apr 2023 23:12:57 +0000 (19:12 -0400)]
Replace InvariantCulture comparison with Ordinal (#85572)
Stephen Toub [Sun, 30 Apr 2023 22:59:34 +0000 (18:59 -0400)]
Reduce overheads of Regex.Replace with a text replacement string (#85564)
* Reduce overheads of Regex.Replace with a text replacement string
If the replacement string doesn't contain any backreferences, we can reduce the overheads involved in processing the replacement. Rather than storing a list of `ReadOnlyMemory<char>` segments for every portion of the original string or replacement, we can just store a list of `(int offset, int count)` pairs; if the offset is non-negative it refers to the original string, and if it's negative, it means to use the whole replacement. We can also avoid evaluating the rules each time, and since we're not storing string references into the arrays, we don't need to clear the arrays before returning them to the pool.
* Replace builders with more generic StructListBuilder
SingleAccretion [Sun, 30 Apr 2023 18:17:41 +0000 (21:17 +0300)]
Delete `OBJ(LCL_ADDR)` args handling from local morph ref counting (#85544)
* Delete OBJ args handling from local morph
* Delete outdated comments
Maksim Golev [Sun, 30 Apr 2023 16:58:26 +0000 (20:58 +0400)]
Fix/31527 invalid currentculture applying (#85297)
Co-authored-by: Maksim Golev <mgolev@htc-cs.ru>
SingleAccretion [Sat, 29 Apr 2023 20:32:21 +0000 (23:32 +0300)]
Simplify some importer code (#84656)
Qiao Pengcheng [Sat, 29 Apr 2023 16:36:15 +0000 (00:36 +0800)]
[LoongArch64] fix the errors when reverse GT_JCC. (#85555)
* [LoongArch64] fix the errors when reverse GT_JCC.
* just modify the LA64's files for CRs.
Zoltan Varga [Sat, 29 Apr 2023 04:23:29 +0000 (06:23 +0200)]
[mono][jit] Emit a null check when storing to valuetype fields. (#82663)
* [mono][jit] Emit a null check when storing to valuetype fields.
Fixes https://github.com/dotnet/runtime/issues/82535.
* Add a test.
* Disable the test on coreclr.
SingleAccretion [Fri, 28 Apr 2023 22:02:43 +0000 (01:02 +0300)]
Fix volatility checks in VN and loop side effects code (#85467)
* Fix volatile check in loop side effects code
* Restore the volatility logic in VN
Volatile stores should be processed at the point of ASG.
Andy Ayers [Fri, 28 Apr 2023 21:26:09 +0000 (14:26 -0700)]
JIT: enhance SSA checker to check some PHI properties (#85533)
* Ensure PhiArgs have the right local number.
* Ensure PhiArgs have unique `gtPredBB` (for most blocks)
* Verify phidef/non-phidef order
Handler entries may have multiple PhiArgs with the same `gtPredBB`. This
is by design, to model exceptional flow from the middle of the block to a
handler.
Jump threading relies on there being just a single PhiArg per pred.
So exclude handler entry blocks from jump threading.
Prep work for possibly changing SSA to produce one PhiArg per pred, instead
of one PhiArg per ssa def.
Jan Vorlicek [Fri, 28 Apr 2023 21:12:27 +0000 (23:12 +0200)]
Fix exception leaking from filter in nativeAOT (#85366)
* Fix exception leaking from filter in nativeAOT
There is a bug in handling exceptions that occur in exception filters in
nativeAOT. If such exception is not handled in the filter, it needs to
be swallowed and the filter should behave as if it returned `false`.
Instead of that, the current behavior is that debug build of the runtime
asserts and the release build fails fast without any message.
This change fixes it by catching the exception in the exception handling
code. It was also necessary to modify the stack frame iterator to let it
unwind past the filter funclet instead of failing fast.
* Reenable tests disabled due to the issue
Ivan Diaz Sanchez [Fri, 28 Apr 2023 20:39:49 +0000 (13:39 -0700)]
Fix XUnit Log Fixer Irregularities (#85183)
* Fixed the log tags regular expressions.
* Added test exit code to the XUnit Log Checker, and made it return it as well for Helix to process it.
* Finished fixes.
* Decoupled the test's exit code from the XUnit Log Checker.
Juan Hoyos [Fri, 28 Apr 2023 20:39:16 +0000 (13:39 -0700)]
Add documentation for merge on red, build analysis, and v1/v2 tests (#84982)
Co-authored-by: Carlos Sánchez López <1175054+carlossanlop@users.noreply.github.com>
Co-authored-by: Jeremy Koritzinsky <jkoritzinsky@gmail.com>
Aleksey Kliger (λgeek) [Fri, 28 Apr 2023 19:54:14 +0000 (15:54 -0400)]
[wasm-mt] Support async JS interop on threadpool threads (#84494)
This is the last part of #84489 - initial runtime support for async JS interop on threadpool threads in multi-threaded WebAssembly.
Conceptually there are a few things here:
* A mechanism for the native runtime to start some threads as "exitable" so that we don't clean up when they return from their thread start function. (we will clean up when the pthreads TLS dtor runs)
* A change to make JSHostImplementation.s_csOwnedObjects a thread-static in multithreaded builds. This is because the map keys on a small integer handle that is allocated per-thread on the JS side as a handle for JS objects that are to be kept alive because managed code depends on them. (This is needed in general, but also makes the new smoke test work)
* A version of the PortableThreadPool.WorkerThread that starts as an exitable thread and uses asynchronous callbacks to wait for available threadpool work items and returns to the JS event loop periodically in order to allow JS promises to settle.
* A smoke test that does a background JS fetch and some async callbacks on it.
---
* [wasm-mt] Enable JSInterop on threadpool workers
Implement PortableThreadPool loop using semaphore callbacks
manage emscripten event loop from PortableThreadPool.WorkerThread
make sure to keep the thread alive after setting up the semaphore wait.
Cleanup the thread when exiting
minimal sample - fetch on a background thread works
Add WebWorkerEventLoop internal class to managed event loop keepalive
Start threadpool threads with keepalive checks
Add a flag to mono's thread start wrappers to keep track of threads that may not want cleanup to run after the Start function returns.
Use the flag when starting threadpool threads.
make minimal FetchBackground sample more like a unit test
Set WorkerThread.IsIOPending when the current thread has unsettled JS interop promises.
When IsIOPending is true, the worker will not exit even if it has no more work to do. Instead it will repeatedly wait for more work to arrive or for all promises to settle.
change minimal sample's fetch helper to artificially delay
the delay is longer that the threadpool worker's semaphore timeout, in order to validate that the worker stays alive while there are unsettled promises
* [wasm-mt] Add background interop to smoketest
* update to use the LowLevelLifoAsyncWaitSemaphore
* adjust to renamed PortableThreadPool helper methods
* adjust to renamed WebWorkerEventLoop.HasJavaScriptInteropDependents
* extend and rationalize the smoke test a bit
Add a test that just starts a thread and asserts that it has a different thread ID than the main thread. This should allow us to rule out accidentally having the test pass on a single-threaded runtime
* hide some debug output
* smoke test: dispose of the ImportAsync result after the task is done
* [wasm-mt] make JSHostImplementation.s_csOwnedObjects ThreadStatic
The integer jsHandles are not global - they are essentially indices into a JS array. So the mapping from a jsHandle to a JSObject must be per-thread.
This fixes the thread affinity assertions in the smoketest (which were false positives - we looked up a worker's jsHandle and got back the main thread's JSObject - and then asserted that it was accessed from the wrong thread)
* remove locking on JSHostImplementation.CsOwnedObjects
In single-threaded wasm, there is no need to lock since there is only one caller at a time.
In multi-threaded wasm, the underlying dictionary is thread-static
* [threads] make the "external eventloop" platform independent
It only does something on WASM, but in principle if other platforms allow us to run some code after returning from a thread start function, we could do it there, too.
* Add a Thread.HasExternalEventLoop managed property
Set it from WebWorkerEventLoop.StartExitable.
In native code, use it to set the `MONO_THREAD_CREATE_FLAGS_EXTERNAL_EVENTLOOP` flag when starting the thread.
* rename JSHostImplementation.ThreadCsOwnedObjects
(used to be CsOwnedObjects)
Rename to make it clear that it's objects owned by the current thread, not the runtime globally
* [checked] assert GC Safe mode, when returning to external eventloop
Will Smith [Fri, 28 Apr 2023 19:22:08 +0000 (12:22 -0700)]
Skip methods in test-merging if they use the named argument 'Skip' for the Fact attributes (#85495)
* Skip methods in test-merging if they use the named argument 'Skip'
* Use ActiveIssueAttribute instead of FactAttribute with Skip. Add documentation about FactAttribute and Skip.
Fan Yang [Fri, 28 Apr 2023 19:13:57 +0000 (15:13 -0400)]
[Mono] Intrinsify Vector128.Create on Arm64 for mini JIT (#85404)
* Intrinsify Vector128.Create
* Hopefully fix the test failure
* Increase maximal instruction length
Zoltan Varga [Fri, 28 Apr 2023 19:05:13 +0000 (21:05 +0200)]
[mono][llvm] Assert on unhandled opcodes instead of falling back to the mini JIT. (#85454)
Stephen Toub [Fri, 28 Apr 2023 18:50:39 +0000 (14:50 -0400)]
Remove redundant dictionary lookup in XPathDocument (#85534)
Stephen Toub [Fri, 28 Apr 2023 18:50:25 +0000 (14:50 -0400)]
Remove Base64 value length limit from Utf8JsonWriter (#85334)
* Remove Base64 value length limit from Utf8JsonWriter
* Address PR feedback by adding some more asserts
Buyaa Namnan [Fri, 28 Apr 2023 17:43:06 +0000 (10:43 -0700)]
Abstract out ParameterBuilder and implement it (#85446)
* Save parameters into assembly and test it
* Add MarshalAs pseduo attribute handling and other refactoring
* Apply suggestions from code review
Co-authored-by: Jan Kotas <jkotas@microsoft.com>
---------
Co-authored-by: Jan Kotas <jkotas@microsoft.com>
Zoltan Varga [Fri, 28 Apr 2023 16:46:56 +0000 (18:46 +0200)]
Reduce some collection sizes in the System.Collections.Immutable tests. (#85508)
The previous sizes caused timeouts when running on wasm+interpreter on CI.
Sergio Pedri [Fri, 28 Apr 2023 16:38:49 +0000 (09:38 -0700)]
Add ImmutableCollectionsMarshal type and AsImmutableArray/AsArray APIs (#85526)
* Add ImmutableCollectionsMarshal type
* Add ImmutableCollectionsMarshal to ref assembly
* Add ImmutableCollectionsMarshal unit tests
* Use ImmutableCollectionsMarshal in System.Reflection.Metadata
* Remove ImmutableArrayFactory and use new API
* Leverage internal members in ImmutableCollectionsMarshal
* Remove leftover unsafe modifier in ImmutableCollectionsMarshal
dotnet-maestro[bot] [Fri, 28 Apr 2023 16:36:32 +0000 (12:36 -0400)]
Update dependencies from https://github.com/dotnet/xharness build
20230428.3 (#85519)
Microsoft.DotNet.XHarness.CLI , Microsoft.DotNet.XHarness.TestRunners.Common , Microsoft.DotNet.XHarness.TestRunners.Xunit
From Version 1.0.0-prerelease.23228.2 -> To Version 1.0.0-prerelease.23228.3
Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Radek Doulik [Fri, 28 Apr 2023 16:31:45 +0000 (18:31 +0200)]
[wasm] PackedSimd, add comparison methods (#85512)
Zoltan Varga [Fri, 28 Apr 2023 16:22:19 +0000 (18:22 +0200)]
[mono] Invoke AssemblyLoad hooks from RuntimeAssemblyBuilder:.ctor () instead from native code. (#85307)
The call from native code is made before the manifest module was created, causing errors if the
hook tried to access Assembly.ManifestModule.
Fixes https://github.com/dotnet/runtime/issues/84771.
Pavel Savara [Fri, 28 Apr 2023 15:37:47 +0000 (17:37 +0200)]
[browser] cleanup of early startup code (#83411)
Michal Strehovský [Fri, 28 Apr 2023 13:53:53 +0000 (22:53 +0900)]
Make preinitialized delegates reflection-visible (#85506)
Frozen delegate instances were bypassing the callback to metadata manager that lets metadata manager inject reflection dependencies on delegate construction. Introduce a spot for the callback.
Fixes dotnet/aspnetcore#47941.
Vladimir Sadov [Fri, 28 Apr 2023 13:33:49 +0000 (06:33 -0700)]
[NativeAOT] Use 8.1 atomics, if available, in RhpCheckedXchg/RhpCheckedLockCmpXchg (#85283)
* use atomics when available
* exch win
* conditional atomics
* moving ARM64_ATOMICS_FEATURE_FLAG_BIT to AsmOffsets.h and adding a static assert.
* enable lse locally in the asm helpers
Vladimir Sadov [Fri, 28 Apr 2023 13:32:49 +0000 (06:32 -0700)]
[NativeAOT] Allow reverse pinvoke in DoNotTriggerGc thread state regardless of coop mode. (#85435)
* Allow reverse pinvoke in DoNotTriggerGc thread state regardless of coop mode.
* do not attach DoNotTriggerGc threads in reverse pinvoke
* propagate useful msbuild arguments to the build
* more PR feedback.
* a nit - more consistent formatting
* Do not pass through StripSymbols
Egor Bogatov [Fri, 28 Apr 2023 13:10:42 +0000 (15:10 +0200)]
JIT: ARR_LENGTH(new T[CNS]) --> CNS (#85496)
dotnet-maestro[bot] [Fri, 28 Apr 2023 12:56:20 +0000 (12:56 +0000)]
Update dependencies from https://github.com/dotnet/xharness build
20230428.2 (#85513)
[main] Update dependencies from dotnet/xharness
Milos Kotlar [Fri, 28 Apr 2023 10:42:00 +0000 (12:42 +0200)]
[mono][tests] Enable runtime tests for local aliasing on Mono Interpreter (#85250)
* Enable runtime tests when a local can be modified indirectly
* Split the test project into two
* Disable test in issues.targets
Pavel Savara [Fri, 28 Apr 2023 09:13:18 +0000 (11:13 +0200)]
[browser] Expanding timeouts for long running test projects (#85313)
Marie Píchová [Fri, 28 Apr 2023 08:37:08 +0000 (10:37 +0200)]
[HTTP/3] Stress hack for msquic dropping connections (#84793)
* Implement the same hack as for functional tests to prevent msquic from dropping connections
* Feedback: removed code sharing and used reflaction
* Try to fix missing build dependency
* Feedback - removed test only function and replaced with shared code + some reflection
* fix argument handling in build-local.ps1
* do not use MsQuicLibraryVersion
* copy msquic interop utils to the SDK base image
* use LinkBase in Functional.Tests.csproj for wildcard include
* Use MsQuicLibraryVersion in out internal logging and as a side-effect avoid the property being trimmed
* Comment
* also copy files to the Linux container
---------
Co-authored-by: antonfirsov <antonfir@gmail.com>
Vladimir Sadov [Fri, 28 Apr 2023 04:10:17 +0000 (21:10 -0700)]
Comment out support for mtag extension in libunwind (#85474)
Works around build breaks with some compiler versions.
Fixes https://github.com/dotnet/source-build/issues/3424
* added a commit reference to libunwind-version.txt
* move commit to the right file
---------
Co-authored-by: Jan Kotas <jkotas@microsoft.com>
Adeel Mujahid [Fri, 28 Apr 2023 04:08:03 +0000 (07:08 +0300)]
Disable crossgen on riscv64 (#85499)
Adeel Mujahid [Fri, 28 Apr 2023 04:05:50 +0000 (07:05 +0300)]
Add better fix for UnhandledExceptionHandlerUnix (#85497)
Egor Bogatov [Thu, 27 Apr 2023 23:47:58 +0000 (01:47 +0200)]
Enable AVX-512 for block unrollings (both copying and zeroing) (#85389)
Parker Bibus [Thu, 27 Apr 2023 22:53:57 +0000 (15:53 -0700)]
[PERF] Add Android BenchmarkDotNet test (#85282)
* Setup testing and add missing depends on.
Shift perflab dependencies to the app build through insertion rather than being in the Maui repo.
Add PERFLAB_INLAB preprocessor constant to include the environment variables section of the Maui app in the build.
Switch to using the main branch of the perf repo.
Hardcoded in the output path to avoid unused variable error when building the Maui App.
* Print runtime pack locations after updating the locations to allow verification of correct package usage.
* Up timeout time for the BDN app test as they take a little bit of time.
Bruce Forstall [Thu, 27 Apr 2023 22:51:07 +0000 (15:51 -0700)]
Try to fix _MergedWrapperMarker (#85476)
Don't include markers without execution scripts
Juan Hoyos [Thu, 27 Apr 2023 22:06:22 +0000 (15:06 -0700)]
Fix createdump arg parsing for signal-based exceptions (#85422)
Ankit Jain [Thu, 27 Apr 2023 22:03:58 +0000 (18:03 -0400)]
[wasm] GenerateWasmBootJson - close file handles (#85480)
Close files opened with `File.OpenRead` by utilizing the `using`
pattern.
Ankit Jain [Thu, 27 Apr 2023 20:07:31 +0000 (16:07 -0400)]
[wasi] Fix support for paths with spaces (#85022)
* [wasi] Fix disabling wasi build for projects
* [wasi] Fix quoting in Wasi targets
* [wasi] WBT: don't run wasi targets for the tests project
Michał Petryka [Thu, 27 Apr 2023 17:52:36 +0000 (19:52 +0200)]
Reduce calli address spilling (#85349)
Jakob Botsch Nielsen [Thu, 27 Apr 2023 17:41:50 +0000 (19:41 +0200)]
JIT: Handle GT_RETFILT in fgInsertStmtNearEnd (#85420)
Also add some logging for read backs in physical promotion.
Fix #85088
Jakob Botsch Nielsen [Thu, 27 Apr 2023 17:16:33 +0000 (19:16 +0200)]
JIT: Propagate some more indir flags in physical promotion (#85453)
When physical promotion creates multiple indirections for arbitrary
BLK/FIELD sources, make sure we propagate all relevant flags.
Fix #85449
Qiao Pengcheng [Thu, 27 Apr 2023 17:12:40 +0000 (01:12 +0800)]
[LoongArch64] Implements the emitter::emitDispIns. (#85375)
* [LoongArch64] Implements the emitter::emitDispIns.
* LA64 don't support Instruction list before jump distance binding.
* delete some unused codes.
* amend code for CR.
Alexander Soldatov [Thu, 27 Apr 2023 17:11:59 +0000 (20:11 +0300)]
[RISC-V] GT_JMP implementation in codegen (#85416)
Added GT_JMP support to codegen. Based on ARM64 implemetation.
Dong-Heon Jung [Thu, 27 Apr 2023 17:11:25 +0000 (02:11 +0900)]
[RISC-V][JIT] JIT/CodeGenBringUpTest (#84748)
* [JIT] Update RISCV64
- Update Floating Point Compare
- Implement NYI functions
* [JIT] Update RISCV64
- Implement NYI functions
* [JIT] FIX TEST ERRORS
- Implement NYI functions
* [JIT] FIX TEST ERROR
- Update genFnPrologCalleeRegArgs
* [JIT] FIX TEST ERRORS
* [JIT] FIX TEST ERROR
Fix an error in ./JIT/CodeGenBringUpTests/struct16args_d/struct16args_d.sh
* [JIT] Fix rotate test errors
Fixed erros in belows
./JIT/CodeGenBringUpTests/Rotate_d/Rotate_d.sh
./JIT/CodeGenBringUpTests/Rotate_do/Rotate_do.sh
./JIT/CodeGenBringUpTests/Rotate_r/Rotate_r.sh
./JIT/CodeGenBringUpTests/Rotate_ro/Rotate_ro.sh
* [JIT] Fix erorrs in JTrueNeFP
Resolve
```
./JIT/CodeGenBringUpTests/JTrueNeFP_do/JTrueNeFP_do.sh
./JIT/CodeGenBringUpTests/JTrueNeFP_d/JTrueNeFP_d.sh
./JIT/CodeGenBringUpTests/JTrueNeFP_r/JTrueNeFP_r.sh
./JIT/CodeGenBringUpTests/JTrueNeFP_ro/JTrueNeFP_ro.sh
```
* [JIT] Fix an error
Add a missed part for making constant.
In the cases, it is -12.
Resolved
./JIT/CodeGenBringUpTests/NegRMW_do/NegRMW_do.sh
./JIT/CodeGenBringUpTests/NegRMW_ro/NegRMW_ro.sh
* [JIT] Optimize making constant a little
TODO-RISCV64: We should optimize constant and address construction.
* [JIT] Update emitIns_I_la more
* Add todo comment about code quality
* [JIT] Fix bugs in float and double
- Change fcvt to fmv in ins_Copy
* [JIT] Remove unnecessary comment
* [JIT] FIX
- Add rounding mode
* [JIT] Fix error
- Add Neg for float
- Add rounding mode in float arithmetic
* [JIT] Update Float Neg
* [JIT] Update rounding mode and register use
* [JIT] Update
- remove dead code
* [JIT] Support Float JumpCompare
* [JIT] Remove GT_OBJ and LCL_VAR_ADDR
* [JIT] JIT-FORMAT
* [JIT] Fix JCMP cond error
- Reverse JCMP cond for reversing jump opt
* Revert "[JIT] Fix JCMP cond error"
This reverts commit
bed8b9c12bd0340bc1519e1436d4acde209a9222.
* [JIT] Remove rounding mode comments
* [JIT] Fix Float-to-Float copy
* Update Alignment and Definitions
---------
Co-authored-by: Gleb Balykov <g.balykov@samsung.com>
Andy Gocke [Thu, 27 Apr 2023 16:56:15 +0000 (09:56 -0700)]
Store unhandled exception info on stack in Native AOT (#84871)
Allocates a span on the stack to hold the ToString of the exception, as well as a CrashRecord which contains a unique cookie that can be used to find the exception info.
Fixes #84636
dotnet-maestro[bot] [Thu, 27 Apr 2023 16:28:07 +0000 (11:28 -0500)]
[main] Update dependencies from dotnet/llvm-project dotnet/runtime-assets dotnet/emsdk dotnet/hotreload-utils dotnet/cecil (#85310)
* Update dependencies from https://github.com/dotnet/emsdk build
20230424.2
Microsoft.NET.Workload.Emscripten.Current.Manifest-8.0.100.Transport
From Version 8.0.0-preview.4.23219.1 -> To Version 8.0.0-preview.4.23224.2
* Update dependencies from https://github.com/dotnet/cecil build
20230424.2
Microsoft.DotNet.Cecil
From Version 0.11.4-alpha.23218.2 -> To Version 0.11.4-alpha.23224.2
* Update dependencies from https://github.com/dotnet/llvm-project build
20230424.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.23221.2 -> To Version 14.0.0-alpha.1.23224.3
* Update dependencies from https://github.com/dotnet/runtime-assets build
20230425.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.23218.1 -> To Version 8.0.0-beta.23225.1
* Update dependencies from https://github.com/dotnet/emsdk build
20230425.2
Microsoft.NET.Workload.Emscripten.Current.Manifest-8.0.100.Transport
From Version 8.0.0-preview.4.23219.1 -> To Version 8.0.0-preview.5.23225.2
* Update dependencies from https://github.com/dotnet/hotreload-utils build
20230425.6
Microsoft.DotNet.HotReload.Utils.Generator.BuildTool
From Version 8.0.0-alpha.0.23219.2 -> To Version 8.0.0-alpha.0.23225.6
* bump to p5
* Update dependencies from https://github.com/dotnet/hotreload-utils build
20230426.3
Microsoft.DotNet.HotReload.Utils.Generator.BuildTool
From Version 8.0.0-alpha.0.23219.2 -> To Version 8.0.0-alpha.0.23226.3
---------
Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: Larry Ewing <lewing@microsoft.com>
Ankit Jain [Thu, 27 Apr 2023 15:47:53 +0000 (11:47 -0400)]
[wasm] Use latest stable version of chrome (#85114)
Michal Strehovský [Thu, 27 Apr 2023 13:43:27 +0000 (22:43 +0900)]
Delete support for IAT indirecting base type/interfaces (#85376)
* Delete support for IAT indirecting base type/interfaces
This is used if we have a SharedLibrary.dll a la .NET Native. SharedLibrary.dll model had a lot of problems around versioning and a "framework-dependent" deployment model like that is unlikely to come back. I think we can start to slowly get rid of and get marginally faster code and less maintenance cost in return.
* Bump header
Radek Zikmund [Thu, 27 Apr 2023 12:47:50 +0000 (14:47 +0200)]
Make some SystemNetSecurity properties public (#85402)
* Change API
* Fix Quic
* Expose TlsClientHelloInfo ctor
* Remove now unnecessary suppression file
* Add API comments
dotnet-maestro[bot] [Thu, 27 Apr 2023 08:46:44 +0000 (10:46 +0200)]
Update dependencies from https://github.com/dotnet/roslyn-analyzers build
20230425.2 (#85393)
Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>