platform/upstream/dotnet/runtime.git
15 months agoPinnedMarshal after marshalling in unmanaged to managed (#90117)
Jackson Schuster [Tue, 8 Aug 2023 22:37:37 +0000 (17:37 -0500)]
PinnedMarshal after marshalling in unmanaged to managed (#90117)

PinnedMarshal has the "FromManaged" call in stateful marshallers, so that needs to happen before marshal in unmanaged to managed stubs.

15 months ago[RISC-V] Add g_GCShadowEnd to JIT_WriteBarrier_Table (#90036)
Alexander Soldatov [Tue, 8 Aug 2023 22:20:16 +0000 (01:20 +0300)]
[RISC-V] Add g_GCShadowEnd to JIT_WriteBarrier_Table (#90036)

lla pseudo instruction which used for access to g_GCShadowEnd
in JIT_WriteBarrier implemented via PC-relative addressing. But when
W^X enabled, copy of JIT_WriteBarrier is being created and this PC-related
addressing is not valid, which cause crash.

This change moves address of g_GCShadowEnd to JIT_WriteBarrier_Table like
others variables used in Write Barrier.

15 months agoAdd EnableDiagnostics sub-configs for IPC, debugger, and profiler (#90159)
Tom McDonald [Tue, 8 Aug 2023 21:48:58 +0000 (17:48 -0400)]
Add EnableDiagnostics sub-configs for IPC, debugger, and profiler (#90159)

15 months agoCleanup caller allocated and callee allocated resources separately (#89982)
Jackson Schuster [Tue, 8 Aug 2023 21:47:45 +0000 (16:47 -0500)]
Cleanup caller allocated and callee allocated resources separately (#89982)

This PR separates cleaning up caller allocated resources and callee allocated resources into separate stages in the managed to unmanaged direction. Caller allocated parameters (anything except 'out') will clean up the same way. Callee allocated parameters ('out' parameters) will be cleaned up only if the invocation succeeded.

15 months agoFix Activity Baggage logging scope (#90127)
Tarek Mahmoud Sayed [Tue, 8 Aug 2023 19:20:25 +0000 (12:20 -0700)]
Fix Activity Baggage logging scope (#90127)

15 months ago[browser] Read `AssetTraitValue` to get culture for resource during webcil transforma...
Marek Fišera [Tue, 8 Aug 2023 19:03:23 +0000 (21:03 +0200)]
[browser] Read `AssetTraitValue` to get culture for resource during webcil transformation (#89600)

* Read AssetTraitValue when determining culture for resource during webcil transformation
* Add WBT with Blazor with resources in two cultures and build+publish
* Check for emcc-link.rsp instead of that for-build directory exists
* track api changes in main
* Avoid using unicode character in an unrelated test name. it breaks emcc build on windows

---------
Co-authored-by: Ankit Jain <radical@gmail.com>
15 months agoCrossgen2 support for static virtual method resolution (take 2) (#87438)
Tomáš Rylek [Tue, 8 Aug 2023 18:43:50 +0000 (20:43 +0200)]
Crossgen2 support for static virtual method resolution (take 2) (#87438)

This change adds SVM resolution support to Crossgen2. We still resort to
runtime JIT in case we cannot resolve the SVM call at compile time (typically for
canonical generic methods); some of these cases are just due to current limitations
of the JIT interface and can be fixed in the future.

Thanks

Tomas

15 months agouse correct marshaller for elements (#90176)
Jackson Schuster [Tue, 8 Aug 2023 17:56:48 +0000 (12:56 -0500)]
use correct marshaller for elements (#90176)

15 months agoSimplify Http2Connection shutdown/dispose logic (#90094)
Miha Zupan [Tue, 8 Aug 2023 17:44:03 +0000 (19:44 +0200)]
Simplify Http2Connection shutdown/dispose logic (#90094)

* Simplify Http2Connection shutdown/dispose logic

* Add a test for SocketsHttpHandler disposal mid request

15 months agoTry to fix missing libc++.so.1 errors in arm64 llvmaot perf run (#88705)
Jo Shields [Tue, 8 Aug 2023 17:31:27 +0000 (13:31 -0400)]
Try to fix missing libc++.so.1 errors in arm64 llvmaot perf run (#88705)

* Try to fix missing libc++.so.1 errors in arm64 llvmaot perf run
* Pass required flags for AOT build of Mono

15 months ago[iOS] Generate unique class name for MonoDeadLetter (#89956)
Steve Pfister [Tue, 8 Aug 2023 16:29:57 +0000 (09:29 -0700)]
[iOS] Generate unique class name for MonoDeadLetter (#89956)

In library mode, it is possible to have multiple shared libraries (runtimes) loaded in the same process. On iOS, we have a small bit of objc to make sure we know when threads die so we can properly detach the runtime. Unfortunately, the class name we use is not unique and results in a crash when calling into a 2nd library.

This change makes the class name partially unique to avoid such a circumstance.

15 months agoUse bidirectional marshallers for elements. (#90056)
Jeremy Koritzinsky [Tue, 8 Aug 2023 16:28:09 +0000 (09:28 -0700)]
Use bidirectional marshallers for elements. (#90056)

15 months agoCrossplatform ResourceUpdater (#89303)
anatawa12 [Tue, 8 Aug 2023 16:18:54 +0000 (01:18 +0900)]
Crossplatform ResourceUpdater (#89303)

This enables cross-builds of windows applications on non-windows to have updated win32 resources. It also removes the need to open/write the app host multiple times during build.

15 months ago[iOS][non-icu] HybridGlobalization implement calendar data (#90004)
Meri Khamoyan [Tue, 8 Aug 2023 15:53:11 +0000 (19:53 +0400)]
[iOS][non-icu] HybridGlobalization implement calendar data (#90004)

Implement calendar info for hybrid mode on iOS

15 months ago[browser] don't propagate JS errors in WS abort (#90148)
Pavel Savara [Tue, 8 Aug 2023 15:36:49 +0000 (17:36 +0200)]
[browser] don't propagate JS errors in WS abort (#90148)

15 months agoSupport `DllImportSearchPath.AssemblyDirectory` for NativeAOT applications (#90120)
Aaron Robinson [Tue, 8 Aug 2023 14:38:54 +0000 (07:38 -0700)]
Support `DllImportSearchPath.AssemblyDirectory` for NativeAOT applications (#90120)

* NativeAOT - Suppress OS dialog for LoadLibrary failures
on Windows.

* Update NativeAOT to load from application
directory when DllImportSearchPath.AssemblyDirectory
is defined.

15 months agoCleanup work (#89976)
Lakshan Fernando [Tue, 8 Aug 2023 13:35:41 +0000 (06:35 -0700)]
Cleanup work (#89976)

* Cleanup work

* FB

* test fix

* Implement per-thread activity_id

* FB

* Update src/coreclr/nativeaot/Runtime/eventpipeinternal.cpp

Co-authored-by: Elinor Fung <elfung@microsoft.com>
* replace pThread with activityIdHandle

* increase helix timeout for checked aot run

---------

Co-authored-by: Elinor Fung <elfung@microsoft.com>
15 months ago[tests] Attempt to enable test (#89498)
Vlad Brezae [Tue, 8 Aug 2023 13:30:43 +0000 (16:30 +0300)]
[tests] Attempt to enable test (#89498)

15 months agoMark XxHash64.Complete as noinline (#90142)
Egor Bogatov [Tue, 8 Aug 2023 13:16:10 +0000 (15:16 +0200)]
Mark XxHash64.Complete as noinline (#90142)

15 months ago[browser] app start benchmark fix, loadBootResource fix (#89857)
Pavel Savara [Tue, 8 Aug 2023 12:00:57 +0000 (14:00 +0200)]
[browser] app start benchmark fix, loadBootResource fix (#89857)

Co-authored-by: Ankit Jain <radical@gmail.com>
15 months agoEnsure OuterLoop test doesn't use reflection in SG test suite. (#90137)
Eirik Tsarpalis [Tue, 8 Aug 2023 09:37:01 +0000 (12:37 +0300)]
Ensure OuterLoop test doesn't use reflection in SG test suite. (#90137)

15 months agoFix host debug view not showing services before start (#89610)
James Newton-King [Tue, 8 Aug 2023 09:06:26 +0000 (17:06 +0800)]
Fix host debug view not showing services before start (#89610)

15 months agoChange generation for NonGC objects for debugger (#89927)
Egor Bogatov [Tue, 8 Aug 2023 08:10:39 +0000 (10:10 +0200)]
Change generation for NonGC objects for debugger (#89927)

15 months agoFix analyzer warning that is breaking the build (#90136)
Eirik Tsarpalis [Tue, 8 Aug 2023 07:50:11 +0000 (10:50 +0300)]
Fix analyzer warning that is breaking the build (#90136)

15 months agoSerialize createdump core dump generation (#90130)
Mike McLaughlin [Tue, 8 Aug 2023 03:12:16 +0000 (20:12 -0700)]
Serialize createdump core dump generation (#90130)

* Serialize createdump core dump generation

Only allow one thread at a time to generate a core dump.

Issue: https://github.com/dotnet/runtime/issues/82989

* Code review feedback. Move serializing code into PROCCreateCrashDump

* Code review feedback - put while (true) around poll()'s

15 months ago[iOS] Remove cmake build dependency for library mode (#89869)
Steve Pfister [Tue, 8 Aug 2023 03:02:08 +0000 (20:02 -0700)]
[iOS] Remove cmake build dependency for library mode (#89869)

This change removes cmake as a build dependency and instead uses clang directly when building for iOS/tvOS/Macatalyst library mode.

15 months ago[JIT] Do not force creation of a new IG if the current IG has no instructions (#89876)
Will Smith [Tue, 8 Aug 2023 02:43:48 +0000 (19:43 -0700)]
[JIT] Do not force creation of a new IG if the current IG has no instructions (#89876)

* Added 78891 test

* Fix name

* Fix test

* Feedback

* 78891 test is process isolated to use the environment variables. When enabling GC in the emitter, if the current IG has no instructions, do not force a new IG.

* Remove extend flag

* Quick cleanup

* Quick cleanup

* Update Runtime_78891.csproj

* Feedback

* Fix test

* Fix test

* Reset flags

* Fix test

* Fixing test again...

* Only set the NOGCINTERRUPT flag accordingly

15 months agoReplace `SetErrorMode` with `SetThreadErrorMode`. (#90122)
Aaron Robinson [Tue, 8 Aug 2023 02:00:24 +0000 (19:00 -0700)]
Replace `SetErrorMode` with `SetThreadErrorMode`. (#90122)

* Replace SetErrorMode with SetThreadErrorMode.

Replaces all possible locations.
Removed SetErrorMode from PAL.

15 months agoCheck IsBaselineSimdIsaSupported in LocalAddressVisitor (#90099)
Egor Bogatov [Tue, 8 Aug 2023 01:11:30 +0000 (03:11 +0200)]
Check IsBaselineSimdIsaSupported in LocalAddressVisitor (#90099)

15 months agoUpdate DAC's CMakeLists to create longname pdb (#90109)
Juan Hoyos [Tue, 8 Aug 2023 00:46:45 +0000 (17:46 -0700)]
Update DAC's CMakeLists to create longname pdb (#90109)

15 months ago[wasm][debugger] Support indexing Dictionary by string key (#90108)
Thays Grazia [Tue, 8 Aug 2023 00:05:30 +0000 (21:05 -0300)]
[wasm][debugger] Support indexing Dictionary by string key (#90108)

* Enabling tests, they are working.

* Adding more tests.

15 months agoMake [In] the default for blittable arrays that are pinned (#90054)
Jackson Schuster [Tue, 8 Aug 2023 00:01:45 +0000 (19:01 -0500)]
Make [In] the default for blittable arrays that are pinned (#90054)

* Make [In] the default for blittable arrays that are pinned

15 months agoSimplify invalid hostname check in DomainNameHelper (#90088)
Miha Zupan [Mon, 7 Aug 2023 23:53:21 +0000 (01:53 +0200)]
Simplify invalid hostname check in DomainNameHelper (#90088)

15 months ago[wasm] perf: Use node 16.x, and update v8 paths to track that (#90113)
Ankit Jain [Mon, 7 Aug 2023 23:24:51 +0000 (19:24 -0400)]
[wasm] perf: Use node 16.x, and update v8 paths to track that (#90113)

15 months agoadd units to http metrics (#90020)
Anton Firszov [Mon, 7 Aug 2023 22:39:59 +0000 (00:39 +0200)]
add units to http metrics (#90020)

15 months agoInconsistent DebuggerDisplay formatting - Fix space, equal for name/value and Indirec...
Wasiim Hosenbocus [Mon, 7 Aug 2023 22:27:30 +0000 (18:27 -0400)]
Inconsistent DebuggerDisplay formatting - Fix space, equal for name/value and Indirect Value (#89370)

* Fix space, equal for name/value in DebuggerDisplay

Task 1 - Replace colons with equal, added spaces in between key/value

* Fix failing test

* Update src/libraries/System.Speech/src/Result/SemanticValue.cs

Co-authored-by: James Newton-King <james@newtonking.com>
* Update src/libraries/System.Threading/src/System/Threading/Barrier.cs

Co-authored-by: James Newton-King <james@newtonking.com>
* Update src/libraries/System.Threading/src/System/Threading/CountdownEvent.cs

Co-authored-by: James Newton-King <james@newtonking.com>
* Changes to indirect value in Debugger

Changing string in indirect value; either part of a variable or a method

* Revert Stopwatch debug string

---------

Co-authored-by: James Newton-King <james@newtonking.com>
15 months agoSPMI: Fix build (#90118)
Jakob Botsch Nielsen [Mon, 7 Aug 2023 22:13:53 +0000 (00:13 +0200)]
SPMI: Fix build (#90118)

15 months agoGetUnmanagedValues[Source|Destination] by marshal direction, not stub direction ...
Jackson Schuster [Mon, 7 Aug 2023 21:58:17 +0000 (16:58 -0500)]
GetUnmanagedValues[Source|Destination] by marshal direction, not stub direction (#90057)

15 months agoSPMI: Throw distinguished exception for recorded exceptions (#89978)
Jakob Botsch Nielsen [Mon, 7 Aug 2023 21:02:32 +0000 (23:02 +0200)]
SPMI: Throw distinguished exception for recorded exceptions (#89978)

Switch back to this scheme, since only looking for the managed exception
code does not handle crossgen2/ilc (they throw exceptions across the
JIT-EE interface as normal C++ exceptions).

I've verified that the JIT does not look closely at the exception codes
thrown in any of the places it does EH, which comes down to
`impJitErrorTrap` and `runWithErrorTrap`. So changing the exception code
should not result in any behavior differences.

15 months ago[browser][non-icu] `HybridGlobalization` calendar data (#89255)
Ilona Tomkowicz [Mon, 7 Aug 2023 20:51:42 +0000 (22:51 +0200)]
[browser][non-icu] `HybridGlobalization` calendar data (#89255)

* Calendar WIP.

* Genitive months.

* Short pattern.

* NativeCalendarName does not exist on WebAPI - use EnglishCalendarName.

* Fix failures in Locales caused by calendars data removal.

* Fix to previous commit.

* Whitespace.

* Implemented Eras.

* Populate NativeName with EnglishName.

* Fix tests.

* Typos + comments removal + block failing test.

* AM/PM designators are not in ICU anymore.

* ShortTimePattern is ready.

* Fix some failing tests.

* LongTimePatterns is ready.

* Ask about all culture info from JS at once.

* Fix remaining tests.

* Calendar Globalization tests fixed.

* Adding test files to projects.

* Build fix.

* Fix the fix.

* .

* Fix tests.

* Load locale info on request + fix Browser scenario tests.

* Fix test on v8.

* Forgotten clean-up.

* Small cleanup in ts.

* V8 11 is behaves more like browser.

* Fixed skipped failing tests.

* Syntax

* V8 returns the same as Browser.

* This API is not affected, no need to test. + Add documentation.

* Revert unintentional change.

* Feedback.

* @radical's feedback + fix after removing unnecessary set.

* Fix.

* Feedback.

* Fix tests.

15 months agoImprove performance in DI (#89964)
Benjamin Petit [Mon, 7 Aug 2023 19:55:25 +0000 (21:55 +0200)]
Improve performance in DI (#89964)

15 months agomake sure to only enable things meant for DATAS when it's on (#90008)
Maoni Stephens [Mon, 7 Aug 2023 19:19:55 +0000 (12:19 -0700)]
make sure to only enable things meant for DATAS when it's on (#90008)

also reverted a couple of things that were supposed to be temporary

15 months agoUpdating JSON Package Readme (#90102)
Eric StJohn [Mon, 7 Aug 2023 19:02:15 +0000 (12:02 -0700)]
Updating JSON Package Readme (#90102)

* Updating Json package readme

* Update src/libraries/System.Text.Json/src/PACKAGE.md

Co-authored-by: Eirik Tsarpalis <eirik.tsarpalis@gmail.com>
* Apply suggestions from code review

Co-authored-by: Eirik Tsarpalis <eirik.tsarpalis@gmail.com>
* Remove sharplab comment

* Update PACKAGE.md

* Update PACKAGE.md

* Remove TODO

---------

Co-authored-by: Eirik Tsarpalis <eirik.tsarpalis@gmail.com>
15 months ago[libs][Android] Filter out backwards timezones only with valid tzlookup file (#89933)
Mitchell Hwang [Mon, 7 Aug 2023 18:38:26 +0000 (14:38 -0400)]
[libs][Android] Filter out backwards timezones only with valid tzlookup file (#89933)

* [libs][Android] Filter out backwards timezones only with valid tzlookup file

* Address feedback

* [libs][Android] Skip NoBackwardTimeZones on Android API under 26

15 months agoFix referencing options source gen project in tests (#90104)
Tarek Mahmoud Sayed [Mon, 7 Aug 2023 18:36:16 +0000 (11:36 -0700)]
Fix referencing options source gen project in tests (#90104)

15 months ago[wasm][debugger] Enable Exception tests. (#90095)
Thays Grazia [Mon, 7 Aug 2023 18:14:41 +0000 (15:14 -0300)]
[wasm][debugger] Enable Exception tests. (#90095)

* Enable Exception tests.

* Fix ExceptionTests.

15 months agoImplement RandomAccess.FlushToDisk() (#89100)
Eric Mutta [Mon, 7 Aug 2023 18:12:33 +0000 (21:12 +0300)]
Implement RandomAccess.FlushToDisk() (#89100)

Fix #86836

Co-authored-by: Dan Moseley <danmose@microsoft.com>
15 months agoPut crossgen perf into "Ubuntu.1804.Amd64.Tiger.Perf". (#90091)
Jiri Cincura ↹ [Mon, 7 Aug 2023 17:11:59 +0000 (19:11 +0200)]
Put crossgen perf into "Ubuntu.1804.Amd64.Tiger.Perf". (#90091)

* Because crossgen need LTTng and 22.04 is not compatible.
* Windows using same queue.

15 months agoConvert CMakeSettings.json to CMakePresets.json for coreclr (#89513)
Huo Yaoyuan [Mon, 7 Aug 2023 17:08:23 +0000 (01:08 +0800)]
Convert CMakeSettings.json to CMakePresets.json for coreclr (#89513)

15 months ago[main] Update dependencies from dotnet/roslyn-analyzers (#89630)
dotnet-maestro[bot] [Mon, 7 Aug 2023 16:57:11 +0000 (09:57 -0700)]
[main] Update dependencies from dotnet/roslyn-analyzers (#89630)

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

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: Larry Ewing <lewing@microsoft.com>
Co-authored-by: Ankit Jain <radical@gmail.com>
Co-authored-by: Buyaa Namnan <bunamnan@microsoft.com>
15 months agoUpgrade DNNE to build incrementally (#89594)
Jackson Schuster [Mon, 7 Aug 2023 16:22:10 +0000 (11:22 -0500)]
Upgrade DNNE to build incrementally (#89594)

* Upgrade DNNE dependency to 2.0.3 to support incremental builds properly

15 months agoIntegrate HttpClientFactory and metrics (#86888)
James Newton-King [Mon, 7 Aug 2023 16:08:11 +0000 (00:08 +0800)]
Integrate HttpClientFactory and metrics (#86888)

* Integrate HttpClientFactory and metrics

* React to rebase

* Fix tests

* PR feedback

* Clean up

* Fix tests

15 months agoImprove duplicate assembly resolving (#89958)
Mike Voorhees [Mon, 7 Aug 2023 16:06:20 +0000 (12:06 -0400)]
Improve duplicate assembly resolving (#89958)

`GetAssembly` opens a new assembly and stream every time it is called and keeps them open for the duration of the run.

`RootAssemblyFile.LoadAssemblyFile` sort of handled an already loaded assembly, but it left a new `AssemblyDefinition` instance and `MemoryStream` open every time it happened.

`CacheAssembly` was easy to make a mistake with.   Forget to do the delicate dance that `RootAssemblyFile.LoadAssemblyFile` goes to already loaded assemblies and you can easily overwrite an already cached assembly.  Guard against mistakes rather than quitely overwriting the assembly that was already cached.

Why force callers of `CacheAssembly` to check if something is cached already?  Handle that case internally.

With these changes the logic in `RootAssemblyFile.LoadAssemblyFile` is simplified and an extra copy of the assembly is no longer left open in the scenario where an assembly is specified multiple times.

15 months agoFix wasm perf setup (#90093)
Jiri Cincura ↹ [Mon, 7 Aug 2023 15:02:30 +0000 (17:02 +0200)]
Fix wasm perf setup (#90093)

* Fixes bash expansion of ${this.version()}.

15 months agoAdd JsonSerializerOptions.MakeReadOnly(bool) overload. (#90013)
Eirik Tsarpalis [Mon, 7 Aug 2023 10:57:35 +0000 (13:57 +0300)]
Add JsonSerializerOptions.MakeReadOnly(bool) overload. (#90013)

15 months agoAdd `JsonNode.ParseAsync` public API (#90006)
DoctorKrolic [Mon, 7 Aug 2023 10:52:08 +0000 (13:52 +0300)]
Add `JsonNode.ParseAsync` public API (#90006)

* Add `JsonNode.ParseAsync` public API

* Regenerate ref assemblies

* Change implementation to use unrented document

15 months agoImprove test failure messages (#89967)
Mike Voorhees [Mon, 7 Aug 2023 07:42:42 +0000 (03:42 -0400)]
Improve test failure messages (#89967)

15 months agoCheck for <framework_name>.deps.json when enumerating framework paths (#90035)
Elinor Fung [Mon, 7 Aug 2023 05:06:59 +0000 (22:06 -0700)]
Check for <framework_name>.deps.json when enumerating framework paths (#90035)

This adds a check for the framework's .deps.json instead of just the existence of the directory. To avoid extra file checks in the normal/happy path (where all framework version folder are valid), when resolving, it only does the check after resolving the best version match. And if that version directory isn't valid, it tries resolving again without it.

15 months ago[mono][aot] Use g_strcasecmp () to check whenever aot input assemblies are loaded...
Zoltan Varga [Mon, 7 Aug 2023 00:18:07 +0000 (20:18 -0400)]
[mono][aot] Use g_strcasecmp () to check whenever aot input assemblies are loaded from the correct location. (#90065)

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

15 months agoTimeProvider GetLocalNow enhancement (#90066)
Weihan Li [Sun, 6 Aug 2023 22:07:22 +0000 (06:07 +0800)]
TimeProvider GetLocalNow enhancement (#90066)

Co-authored-by: Tarek Mahmoud Sayed <tarekms@microsoft.com>
15 months agoFix an assert and clean up a codegen issue (#90067)
Tanner Gooding [Sun, 6 Aug 2023 21:38:50 +0000 (14:38 -0700)]
Fix an assert and clean up a codegen issue (#90067)

15 months agoSPMI: Capture EE API exceptions in getNewHelper, and simplify the API shape a bit...
Jakob Botsch Nielsen [Sun, 6 Aug 2023 21:09:54 +0000 (23:09 +0200)]
SPMI: Capture EE API exceptions in getNewHelper, and simplify the API shape a bit (#89852)

We have various tests where getNewHelper throws an EE exception, so
capture these and rethrow them as part of SPMI.

It would be nice with a more general approach to this (conceptually all
EE APIs could throw exceptions), but this at least handles it for our
own libraries.

Contributes to #47540 and #47546.

Also clean up the API shape of getNewHelper slightly, since this requires
a JIT-EE GUID change anyway; the only used member of the token is the class,
so pass a class handle instead. The second parameter was also removed.

15 months agoFix CompositeChangeToken & CancellationTokenSource deadlock (#90078)
Rik Steenkamp [Sun, 6 Aug 2023 17:07:56 +0000 (19:07 +0200)]
Fix CompositeChangeToken & CancellationTokenSource deadlock (#90078)

15 months agoAdd note about creating arrays using newobj (#90070)
Jan Kotas [Sun, 6 Aug 2023 15:05:28 +0000 (08:05 -0700)]
Add note about creating arrays using newobj (#90070)

Contributes to #90038

15 months agoRename area-ILVerification to area-Tools-ILVerification (#89698)
Jan Kotas [Sun, 6 Aug 2023 15:04:35 +0000 (08:04 -0700)]
Rename area-ILVerification to area-Tools-ILVerification (#89698)

* Rename area-ILVerification to area-Tools-ILVerification

Fixes #89693

* Update src/coreclr/tools/ILVerify/README.md

Co-authored-by: Kevin Jones <vcsjones@github.com>
15 months ago[RISCV] Store 2*XLEN ValueType half in Reg and half on stack when only A7 available...
VincentWu [Sun, 6 Aug 2023 11:29:39 +0000 (21:29 +1000)]
[RISCV] Store 2*XLEN ValueType half in Reg and half on stack when only A7 available (#90072)

* update makefile

* add format file

* use mul inst instead of emulate mul
process stack size larger than imm32

* emit get_throw_trampoline

* mono_riscv_throw_exception

* fix error of stack trace

* test case

* output inst idiv
fix mono_riscv_emit_branch_exc

* implement mono_arch_get_throw_corlib_exception

* fix rdiv

* move ArgOnStack arg at prologue
lowering OP_XOR_IMM&OP_IXOR_IMM

* fix emit_imm

* test imm

* update test case

* use swich to process return value

* fix unwind inst def_cfa

* fmt

* lowering OP_LMUL_IMM

* make file for webapiclient

* lowerng&output
- OP_FCONV_TO_I8
- OP_LXOR_IMM
- OP_ISHR

* lowerng&output
- relaxed_nop
- float_cle
- long_shl
- OP_ICONV_TO_R_UN
- OP_LCONV_TO_I2
- OP_FBGE
- OP_IDIV_IMM

* fix this_pointer in vcall with valuetype returned
- The ABI specify that If the reture value would have been passed by reference, the caller will allocates memory for the return value, and passes the address as an implicit first parameter.
- The Mono will treat first parameter as this_pointer reference to `mono_vcall_trampoline()`.  They are conflict a bit.

* process param type: ArgVtypeOnStack & ArgVtypeByRef

* lowering OP_LCONV_TO_I2

* OP_IREM_UN_IMM
OP_ATOMIC_LOAD_U1
OP_IREM_UN_IMM

* fix output of OP_IREM & OP_IREM_UN
OP_IREM -> riscv_remw
OP_IREM_UN -> riscv_remuw

* use `lw` to load u4 value on the stack
https://github.com/riscv-non-isa/riscv-elf-psabi-doc/blob/master/riscv-cc.adoc#integer-calling-convention

* optmise lw+zext -> lwu

* fix patch_full
use mono_riscv_emit_loadu to emit lwu
fix rem

* fix `mono_arch_build_imt_trampoline` when `item->is_equals==false`

* FIXME: reg got crashed wetween `this` and return ref

* fix `mono_arch_build_imt_trampoline`

* float_sub & float_div

* OP_FNEG,OP_LADD_OVF,OP_FBEQ, OP_COND_EXC_OV

* fix mono_arch_emit_outarg_vt

* process ArgVtypeOnStack in emit_move_args

* add sample status

* fix valid imm check of OP_L.*_IMM

* OP_LCONV_TO_R_UN

* update

* fix the param order stored o stack

* fix the param size of MONO_TYPE_I & MONO_TYPE_U when RV64

* add test task for makefile

* update .clang-format

* fmt

* fix merge

* fix

* set cfa for callee saved regs

* fix the position of param passed by stack

* toll-calculator

* fix

* OP_FADD & OP_LCONV_TO_OVF_I

* ArgOnStackR8

* OP_FBLE

* check need needs_emulation for D&F

* mixins-with-interfaces

* OP_LXOR_IMM

* get_delegate_virtual_invoke_impl

* fix OP_ADDCC

* fix get_delegate_virtual_invoke_impl

* endfilter

* update

* update test file

* test ArgVtypeByRef

* fix VT arg of ArgVtypeByRef

* fix return value of valueType

* OP_FBGE & OP_FBLE for OP_RCOMPARE

* update

* lowering OP_FCONV_TO_I2

* lowering OP_RCONV_TO_I2

* OP_ATOMIC_ADD_I8

* OP_COND_EXC_IGT and OP_LCONV_TO_OVF_I4

* update

* fix add_valuetype

* update

* process param types of ArgVtypeInMixed

* update

* atomic_store_i8

* update

* fix divuw

* update

* rcall

* update testcase

* OP_FBNE_UN

* OP_FCONV_TO_I8

* update

* update test

* update

* clean

* remove changes

* fmt

* clean

15 months agoFix mono's Wsingle-bit-bitfield-constant-conversion (#90068)
Adeel Mujahid [Sun, 6 Aug 2023 11:28:08 +0000 (14:28 +0300)]
Fix mono's Wsingle-bit-bitfield-constant-conversion (#90068)

* Fix mono's Wsingle-bit-bitfield-constant-conversion

* Address CR feedback

15 months agoRecover some lost EH performance on Unix amd64 (#90033)
Jan Vorlicek [Sun, 6 Aug 2023 10:07:55 +0000 (12:07 +0200)]
Recover some lost EH performance on Unix amd64 (#90033)

* Improve EH performance on Unix amd64

Few months ago, a change to enable AVX512 on Unix was merged in.
That change has enlarged the CONTEXT structure significantly and
it was found that it has caused 6..17% regressions in exception handling
microbenchmarks.

This change gets some of the lost performance back by adding custom
copy constructor and assignment operator to the CONTEXT structure
and preventing copying of the AVX / AVX512 stuff if the source
context doesn't have it. I have observed 3..9% gain on my machine.

Close #84308

* Fix gcc build and size for non-xstate case

* Fix yet another gcc break

* Fix build break

* Revert the gcc fixes and disable the warning

The zeroing of CONTEXT structure is used at too many places and
it is valid, so rather than trying to modify all the places by
using placement new, just disable the warning for gcc.

15 months ago[wasm] Fix startup without emcc -g option (#89872)
Katelyn Gadd [Sat, 5 Aug 2023 21:09:13 +0000 (14:09 -0700)]
[wasm] Fix startup without emcc -g option (#89872)

When compiling without the emcc -g switch, the "env" module becomes "a", which caused startup to break.
Co-authored-by: Pavel Savara <pavelsavara@microsoft.com>
15 months agoDo not suppress inlining of random threadstatics (#90055)
Vladimir Sadov [Sat, 5 Aug 2023 14:57:33 +0000 (07:57 -0700)]
Do not suppress inlining of random threadstatics (#90055)

15 months agoRe-enable some JIT tests (#89739)
Aman Khalid [Sat, 5 Aug 2023 06:15:42 +0000 (23:15 -0700)]
Re-enable some JIT tests (#89739)

* JIT/opt/ObjectStackAllocation/ObjectStackAllocationTests/ for Crossgen
* JIT/Regression/JitBlue/Runtime_34170/Runtime_34170/ for Crossgen ARM32

15 months agoMove the background marking of UOH objects inside more space lock (#86802)
Andrew Au [Fri, 4 Aug 2023 22:54:06 +0000 (15:54 -0700)]
Move the background marking of UOH objects inside more space lock (#86802)

15 months agoMake sure all new GCDacVars are reported only for v2 (#90043)
Andrew Au [Fri, 4 Aug 2023 22:53:05 +0000 (15:53 -0700)]
Make sure all new GCDacVars are reported only for v2 (#90043)

15 months agoDelete dangling thread session states (#89955)
Tom McDonald [Fri, 4 Aug 2023 22:42:51 +0000 (18:42 -0400)]
Delete dangling thread session states (#89955)

* Delete dangling thread session states

Co-Authored-By: Johan Lorensson <lateralusx.github@gmail.com>
* Update ep-session.c

---------

Co-authored-by: David Mason <davmason@microsoft.com>
Co-authored-by: Johan Lorensson <lateralusx.github@gmail.com>
15 months agoIntroducing TimeZoneInfo.GetSystemTimeZones(bool skipSorting) (#89985)
Tarek Mahmoud Sayed [Fri, 4 Aug 2023 22:27:20 +0000 (15:27 -0700)]
Introducing TimeZoneInfo.GetSystemTimeZones(bool skipSorting) (#89985)

15 months agoImprove reliability of HttpRequestError.NameResolutionError (#89948)
Anton Firszov [Fri, 4 Aug 2023 22:03:01 +0000 (00:03 +0200)]
Improve reliability of HttpRequestError.NameResolutionError (#89948)

* map TryAgain to NameResolutionError

* Quic: always resolve DNS in managed code

* oops

* ignore ScopId when comparing ipv6 endpoints in tests

* do not reuse QuicAddr

* Skip NameResolutionError() test on Windows7

15 months agoFix HttpListener path parsing for trailing % (#90028)
Miha Zupan [Fri, 4 Aug 2023 21:52:04 +0000 (23:52 +0200)]
Fix HttpListener path parsing for trailing % (#90028)

15 months agoSPMI: Restore CORINFO_CALL_INFO stub lookup correctly (#90016)
Jakob Botsch Nielsen [Fri, 4 Aug 2023 21:42:50 +0000 (23:42 +0200)]
SPMI: Restore CORINFO_CALL_INFO stub lookup correctly (#90016)

SPMI was not restoring the runtimeLookupFlags/runtimeLookupArgs of the
embedded CORINFO_LOOKUP_KIND, leaving them set to garbage. This would
cause misses when replaying getReadyToRunHelper where those members are
used as the key.

15 months agoRevert "Disable MonitoringIsEnabled with issue 75302 (#75306)" (#89966)
Mark Plesko [Fri, 4 Aug 2023 21:32:52 +0000 (14:32 -0700)]
Revert "Disable MonitoringIsEnabled with issue 75302 (#75306)" (#89966)

Appears to have been fixed by #74959

Fixes #75302

This reverts commit a174882750130433b03afcf8ac30318c2fbc527f

15 months ago[wasm] CI: Don't trigger non-wasm runtime tests when wasm-test-runner (#89957)
Ankit Jain [Fri, 4 Aug 2023 21:21:07 +0000 (17:21 -0400)]
[wasm] CI: Don't trigger non-wasm runtime tests when wasm-test-runner (#89957)

.. changes. There is a separate subset `wasm_runtimetests` for
triggering wasm runtime tests. So, `runtimetests` subset used by
non-wasm jobs should ignore wasm-test-runner changes.

15 months ago[wasm][wbt] Split WBT classes to speed up CI job execution. (#89926)
Ilona Tomkowicz [Fri, 4 Aug 2023 21:18:47 +0000 (23:18 +0200)]
[wasm][wbt] Split WBT classes to speed up CI job execution. (#89926)

IcuSharding and BuildPublish on Blazor always take the longest. I split them more or less into equal test count per class (~20 in icu, ~10 in build publish).

This PR changes the times on wbt linux CI when we split into BuldPublish and BuildPublishDefaultTemplate:
Build time: ~1,5min -> ~1,5min
Run time: ~53min -> ~45min
Original time values taken from build [20230802.154](https://dev.azure.com/dnceng-public/public/_build/results?buildId=361726) with 495 301 tests.

It's fine but the BuildPublish is the only test that keeps running till the end, around 30th minute all the other wbt are done already, so trying the 3-file split approach:
- BuildPublishTestsFromWasmTemplate,
- BuildPublishTestsFromBlazorTemplate (the same test set as BuildPublishDefaultTemplate, just renamed to better describe the contents) and
- BuildPublish,

each <10 tests.
Build time: ~1,5min -> ~1,5min
Run time: ~53min -> 53 min - it seems 3 files split did not work as expected, @radical, it might be an outliner ~~but in this situation it does not look worthy to merge the changes~~.
[build 20230804.3](https://dev.azure.com/dnceng-public/public/_build/results?buildId=363212&view=logs&jobId=9c08ee28-c5cd-54b8-6ae3-9fcb797291cc&j=0b2e5ab0-105d-5e21-8497-262338385634)
Okay, on the re-run it's already fine, [35 min as expected](https://dev.azure.com/dnceng-public/public/_build/results?buildId=363553&view=logs&jobId=10714551-d8dc-5291-8d0a-07fdfc20529c&j=1fa93050-f528-55d3-a351-f8bf9ce5adbf&t=a9f1a437-3b59-5900-1137-ec6cae9a530c).

On windows it changed ~60min -> 42 min.

15 months agoUse the same tracked contexts for event pipe and ETW in nativeaot (#89902)
Elinor Fung [Fri, 4 Aug 2023 18:48:56 +0000 (11:48 -0700)]
Use the same tracked contexts for event pipe and ETW in nativeaot (#89902)

- Make tracking for event pipe and ETW enabled/status use the same contexts
- Switch to using the .NET ETW provider GUIDs instead of .NET Native
- Implement ep_rt_providers_validate_all_disabled (uses the contexts)

15 months agoAvoid extra console write for clearing on Unix (#89026)
Stephen Toub [Fri, 4 Aug 2023 18:17:04 +0000 (14:17 -0400)]
Avoid extra console write for clearing on Unix (#89026)

* Avoid extra console write for clearing on Unix

* Fix ordering from original PR

* Add test that the data we defined is expected

15 months agoUpdate the event used for the tiered compilation background thread (#89972)
Koundinya Veluri [Fri, 4 Aug 2023 17:53:11 +0000 (10:53 -0700)]
Update the event used for the tiered compilation background thread (#89972)

Updated the event to use `ClrEventStatic` instead of `ClrEvent`, as the former is intended for global variables and does not have a destructor. There may be a possibility for races with the destructor in shutdown scenarios.

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

15 months agouse approved SocketAddress API instead of direct internal access (#89841)
Tomas Weinfurt [Fri, 4 Aug 2023 17:38:29 +0000 (10:38 -0700)]
use approved SocketAddress API instead of direct internal access (#89841)

* use approved SocketAddress API instead of internal access

* feedback

* cleanup

15 months agoFix PermuteVar32x16x2 optimization (#90005)
Egor Bogatov [Fri, 4 Aug 2023 16:09:20 +0000 (18:09 +0200)]
Fix PermuteVar32x16x2 optimization (#90005)

15 months ago[workloads] Use native arm64 aot compilers for iOS, tvOS, maccatalyst, and android...
Steve Pfister [Fri, 4 Aug 2023 16:01:04 +0000 (09:01 -0700)]
[workloads] Use native arm64 aot compilers for iOS, tvOS, maccatalyst, and android where possible (#89961)

As a result of https://github.com/dotnet/runtime/pull/89027 and https://github.com/dotnet/runtime/pull/74715, we can now build native arm64 cross compilers on linux and macos. This change adds the right references to the workload manifest so that they can be installed with maui and the mobile SDK's.

win-arm64 is the only arm64 platform left and that is a work in progress.

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

Fixes https://github.com/dotnet/maui/issues/4476

15 months agoRework on 88919 as suggested by @vitek-karas (#89960)
Thays Grazia [Fri, 4 Aug 2023 15:01:44 +0000 (12:01 -0300)]
Rework on 88919 as suggested by @vitek-karas (#89960)

15 months ago[browser] doc feedback (#89951)
Pavel Savara [Fri, 4 Aug 2023 14:44:27 +0000 (16:44 +0200)]
[browser] doc feedback (#89951)

15 months agoAdd test for TypeIdentifierAttribute (#89882)
Steve Harter [Fri, 4 Aug 2023 14:28:06 +0000 (09:28 -0500)]
Add test for TypeIdentifierAttribute (#89882)

15 months agoMatch IsUnwindable and GetReturnAddressHijackInfo conditions (#89998)
Filip Navara [Fri, 4 Aug 2023 13:41:50 +0000 (15:41 +0200)]
Match IsUnwindable and GetReturnAddressHijackInfo conditions (#89998)

15 months agoRevert "For perf, use the new ConstructorInvoker APIs for ActivatorUtilities.CreateFa...
Jan Kotas [Fri, 4 Aug 2023 13:15:47 +0000 (06:15 -0700)]
Revert "For perf, use the new ConstructorInvoker APIs for ActivatorUtilities.CreateFactory (#89573)" (#89992)

This reverts commit c41696644436d6ba8d7bc6f06b20273d99d8dc70.

15 months ago[mono][ios] Disable failing eventpipe gcdump test on apple mobile platforms (#90002)
Milos Kotlar [Fri, 4 Aug 2023 13:11:20 +0000 (15:11 +0200)]
[mono][ios] Disable failing eventpipe gcdump test on apple mobile platforms (#90002)

* Disable failing eventpipe test on apple mobile platforms

* Add tracking issue

15 months agoLight up for newer arm64 hardware capabilities (#89991)
Jan Kotas [Fri, 4 Aug 2023 12:36:56 +0000 (05:36 -0700)]
Light up for newer arm64 hardware capabilities (#89991)

Fixes #89937

15 months ago[nativeaot][ios] Improve Native AOT test coverage on apple mobile platforms (#89301)
Milos Kotlar [Fri, 4 Aug 2023 11:44:05 +0000 (13:44 +0200)]
[nativeaot][ios] Improve Native AOT test coverage on apple mobile platforms (#89301)

* Enable TestLinqExpressions test

* Test maccatalyst job on Native AOT

* Test other smoke runtime tests on Native AOT

* Add tracking issue for disabled tests

15 months agoMove Microsoft.NET.WebAssembly.WebCil into tasks (#89999)
Viktor Hofer [Fri, 4 Aug 2023 10:42:53 +0000 (12:42 +0200)]
Move Microsoft.NET.WebAssembly.WebCil into tasks (#89999)

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

Repo task projects need to reside under src/tasks as the
TasksConfiguration property applies to these projects. By having a
referenced task project outside of src/tasks, it's easy to get
binclashes because of a project being built for different configurations
(Debug vs Release).

15 months agoRoll Ubuntu 18.04 queue to 22.04 (#89995)
Drew Scoggins [Fri, 4 Aug 2023 09:35:11 +0000 (02:35 -0700)]
Roll Ubuntu 18.04 queue to 22.04 (#89995)

15 months agoExclude NETFramework targets file during source build (#89974)
Eric StJohn [Fri, 4 Aug 2023 06:49:30 +0000 (23:49 -0700)]
Exclude NETFramework targets file during source build (#89974)

15 months agoMake ImplementsInterfaceOfSelf more precise for canonical subtypes (#89969)
Jan Kotas [Fri, 4 Aug 2023 05:50:54 +0000 (22:50 -0700)]
Make ImplementsInterfaceOfSelf more precise for canonical subtypes (#89969)

Fixes #89918

15 months agoMake marshaller types specific to each scenario (#89894)
Jackson Schuster [Fri, 4 Aug 2023 04:08:23 +0000 (21:08 -0700)]
Make marshaller types specific to each scenario (#89894)

Make the marshaller types for the test interfaces only include the necessary methods for each scenario to catch any generated code that uses a method from another scenario