Thays Grazia [Fri, 1 Jul 2022 20:44:30 +0000 (17:44 -0300)]
[mono][wasm] Updating code owners (#71562)
* [mono][wasm] Updating code owners
* Update CODEOWNERS
* Add more wasm dirs for CODEOWNERS
Co-authored-by: Ankit Jain <radical@gmail.com>
Elinor Fung [Fri, 1 Jul 2022 19:34:46 +0000 (12:34 -0700)]
Basic support for stateless linear collection marshalling (#71473)
Basic stateless linear collection marshalling for blittable elements
Not handled:
- caller-allocated buffer
- guaranteed unmarshal
- pinnable reference
- non-blittable element marshalling
- element scenarios on custom marshallers
Stephen Toub [Fri, 1 Jul 2022 19:10:51 +0000 (15:10 -0400)]
Fix nullable annotations on new Order{Descending} methods (#71542)
Stephen Toub [Fri, 1 Jul 2022 19:10:25 +0000 (15:10 -0400)]
Fix inlining of ObjectDisposedException.ThrowIf (#71544)
Tomas Weinfurt [Fri, 1 Jul 2022 17:37:31 +0000 (19:37 +0200)]
add basic support for SNI different than URI in H3 (#71428)
* add basic support for SNI different than URI in H3
* fix loopback test
Vladimir Sadov [Fri, 1 Jul 2022 17:00:47 +0000 (10:00 -0700)]
[NativeAOT] Remove WaitForSuspend and some ordering cleanups. (#71511)
* remove WaitForSuspend
* Volatile
* remove m_SuspendCompleteEvent
* process wide barriers around suspension for arm
Egor Bogatov [Fri, 1 Jul 2022 16:25:55 +0000 (18:25 +0200)]
STJ: Add AggressiveInlining to CheckNotDisposed() (#71534)
Filip Navara [Fri, 1 Jul 2022 16:13:47 +0000 (18:13 +0200)]
Fix crash in GSSAPI on macOS (#71484)
* On macOS the gss_accept_sec_context/gss_init_sec_context APIs release the context handle
when error occurs. The code didn't handle it properly and it would result in double-free
and hard crash. Update the code to handle this situation properly.
* Update comment
Stephen Toub [Fri, 1 Jul 2022 16:06:35 +0000 (12:06 -0400)]
Fix a few theoretical issues in Regex.CacheSize (#71490)
Krzysztof Wicher [Fri, 1 Jul 2022 13:52:13 +0000 (15:52 +0200)]
Add tests for contract customization per feedback in #70435 (#71529)
Ilya Leoshkevich [Fri, 1 Jul 2022 13:24:31 +0000 (15:24 +0200)]
[custom_attrs] Use the image's ALC instead of the default one (#68266) (#70346)
* [custom_attrs] Use the image's ALC instead of the default one (#68266)
Running ApiCompat task under Mono fails with:
Could not load type System.Collections.Generic.IEqualityComparer`1[[Microsoft.Cci.ITypeReference, Microsoft.Cci ...
The reason is that cattr_type_from_name() uses a default ACL instead of
the image's one. This is important, because ExportCciSettings.Settings
field has the
[Export(typeof(IEqualityComparer<ITypeReference>))]
custom attribute [1], where ITypeReference comes from the Microsoft.Cci
assembly. ApiCompat task runs under MSBuild, which provides its own
MSBuildLoadContext ALC. Microsoft.Cci is supposed to be found using
this ALC, not the default one.
[1] https://github.com/dotnet/arcade/blob/
8f311fed1f2acf0ecfdfcecbc7a9fa871ed634cc/src/Microsoft.DotNet.ApiCompat/src/Microsoft.DotNet.ApiCompat.Core/ExportCciSettings.cs#L28
* [sre] Set the ALC for the dynamic image
Don't leave it NULL
Co-authored-by: Aleksey Kliger <alklig@microsoft.com>
Michal Strehovský [Fri, 1 Jul 2022 13:05:13 +0000 (22:05 +0900)]
Throw NullRef in some delegate construction scenarios (#71526)
Apparently constructing a delegate to a virtual/interface method throws `NullReferenceException` instead of `ArgumentException` (that is thrown for non-virtual cases).
System.Collections.Immutable tests are testing for this for some reason.
Michal Strehovský [Fri, 1 Jul 2022 13:02:03 +0000 (22:02 +0900)]
Fix exception message in Activator (#71525)
The exception message in System.Private.Reflection.Core didn't expect an argument. The one in CoreLib does.
Krzysztof Wicher [Fri, 1 Jul 2022 13:00:57 +0000 (15:00 +0200)]
Add order test (#71523)
Aleksey Kliger (λgeek) [Fri, 1 Jul 2022 12:57:42 +0000 (08:57 -0400)]
[wasm-mt] Add MessageChannel between browser thread and new pthreads (#70908)
Add a mechanism for creating a communication channel between the browser thread and new pthreads (running in webworkers - note, Emscripten may recycle workers after a pthread exits).
This is done by adding our own event listener to the webworker (in the main thread) and to globalThis (in the worker). This conflicts with emscripten's message handlers (although it's considered a bug by Emscripten upstream that their event handler doesn't ignore unrecognized messages).
One potential problem here is that for any communication to happen, the worker must service its event loop. If it's just busy running a loop in wasm, it might never handle the messages. On the other hand, posting messages back to main should work.
Once we have our message handlers in place, the rest is straightforward, the worker creates a MessageChannel and transfers one of the ports to the browser thread.
With the browser-to-pthread channel established, we can build up cross-thread channels by asking the main thread to transfer ports on our behalf. This part isn't done yet.
---
Additionally in the worker, create an `EventTarget` that fires `dotnet:pthread:created` and `dotnet:pthread:attached` events whenever Emscripten begins running a new thread on one of its workers, and whenever that worker attaches to Mono. This lets runtime subsystems be notified on the JS side whenever threads come into existence or may potentially begin to run managed code.
---
Also re-organizes our `tsconfig.json` into `tsconfig.shared.json` (common flags), `tsconfig.worker.json` (uses the `esnext` and `worker` libs, so VS Code doesn't offer DOM completions and types, for example), and `tsconfig.json` (uses the `esnext` and `dom` libs). Subsystems with their own subdirectories (like `pthreads/worker` `pthreads/browser`, etc) can use the `tsconfig` `extends` property to include the appropriate root-directory config.
---
* outline of a dedicated channel between JS main thread and pthreads
* add JS entrypoints for pthread-channel
* wire up the MessageChannel to native thread attach
* debug printfs etc
* split up into pthread-channel module into worker, browser and shared
* pthreads modules
* add ENVIRONMENT_IS_PTHREAD; mono_wasm_pthread_worker_init
* Fixup names; call MessagePort.start; remove printfs
* remove whitespace and extra printfs
* Exclude threading exports in non-threaded runtime
Use the `USE_THREADS` emscripten library ifdef to prevent the entrypoints from being saved.
Use a new `MonoWasmThreads` rollup constant to remove JS roots.
Verified that a Release build single-threaded dotnet.js doesn't include any of the new pthread support code
* Add replacement for PThread.loadWasmModuleToWorker
This will allow us to install a message handler when the worker is created, before it has any pthreads assigned to it.
We can therefore simplify how we set up our own MessageChannel to simply send a single event from the worker to the browser thread, instead of having to lazily install the event handler on the main thread by queueing async work to the browser thread.
* Simplify the dedicated channel creation
now that we can add a message handler to a worker when Emscripten creates it, skip the complicated atomic notification process
* Don't forget the GC transition out to JS
* fix browser-eventpipe default import
* move mono_threads_wasm_on_thread_attached later in register_thread
Actually attach the thread to the runtime (so that GC transitions work) before calling out to JS
* also fix default import in browser-mt-eventpipe
* Add replacement for Module.PThread.threadInit
Use it to call mono_wasm_pthread_on_pthread_created
Rename the previous callback to mono_wasm_pthread_on_pthread_attached - it gets called but it's unused.
This is enough to get the diagnostic sever worker started up and pinging.
* Cleanup mono_wasm_pthread_on_pthread_created
* Share tsconfig parts using "extends" property
* Use an EventTarget and custom events for worker thread lifecycle notifications
* pass portToMain in ThreadEvents; update README
this lets pthread lifecycle event handlers post messages and setup listeners on the message port back to the main browser thread.
Also update the README to describe the current design
* make pthread/worker/events friendlier to tree shaking and node
* another approach to tree shaking
rollup doesn't understand fallthru. In the following (which is what `mono_assert` ammounts to) it retains `C`:
```
if (condition)
throw new Error (...);
// fallthru
return new C();
```
Solution is to use an if-then-else
```
if (condition)
throw new Error (...);
else
return new C(); // C is not retained if 'condition' is false
```
* fix annoying VSCode ESLint toast
Cannot read property 'loc' of undefined
See https://github.com/microsoft/vscode-eslint/issues/1149
and a proposed workaround in https://github.com/eslint/eslint/issues/14538#issuecomment-
862280037
* Add Event and EventTarget polyfill for v8
* fix whitespace and comments
Lakshan Fernando [Fri, 1 Jul 2022 12:02:05 +0000 (05:02 -0700)]
Fix some tests regressed by the aggressive reflection metadata trimming work (#71440)
* Fix tests by setting IlcTrimMetadata to false
* Disable linux failures
Denys Zhuravel [Fri, 1 Jul 2022 08:00:17 +0000 (10:00 +0200)]
Make the archives created on Unix have the read permissions by default (#70735)
Eric Erhardt [Fri, 1 Jul 2022 03:54:16 +0000 (22:54 -0500)]
Enable CA1727: Use PascalCase for named placeholders (#71444)
* Enable CA1727: Use PascalCase for named placeholders
Also CA2253: Named placeholders should not be numeric values
* Fix MonoProxy logging placeholder names
Ankit Jain [Fri, 1 Jul 2022 03:26:47 +0000 (23:26 -0400)]
[wasm] Clean up debugger tests output (#71483)
Thays Grazia [Fri, 1 Jul 2022 03:23:44 +0000 (00:23 -0300)]
[wasm][debugger] Fix get properties from an object of a library without pdb (#71505)
* When we don't have pdb we still can get some information about the methods like attributes (public, private, protected, etc) which are used for a better debugger experience.
* Update src/mono/wasm/debugger/tests/debugger-test-with-pdb-deleted/debugger-test-with-pdb-deleted.csproj
Co-authored-by: Ankit Jain <radical@gmail.com>
Co-authored-by: Ankit Jain <radical@gmail.com>
Michal Strehovský [Fri, 1 Jul 2022 02:40:26 +0000 (11:40 +0900)]
Delete .NET Native leftovers (#71474)
Around GC static bases placed within the `.data` section and Windows-specific TLS.
David Wrighton [Fri, 1 Jul 2022 01:25:48 +0000 (18:25 -0700)]
Fix crossgen2 version resilience test (#71357)
- The version resilience test had 2 major bugs in it
1. It was not properly specifying references, so references to other dlls were not being handled
2. It was generating .ni.dll files, which are not actually loaded by the runtime anymore, so even for the code it did generate, the cross module references were not in use.
Version resiliency bugs also fixed
- Fix assertion when handling fields of sequential/explicit types from another module, where we did not generate a correct cross module version resilient fixup. (That's what the fix is in CorInfoImpl.ReadyToRun.cs)
- Disable cross version bubble p/invoke inlining, as we don't currently generate valid cross module tokens for that scenario
Also during this effort a new bug #71507 was discovered.
Adeel Mujahid [Fri, 1 Jul 2022 00:40:44 +0000 (03:40 +0300)]
Use llvm-objcopy with StripSymbols=true and clang (#71495)
* Use llvm-objcopy with StripSymbols=true and clang
* Allow user to override ObjCopyName property
* Quote utilities in Exec calls
* Delete CppCompiler property
David Wrighton [Fri, 1 Jul 2022 00:00:08 +0000 (17:00 -0700)]
Make dotnet-pgo capable of handling dll conflicts by providing deconfliction options (#71502)
* Make dotnet-pgo capable of handling dll conflicts by providing deconfliction options
Co-authored-by: Jakob Botsch Nielsen <Jakob.botsch.nielsen@gmail.com>
Ankit Jain [Thu, 30 Jun 2022 23:18:28 +0000 (19:18 -0400)]
[wasm] Misc fixes for template projects (#71468)
* [wasm] Add runArgs.json for console projects
* [wasm] Fix `dotnet.js.symbols` being copied to the bundle
.. and enable it by default for the template projects.
Alexander Köplinger [Thu, 30 Jun 2022 22:26:14 +0000 (00:26 +0200)]
Update Android NDK and set optimization flags (#68354)
Brings in new cmake 2.23.1 and Android NDK23c which fixes an issue with the binary size and perf of libmonosgen-2.0.so
In NDK23b they decided to no longer pass -O2 compiler optimization flag (for arm64, armv7 used -Oz) as part of the Android toolchain but delegate to upstream CMake behavior: https://github.com/android/ndk/wiki/Changelog-r23 and https://github.com/android/ndk/issues/1536
CMake defaults to -O3 for Release builds but unfortunately this causes quite a noticable binary size increase and perf regression.
The Xamarin Android team measured startup time on an average of 10 runs of `dotnet new maui` on a Pixel 5:
```
-O3: 893.7ms
-O2: 600.2ms
-Oz: 649.1ms
```
We now explicitly pass in -O2 for Android builds.
Fixes https://github.com/dotnet/runtime/issues/68330
Steve Molloy [Thu, 30 Jun 2022 21:56:20 +0000 (14:56 -0700)]
Move Serialization/Cache/Transactions/Syndication issues and PR's into the 'Tellurium' project for attention. (#68193)
Eirik Tsarpalis [Thu, 30 Jun 2022 21:14:59 +0000 (22:14 +0100)]
Implement new metadata knobs as internal APIs (#71449)
* Implement new metadata knobs as internal APIs
* Update src/libraries/System.Text.Json/Common/JsonHelpers.cs
Bruce Forstall [Thu, 30 Jun 2022 20:57:57 +0000 (13:57 -0700)]
Improve LSRA and other dump output (#71499)
E.g.,
Update LSRA "Allocating Registers" table description.
Dump nodes added during resolution, e.g.:
```
BB29 bottom (BB08->BB08): move V25 from STK to rdi (Critical)
N001 ( 1, 1) [001174] ----------z t1174 = LCL_VAR int V25 cse4 rdi REG rdi
```
Dump more data in the LSRA block sequence data:
```
-BB03( 16 )
-BB04( 4 )
+BB03 ( 16 ) critical-in critical-out
+BB04 ( 4 ) critical-out
```
When dumping various flow bitvectors, annotate the bitvectors better:
```
-BB25 in gen out
-
0000000000000000
-
0000000000000003 CSE #01.c
-
0000000000000003 CSE #01.c
+BB25
+ in:
0000000000000000
+gen:
0000000000000003 CSE #01.c
+out:
0000000000000003 CSE #01.c
```
Dump hoisting bitvectors using the sorting number:
```
- USEDEF (5)={V04 V00 V01 V02 V03}
+ USEDEF (5)={V00 V01 V02 V03 V04}
```
Also, fix various typos and formatting.
Robin Lindner [Thu, 30 Jun 2022 20:32:08 +0000 (22:32 +0200)]
[API Implementation]: Add `Order` and `OrderDescending` to `Enumerable` and `Queryable` (#70525)
* Implement proposal for `System.Linq`
* Implement proposal for `System.Linq.Queryable`
* Add documentation
* Merge branch 'main' into issue-67194
* Add more test cases
* Apply suggestions
Co-Authored-By: Eirik Tsarpalis <2813363+eiriktsarpalis@users.noreply.github.com>
* Remove unneccesary keyless stuff
* Add more Queryable test cases
* Eliminate `keySelector` null-check in ctor
* Add null checks to `ThenBy`
* Revert "Eliminate `keySelector` null-check in ctor"
This reverts commit
879421b9a5e6d0fba02f0b50cd253eba16f53259.
* Add tests for CreateOrderedEnumerable
* Apply suggestions
* Fix null checks
* Fix null checks
* Update src/libraries/System.Linq/src/System/Linq/OrderBy.cs
* Update src/libraries/System.Linq/src/System/Linq/OrderBy.cs
Co-authored-by: Eirik Tsarpalis <2813363+eiriktsarpalis@users.noreply.github.com>
Co-authored-by: Eirik Tsarpalis <eirik.tsarpalis@gmail.com>
Andrew Au [Thu, 30 Jun 2022 20:11:56 +0000 (13:11 -0700)]
Adjust regions range dynamically based on memory limits (#71164)
Gérald Barré [Thu, 30 Jun 2022 20:00:57 +0000 (16:00 -0400)]
Add MaybeNullWhen( attribute to IParsable.TryParse / ISpanParsable.TryParse (#71381)
Kunal Pathak [Thu, 30 Jun 2022 19:11:37 +0000 (12:11 -0700)]
Exclude root folder's .md files as well from triggering CI (#71404)
* Exclude root folder .md files as well
* Dummy change in .md file
* fix the wildcard
* Revert "Dummy change in .md file"
This reverts commit
ca4decb18221db7d0dff7eee22e33e4ad4784411.
Tamás Turnyánszki [Thu, 30 Jun 2022 16:27:12 +0000 (18:27 +0200)]
Relax Socket.EnableBroadcast getter exception behavior (#70728)
Fixes #70555
Tom Deseyn [Thu, 30 Jun 2022 16:05:48 +0000 (18:05 +0200)]
Reflection.Metadata.Tests: make tests pass when rsa+sha1 signing is not supported.
dotnet-maestro[bot] [Thu, 30 Jun 2022 15:55:09 +0000 (15:55 +0000)]
[main] Update dependencies from dotnet/xharness dotnet/runtime-assets dotnet/roslyn-analyzers (#71376)
[main] Update dependencies from dotnet/xharness dotnet/runtime-assets dotnet/roslyn-analyzers
Pavel Savara [Thu, 30 Jun 2022 14:59:47 +0000 (16:59 +0200)]
[wasm] Preparation for public API in System.Runtime.InteropServices.JavaScript (#71332)
* new ref assembly System.Runtime.InteropServices.JavaScript - empty
* new src assembly System.Runtime.InteropServices.JavaScript
moved all implementation from System.Private.Runtime.InteropServices.JavaScript into it
* added IMPORTS, EXPORTS to js API
* refactored setup_managed_proxy and teardown_managed_proxy in JS
* added more range assert for working with wasm memory in JS
David Mason [Thu, 30 Jun 2022 14:02:33 +0000 (07:02 -0700)]
Move freeing the dynamic heaps until after freeing the code data (#70609)
Vitek Karas [Thu, 30 Jun 2022 12:21:07 +0000 (05:21 -0700)]
Use full path for rd.xml in ilc rsp file (#71480)
This makes the rsp file work regardless of the current directory and makes it much easier for reproducing issues.
So far all of the other paths in the file are generated as absolute paths, except for the rd.xml file path.
Filip Navara [Thu, 30 Jun 2022 12:19:42 +0000 (14:19 +0200)]
Improve interoperability of NTLM encryption/decryption and authentication (#71373)
* Implement NTLM quirk in NegotiateStreamPal.Encrypt/Decrypt
NegotiateStream on non-encrypted connections with NTLM sends the
messages in a special `<signature token><plain text message>` format.
That's not something that gss_wrap/gss_unwrap would produce. It can be
produced through gss_get_mic/gss_verify_mic calls though so let's do
that.
* Remove MakeSignature/VerifySignature from SspiCli interop
The method names were misleading since they wrapped the EncryptMessage
and DecryptMessage native APIs and not the MakeSignature/VerifySignature
APIs that also exist.
* Remove unused sequenceNumber parameters in NegotiateStreamPal.Encrypt/Decrypt
The SSPI / GSSAPI providers keep track of the sequence numbers
themselves.
* Replace NTAuthentication.MakeSignature/VerifySignature with Wrap/Unwrap
This maps directly to the semantics of gss_wrap/gss_unwrap methods
that are used in many specifications. It replaces the misleading name
which in SSPI API is an equivalent of gss_get_mic/gss_verify_mic.
It also fixes the declaration to actually decode the buffers both
on Windows and Unix. In NTLM the content of the message is sealed
and needs to be decoded.
Note that previously on Unix the VerifySignature API didn't decode the
content. On Windows it did decode the content inside a buffer that was
passed as ReadOnlySpan<byte> but it didn't communicate back the offset
of the decoded data.
The SMTP GSSAPI authentication code was thus reading incorrect data.
In case the underlying authentication was Kerberos the data were
not encrypted and they were located at the beginning of the buffer
so it was not an issue. In case the underlying authentication was
NTLM it was looking at the NTLM signature token which luckily
happens to always start with the bytes 01 00 00 00. That exactly
matched the expected value by accident.
* Fix processing of last SMTP GSSAPI token
The last token in the GSSAPI SASL authentication mechanism is a bit
mask that specifies the supported security protections offered by the
server and the maximum token size. The client is supposed to choose
one of the protections and reply back. Relax the check to actually
support servers that offer anything but "no protection". As long
as the server also offers no protection we can choose it.
* Update unit test to use the new Wrap/Unwrap APIs
* Reset NTLM keys after successful Negotiate authentication
Updated the managed NTLM implementation and the fake servers to
implement the specification quirk:
MS-SPNG section 3.2.5.1 NTLM RC4 Key State for MechListMIC and First
Signed Message specifies that the RC4 sealing keys are reset back to
the initial state for the first message.
Since the managed implementation doesn't expose encryption yet it
didn't affect any observable behavior. Likewise the fake servers
didn't need this code path yet.
* Add GSSAPI authentication test to the loopback SMTP server
* Workaround for https://github.com/gssapi/gss-ntlmssp/issues/77
* Expose the confidentiality flag from the native gss_wrap/unwrap APIs
* Allow default credentials for NTLM server-side on Linux/macOS
Lakshan Fernando [Thu, 30 Jun 2022 11:07:18 +0000 (04:07 -0700)]
Fixing a typo in copying pdb files (#71450)
* fixing a typo in copying pdb files
* FB
Anton Firszov [Thu, 30 Jun 2022 11:00:22 +0000 (13:00 +0200)]
Implement HttpProtocolException for HTTP/2 (#71345)
Contributes to #70684
Ankit Jain [Thu, 30 Jun 2022 10:13:41 +0000 (06:13 -0400)]
[wasm] Wasm.Build.Tests - fixes for tests failing on CI (#70704)
* [wasm][nodejs] Ensure that stdout/stderr have been flushed out before exiting
When the results xml is large, and we are writing the base64
representation in one line, `node` can exit before all the output gets
flushed out. This results in xharness getting an incomplete
`STARTRESULTXML <len> <base64> ... ` with missing `ENDRESULTXML`, thus
no `testResults.xml` is generated.
This can be seen in the case of `Microsoft.Extensions.Primitives.Tests`
which has xml ~140KB, and `System.Memory.Tests` which has a xml ~13MB.
So, wait for the two streams to be flushed out, with a timeout of 3secs.
* [wasm] Wasm.Build.Tests: improve reading output from processes
- Fix to call `WaitForExit()` once `WaitForExit(int)` returns, which
ensures that all the async handlers have been run.
- Also, for non-browser xharness runs use the emitted `wasm-console.log`
as the output, so we don't depend on xharness' stdout.
* Wasm.Build.Tests: Run the crypto test only with browser. Other cases are covered in library tests
* Enable WasmTemplateTests.ConsolePublishAndRun
Fixes https://github.com/dotnet/runtime/issues/70675
* Wasm.Build.Tests: avoid unncessary copy when building locally
Copy sdk for testing workloads only on CI.
* Address feedback from @kg
* Remove timeout on flushing stdout/stderr streams, for console templates, IOW, user apps
Jakob Botsch Nielsen [Thu, 30 Jun 2022 09:43:39 +0000 (11:43 +0200)]
JIT: Avoid introducing GT_NULLCHECK in gtTryRemoveBoxUpstreamEffects (#71439)
Adding GT_NULLCHECK nodes requires knowledge of which basic block the
nullcheck will end up in. We do not have this easily available in all
places this method is called, and regardless using GT_NULLCHECK here has
minimal diffs.
Fix #71193
Meri Khamoyan [Thu, 30 Jun 2022 07:34:52 +0000 (11:34 +0400)]
#71252 disable Atan2PiTest on Android x86 (#71382)
* #71252 disable AtanPiTest on Android x86
Ankit Jain [Thu, 30 Jun 2022 06:15:37 +0000 (02:15 -0400)]
[wasm] InterpToNativeGenerator: use invariant culture when generating C (#71460)
* [wasm] InterpToNativeGenerator: use invariant culture when generating C
.. functions.
Fixes https://github.com/dotnet/runtime/issues/71149
* Add missing file
Jeremy Koritzinsky [Thu, 30 Jun 2022 05:25:24 +0000 (22:25 -0700)]
Allow specifying the in/ref/out marshaller scenarios for the generator factory (#71466)
Allow specifying the in/ref/out marshaller scenarios for the generator factory and use the element scenarios types for element scenarios.
Also fix a typo in the CollectionsOfCollectionsStress test that implementing this exposed.
SwapnilGaikwad [Thu, 30 Jun 2022 01:24:06 +0000 (02:24 +0100)]
Implement NarrowUtf16ToAscii for AArch64 (#70080)
* Implement NarrowUtf16ToAscii for AArch64
* Combine x64 and AArch64 implementations of NarrowUtf16ToAscii intrinsic
* Improve comments in VectorContainsNonAsciiChar
Eric Erhardt [Thu, 30 Jun 2022 00:52:04 +0000 (19:52 -0500)]
Enable AES encryption on Browser WASM (#70915)
* Copy RijndaelManagedTransform from reference source
Copied from https://github.com/microsoft/referencesource/blob/
5697c29004a34d80acdaf5742d7e699022c64ecd/mscorlib/system/security/cryptography/rijndaelmanagedtransform.cs
* Format document
* Clean up RijndaelManagedTransform
1. Add copyright
2. Remove unnecessary attributes
3. Mark class as internal
4. Remove FEATURE_CRYPTO define. Only support CipherMode.CBC and PaddingMode.PKCS7.
5. Remove Contracts and replace with Debug.Assert.
* Get RijndaelManagedTransform to compile successfully.
* Make RijndaelManagedTransform implement ILiteSymmetricCipher
And hook it up to AesImplementation for Browser.
* Enable all the Aes tests on Browser.
Mark Aes APIs as supported on Browser.
* Mark all CipherModes and PaddingModes other than CBC and PKCS7 as unsupported on Browser
* Make fields readonly and rename according to code style.
* Replace RijndaelManagedTransformMode with bool encrypting.
* Throw PNSE for unsupported CipherMode and PaddingMode.
Remove unnecessary parameters and fields that aren't supported.
* Fix DecryptorReuse_LeadsToSameResults test so it works on Browser and passes for all CipherModes on other platforms
* Spanify the input buffer in RijndaelManagedTransform Transform and TransformFinal.
* First round of PR feedback
* Make _Nb constant BlockSizeInts
* Get rid of unnecessary allocations
* Remove unsafe pointers from RijndaelManagedTransform.
* PR feedback
Encrypt and Decrypt index arrays are constant values.
Use CopyTo in more places.
* Rename RijndaelManagedTransform => AesManagedTransform
* Change AesManagedTransform to no longer do padding.
Instead, reuse the UniversalCrypto infrastructure to do padding.
* Remove UnsupportedPlatform for PaddingMode
* PR feedback
- clean up unnecessary changes
* PR feedback
Remove UnsupportedOSPlatform("browser") from CipherMode and the SymmetricAlgorithm base class. These create too many false positives and aren't technically accurate since other implementations may support these on browser.
Jan Vorlicek [Thu, 30 Jun 2022 00:42:33 +0000 (02:42 +0200)]
Use llvm-objcopy for regular and cross builds (#71446)
* Use llvm-objcopy for regular and cross builds
This change enables using llvm-objcopy instead of the gnu objcopy for
building runtime. The benefit for cross build is that the host machine
no longer needs to have cross-architecture gnu objcopy installed.
There was an attempt to enable llvm objcopy in the past, but it was
reverted due to a problem with objcopy in llvm 9 that incorrectly
didn't strip debug symbols when `--strip-unneeded` option was specified.
I have fixed that by adding `--strip-debug` in addition to the`--strip-unneeded`.
* Fix OSX build, reflect PR feedback
Eduardo Velarde [Thu, 30 Jun 2022 00:24:00 +0000 (17:24 -0700)]
Add CET pipeline (#71223)
Jeremy Koritzinsky [Wed, 29 Jun 2022 23:50:46 +0000 (16:50 -0700)]
Recognize the stateful marshaller shape (#71355)
SingleAccretion [Wed, 29 Jun 2022 22:51:10 +0000 (01:51 +0300)]
Delete "fgMorphGetStructAddr" (#71078)
Aman Khalid [Wed, 29 Jun 2022 22:23:28 +0000 (15:23 -0700)]
Enable hot/cold splitting of EH funclets (#71236)
Currently, EH funclets are placed after the function's main body in memory.
Via the heuristic that EH funclets are infrequently run, this enables a simple splitting implementation:
* If we find a good split point in the function's main body, split there as usual.
* Else if the function has exception handling,
* Check that all the EH funclets are cold. If any of the funclets are frequently run, don't bother splitting at all.
* If all of the EH funclets are cold, split at `fgFirstFuncletBB`, so that all EH funclets are placed in the cold section.
SingleAccretion [Wed, 29 Jun 2022 22:20:13 +0000 (01:20 +0300)]
Delete dead code (#71351)
SingleAccretion [Wed, 29 Jun 2022 22:19:25 +0000 (01:19 +0300)]
Check layout compatibility before morphing `OBJ(ADDR(LCL_VAR))` into a list of promoted fields (#71348)
* Fix non-x86 targets
* Fix x86
* Add tests
SingleAccretion [Wed, 29 Jun 2022 22:16:04 +0000 (01:16 +0300)]
Enable `TYP_STRUCT` `LCL_VAR/LCL_FLD` call args on ARM64 (#71328)
* Arm64: local morph
* Arm64: morph
* Fix MultiregStructArgs up
SingleAccretion [Wed, 29 Jun 2022 22:13:03 +0000 (01:13 +0300)]
Spill non-morphable split args on non-ARM targets (#71380)
* Spill split args on non-ARM targets
* Add a test
* Work around vectors in varargs being broken
Drew Kersnar [Wed, 29 Jun 2022 19:47:51 +0000 (14:47 -0500)]
Adding AllBitsSet to IBinaryNumber Interface (#71356)
* WIP: add AllBitsSet to BigInteger with the wrong DIM, add test case.
* Implement AllBitsSet for every type inheriting from IBinaryNumber. Remove DIM for now. Adjust ref files.
* Add tests for AllBitsSet on all types.
* Apply suggestions from code review
Co-authored-by: Tanner Gooding <tagoo@outlook.com>
* Apply suggestions from code review
* Update src/libraries/System.Runtime.InteropServices/tests/System.Runtime.InteropServices.UnitTests/System/Runtime/InteropServices/NFloatTests.GenericMath.cs
Co-authored-by: Tanner Gooding <tagoo@outlook.com>
* Change byte's implementation, remove unneeded casts
* Adjust AllBitsSet tests to check that the ones compliment is 0
Co-authored-by: Tanner Gooding <tagoo@outlook.com>
Ankit Jain [Wed, 29 Jun 2022 18:44:52 +0000 (14:44 -0400)]
MonoAOTCompilerTask: Don't check for temp file if cache is disabled (#71411)
* MonoAOTCompilerTask: Don't check for temp file if cache is disabled
Prompted by https://github.com/dotnet/runtime/pull/70851#discussion_r909061233
* Emit a message when deleting tmp files
Theodore Tsirpanis [Wed, 29 Jun 2022 18:41:29 +0000 (21:41 +0300)]
Optimize `HashCode.AddBytes` for inputs larger than 16 bytes. (#70095)
* Optimize `HashCode.AddBytes` for inputs larger than 16 bytes.
* Address PR feedback, refactor control flow and inline UnsafeAddMany.
Co-authored-by: Tanner Gooding <tagoo@outlook.com>
* Add more asserts before memory reads and move one inside the main loop.
* Address PR feedback.
Co-authored-by: Stephen Toub <stoub@microsoft.com>
Co-authored-by: Tanner Gooding <tagoo@outlook.com>
Co-authored-by: Stephen Toub <stoub@microsoft.com>
Viktor Hofer [Wed, 29 Jun 2022 18:25:31 +0000 (20:25 +0200)]
Disable failing graphics tests on windows 7 (#71151)
* Disable failing graphics tests on windows 7
Related: https://github.com/dotnet/runtime/issues/51097. Disables the failing tests on Windows 7 as well.
mikelle-rogers [Wed, 29 Jun 2022 18:25:07 +0000 (12:25 -0600)]
Add ProcessorCount Event to RuntimeEventSource (#65581)
* adding ProcessorCount Event to RuntimeEventSource
* firing the event
* Adding test for ProcessorCount event
Steve Pfister [Wed, 29 Jun 2022 17:07:24 +0000 (13:07 -0400)]
[Mono] Remove unused field in Exception.Mono (#71202)
https://github.com/dotnet/runtime/pull/70970 was merged with a field that was unused. This PR removes it.
Co-authored-by: Steve Pfister <steve.pfister@microsoft.com>
Theodore Tsirpanis [Wed, 29 Jun 2022 16:56:23 +0000 (19:56 +0300)]
Add `System.Drawing.Imaging.ImageFormat.Heif` and `Webp`. (#71227)
* Add `System.Drawing.Imaging.ImageFormat.Heif` and `Webp`.
* Add these formats in the ImageConverterTests.
Omair Majid [Wed, 29 Jun 2022 15:37:25 +0000 (11:37 -0400)]
Fix -cmakeargs options to build.sh (#70901)
PR #67108 (commit
7d562f9d2a4285881ae1c412aecb164dc9370013) tried to
unify how -cmakeargs is passed to build.sh and build.cmd. That commit
has modified src/coreclr/runtime.proj to always include an additional
-cmakeargs argument. However, on Linux, the main ./build.sh command
already includes one. That results in an additional -cmakeargs argument,
which makes the build fail.
Fix that by making build.sh do what build.cmd does: not add the additional
-cmakeargs argument.
Without this change:
$ ./build.sh -cmakeargs -DCLR_CMAKE_USE_SYSTEM_LIBUNWIND=TRUE
...
Commencing CoreCLR Repo build
__DistroRid: linux-x64
Setting up directories for build
Checking prerequisites...
Commencing build of "install" target in "CoreCLR component" for Linux.x64.Debug in runtime/artifacts/obj/coreclr/Linux.x64.Debug
Invoking "runtime/eng/native/gen-buildsys.sh" "runtime/src/coreclr" "runtime/artifacts/obj/coreclr/Linux.x64.Debug" x64 clang Debug "" -DCLR_CMAKE_PGO_INSTRUMENT=0 -DCLR_CMAKE_OPTDATA_PATH= -DCLR_CMAKE_PGO_OPTIMIZE=0 -DFEATURE_DISTRO_AGNOSTIC_SSL=1 -cmakeargs -DCLR_CMAKE_USE_SYSTEM_LIBUNWIND=TRUE
~/devel/dotnet/runtime/artifacts/obj/coreclr/Linux.x64.Debug ~/devel/dotnet/runtime/src/coreclr
Not searching for unused variables given on the command line.
CMake Error: Unknown argument -cmakeargs
CMake Error: Run 'cmake --help' for all supported options.
~/devel/dotnet/runtime/src/coreclr
Unable to find generated build files for "CoreCLR component" project!
Now:
$ ./build.sh -cmakeargs -DCLR_CMAKE_USE_SYSTEM_LIBUNWIND=TRUE
...
__DistroRid: linux-x64
Setting up directories for build
Checking prerequisites...
Commencing build of "install" target in "CoreCLR component" for Linux.x64.Debug in runtime/artifacts/obj/coreclr/Linux.x64.Debug
Invoking "runtime/eng/native/gen-buildsys.sh" "runtime/src/coreclr" "runtime/artifacts/obj/coreclr/Linux.x64.Debug" x64 clang Debug "" -DCLR_CMAKE_PGO_INSTRUMENT=0 -DCLR_CMAKE_OPTDATA_PATH= -DCLR_CMAKE_PGO_OPTIMIZE=0 -DFEATURE_DISTRO_AGNOSTIC_SSL=1 -DCLR_CMAKE_USE_SYSTEM_LIBUNWIND=TRUE
runtime/artifacts/obj/coreclr/Linux.x64.Debug runtime/src/coreclr
Not searching for unused variables given on the command line.
...
Stephen Toub [Wed, 29 Jun 2022 12:27:57 +0000 (08:27 -0400)]
Remove stale CA1419 suppressions (#71406)
Meri Khamoyan [Wed, 29 Jun 2022 11:17:52 +0000 (15:17 +0400)]
#36836 enable test on android (#71371)
Marek Fišera [Wed, 29 Jun 2022 10:44:01 +0000 (12:44 +0200)]
[wasm] Drop active issue on already fixed NodeJS test (#71421)
Jan Vorlicek [Wed, 29 Jun 2022 10:28:34 +0000 (12:28 +0200)]
Fix OSX thread_set_state calls in CONTEXT_SetThreadContextOnPort (#71410)
While testing an issue, I've found that if signals are delivered on the
thread that is a target of the `thread_set_state`, the thread_set_state
sometimes fails with `KERN_ABORTED`. This happens due to the signal
interrupting the `thread_set_state`. Retrying the `thread_set_state`
succeeds and everything works correctly.
This change adds retry loop over the `thread_set_state` calls in the
CONTEXT_SetThreadContextOnPort. There are other usages of `thread_set_state`
in the hardware exception handling code, but those are not subject to
the issue.
I have verified the fix using a testing script that fires a signal
to the corerun process in a loop and ran coreclr pri 1 tests on
the same machine at the same time. Before my change, I was getting an assert
very quickly.
Ilia [Wed, 29 Jun 2022 10:26:09 +0000 (12:26 +0200)]
Fix leaking mach ports & memory after task_threads() (#70338)
Nikita Kazmin [Wed, 29 Jun 2022 10:25:45 +0000 (13:25 +0300)]
Fix SmtpClient reuse with SendAsync (#70046)
Filip Navara [Wed, 29 Jun 2022 09:52:24 +0000 (11:52 +0200)]
Improve allocations in NegotiateStreamPal (#71280)
* Reduce buffer allocations during NTLM/Negotiate authentication
* Update ReadWriteAdapter.WriteAsync prototype to use Memory<byte> instead of explicit offset/count
* Spanify NTAuthentication.Decrypt and avoid couple of offset/count checks
* Spanify NegotiateStreamPal.VerifySignature/MakeSignature.
Remove indirect Encrypt/Decrypt layer from SSPIWrapper, it is unnecessarily cumbersome to use and SslStreamPal already migrated away from it.
* Update src/libraries/Common/src/System/Net/NTAuthentication.Common.cs
Co-authored-by: Stephen Toub <stoub@microsoft.com>
Co-authored-by: Stephen Toub <stoub@microsoft.com>
Kevin Jones [Wed, 29 Jun 2022 09:51:14 +0000 (05:51 -0400)]
Disable ConnectWithRevocation_StapledOcsp on RHEL and CentOS 7 (#71397)
* Disable ConnectWithRevocation_StapledOcsp on RHEL and CentOS 7
* Only skip test when not an offline context
dotnet-maestro[bot] [Wed, 29 Jun 2022 08:38:45 +0000 (10:38 +0200)]
[main] Update dependencies from dotnet/arcade (#71129)
* Update dependencies from https://github.com/dotnet/arcade build
20220620.8
Microsoft.DotNet.ApiCompat , 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 7.0.0-beta.22316.2 -> To Version 7.0.0-beta.22320.8
* Update dependencies from https://github.com/dotnet/arcade build
20220622.3
Microsoft.DotNet.ApiCompat , 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 7.0.0-beta.22316.2 -> To Version 7.0.0-beta.22322.3
* Update dependencies from https://github.com/dotnet/arcade build
20220623.2
Microsoft.DotNet.ApiCompat , 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 7.0.0-beta.22316.2 -> To Version 7.0.0-beta.22323.2
* Update dependencies from https://github.com/dotnet/arcade build
20220624.1
Microsoft.DotNet.ApiCompat , 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 7.0.0-beta.22316.2 -> To Version 7.0.0-beta.22324.1
* Update dependencies from https://github.com/dotnet/arcade build
20220627.1
Microsoft.DotNet.ApiCompat , 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 7.0.0-beta.22316.2 -> To Version 7.0.0-beta.22327.1
* Update dependencies from https://github.com/dotnet/arcade build
20220627.2
Microsoft.DotNet.ApiCompat , 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 7.0.0-beta.22316.2 -> To Version 7.0.0-beta.22327.2
* Upgrade paths with TFMs to net7.0
Arcade upgraded to 7.0 in https://github.com/dotnet/arcade/pull/9127
Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: Premek Vysoky <premek.vysoky@microsoft.com>
Co-authored-by: Alexander Köplinger <alex.koeplinger@outlook.com>
Parker Bibus [Wed, 29 Jun 2022 08:31:00 +0000 (03:31 -0500)]
[PERF][MAUI] Update rollback link for Maui workload install (#71403)
* Update the Maui rollback link to keep getting the latest Maui versions.
* Try running with 6.0.4 installed instead of 6.0.3 to hopefully fix versioning errors.
* Removed testing changes.
Marek Fišera [Wed, 29 Jun 2022 07:39:25 +0000 (09:39 +0200)]
[wasm] Fix loading NPM packages on NodeJS tests (#71377)
* Fix package type in HTTP and WebSocket tests.
* Move loading of tests npm packages to onConfigLoaded.
Aman Khalid [Wed, 29 Jun 2022 06:16:13 +0000 (23:16 -0700)]
Disable HANDLER_ENTRY_MUST_BE_IN_HOT_SECTION (#71273)
The HANDLER_ENTRY_MUST_BE_IN_HOT_SECTION macro was hard-coded to 1, preventing handler entry blocks from being cold (despite the EE supporting cold handler entries). This commit disables the macro and moves logic for setting handler entry weights to fgComputeMissingBlockWeights(); to minimize asmdiffs for now, handler entry weights are modified only when hot/cold-splitting.
Adeel Mujahid [Wed, 29 Jun 2022 04:06:39 +0000 (07:06 +0300)]
Move macOS remote unwinding to libunwind directory (#69720)
Katelyn Gadd [Wed, 29 Jun 2022 03:46:14 +0000 (20:46 -0700)]
Re-enable automatic gc safe transitions in threaded wasm mode (#71229)
Gc safe transitions and memory barriers were disabled for wasm, now they are enabled if the wasm_gc_safepoints AOT compiler option is set or the DISABLE_THREADS define is not active
Andy Ayers [Wed, 29 Jun 2022 01:11:29 +0000 (18:11 -0700)]
JIT: fix double reporting of some GC frame slots (#71245)
If there is a gc struct local that is dependently promoted, the struct
local may be untracked while the promoted gc fields of the struct are
tracked.
If so, the jit will double report the stack offset for the gc field,
first as an untracked slot, and then as a tracked slot.
Detect this case and report the slot as tracked only.
Closes #71005.
Zoltan Varga [Wed, 29 Jun 2022 01:08:33 +0000 (21:08 -0400)]
[mono] Avoid a linear search in the GENERICPARAMCONSTRAINT table, its sorted by owner. (#71349)
Zoltan Varga [Wed, 29 Jun 2022 01:08:17 +0000 (21:08 -0400)]
[mono] Use GenericArraySortHelper<T> on mono as well. (#71325)
* [mono] Use GenericArraySortHelper<T> on mono as well.
* Remove unnecessarily DynamicDependency attributes.
Alex Rønne Petersen [Wed, 29 Jun 2022 00:03:00 +0000 (02:03 +0200)]
Disable LTCG when building libnethost.lib for Windows. (#71089)
Fixes dotnet/runtime#71056.
Elinor Fung [Tue, 28 Jun 2022 23:07:49 +0000 (16:07 -0700)]
Update to use CustomMarshaller entry point type (#71398)
Michal Strehovský [Tue, 28 Jun 2022 23:05:29 +0000 (08:05 +0900)]
Remove unnecessary DynamicDependency in CoreLib (#71369)
* The ones on `CreateArraySortHelper` were introduced before we introduced dataflow annotations on `CreateInstanceForAnotherGenericParameter`. This should now just fall out naturally.
* The ones on `InvokerEmitUtil` were added recently in #67917. I'm going to assume it's just a cargo cult because the reflection within the methods is fully analyzable. We would need warning suppressions if it wasn't.
Kunal Pathak [Tue, 28 Jun 2022 21:06:37 +0000 (14:06 -0700)]
Update guideline of squashing commits (#71394)
* do not squash commits
* point to pr-guide
Andy Ayers [Tue, 28 Jun 2022 20:00:04 +0000 (13:00 -0700)]
JIT: strengthen checking of the loop table (#71184)
Add loop table checking to the post-phase list, conditional on whether the
table is expected to be valid.
Declare that the table is valid from the end of the find loops phase to the
end of the optimization phases.
Add checks that sibling loops are fully disjoint, no child shares top with its
parent, and all top-entry loops have at most one non-loop backedge.
Expand set of phases that opt into the "common" poost phase checks
to include all those between find loops and hoisting.
Closes #71084.
Closes #71071.
Radek Doulik [Tue, 28 Jun 2022 19:07:47 +0000 (21:07 +0200)]
[wasm] Add Vector128.OnesComplement SIMD intrinsic (#71384)
* [wasm] Add Vector128.OnesComplement SIMD intrinsic
Add wasm specific implementation of `Vector128.OnesComplement` method.
Example compilation output. Managed:
static Vector128<double> SimdTest3(Vector128<double> input)
{
return Vector128.OnesComplement(input);
}
IR:
BB3: ; preds = %BB2
%cast_to_4_x_i32 = bitcast <2 x double> %simd_vtype to <4 x i32>
%wasm_not = xor <4 x i32> %cast_to_4_x_i32, <i32 -1, i32 -1, i32 -1, i32 -1>
%cast_back = bitcast <4 x i32> %wasm_not to <2 x double>
br label %BB4
wasm - Debug configuration:
(func Wasm_Console_V8_CJS_Sample_Test_SimdTest3_System_Runtime_Intrinsics_Vector128_1_double(param $0 i32, $1 i32, $2 i32))
local $3 i32
local $4 i32
local $5 v128
local $6 v128
0x00cf955a: global.get $__stack_pointer
0x00cf955c: local.set $3
0x00cf955e: i32.const 16
0x00cf9560: local.set $4
0x00cf9562: local.get $3
0x00cf9564: local.get $4
0x00cf9566: i32.sub
0x00cf9567: drop
0x00cf9568: local.get $1
0x00cf956a: v128.load align:4 [SIMD]
0x00cf956e: local.set $5
0x00cf9570: local.get $5
0x00cf9572: v128.not [SIMD]
0x00cf9574: local.set $6
0x00cf9576: local.get $6
0x00cf9578: drop
0x00cf9579: local.get $0
0x00cf957b: local.get $6
0x00cf957d: v128.store [SIMD]
0x00cf9581: return
wasm - Release configuration:
(func idx:7866(param $0 i32, $1 i32, $2 i32))
0x00185b37: local.get $0
0x00185b39: local.get $1
0x00185b3b: v128.load align:4 [SIMD]
0x00185b3f: v128.not [SIMD]
0x00185b41: v128.store [SIMD]
* Apply feedback
* Add `--enable-simd` to `wasm-opt` again
* Fix build
Andy Ayers [Tue, 28 Jun 2022 19:05:14 +0000 (12:05 -0700)]
JIT: add missing test case for gdv and boxing (#71389)
This should have gone in with #60355. It was included in the 6.0 port (#69630).
Now adding it to main as well.
Stephen Toub [Tue, 28 Jun 2022 18:47:36 +0000 (14:47 -0400)]
Use null coalescing in many more places (#71361)
Stephen Toub [Tue, 28 Jun 2022 18:46:45 +0000 (14:46 -0400)]
Enable IDE0170 (Simplify property pattern) and IDE0200 (remove unnecessary lambda expression) (#71011)
As part of updating the config file with recently added rules, also turn on a few of them.
Jakob Botsch Nielsen [Tue, 28 Jun 2022 16:39:46 +0000 (18:39 +0200)]
JIT: Avoid incorrect TYP_UINT retyping for ToScalar (#71372)
TYP_UINT is only meaningful for certain operations in the JIT and nodes
can/should never produce values of this type.
Fix #71360
Jeremy Koritzinsky [Tue, 28 Jun 2022 16:04:15 +0000 (09:04 -0700)]
Add test coverage for generic type substitution with byreflike generics (#71276)
This test coverage also found some interesting behavior (issue TBD) in the following scenario:
Given a `<byreflike T>` (aka a `T` that can be a byreflike type), we allow passing this to a `<U>` generic parameter (where `U` does not allow byref-like types).
We do correctly throw when instantiating the generic with a byreflike type though, so we don't end up in a bad state.
I've marked this test with an ActiveIssue attribute pending feedback on whether or not this is a bug.
Stephen Toub [Tue, 28 Jun 2022 15:02:23 +0000 (11:02 -0400)]
Update ValueStringBuilder grow logic (#70942)
Handle the case where _chars.Length * 2 is too large to be an array but _pos + additionalCapacityBeyondPos is small enough to be an array.
Jan Kotas [Tue, 28 Jun 2022 13:27:58 +0000 (06:27 -0700)]
Rename nightly to daily in the dogfood instructions (#71383)
Consistency with runtime and SDK download urls and other docs.
dotnet bot [Tue, 28 Jun 2022 13:11:33 +0000 (06:11 -0700)]
Localized file check-in by OneLocBuild Task: Build definition ID 679: Build ID 1848989 (#71365)
Andrii Kurdiumov [Tue, 28 Jun 2022 12:39:19 +0000 (18:39 +0600)]
Simplify instructions for using ILC (#70811)
* Simplify instructions for using ILC
Because Microsoft.DotNet.ILCompiler on Nuget now, it's reasonable to inform user that adding custom nuget feed is for daily builds of ILC
* Attempt to improve docs
* Address PR feedback
* Removed unused file
Co-authored-by: Jan Kotas <jkotas@microsoft.com>
Lakshan Fernando [Tue, 28 Jun 2022 11:53:54 +0000 (04:53 -0700)]
Annotate collections.specialized to be native aot compatible (#71159)
* annoate specialized to be native aot compatible
* FB
* Update src/libraries/System.Collections.Specialized/src/System/Collections/Specialized/NameObjectCollectionBase.cs
Co-authored-by: Michal Strehovský <MichalStrehovsky@users.noreply.github.com>
Co-authored-by: Michal Strehovský <MichalStrehovsky@users.noreply.github.com>
Eirik Tsarpalis [Tue, 28 Jun 2022 10:47:05 +0000 (11:47 +0100)]
Rewire polymorphism metadata to the contract model (#71346)
* Rewire polymorphism metadata to the contract model
* fix file ordering
* Expand test coverage