* Slightly reduce memory usage for classes without a variance search table (many of them)
* Make the variance search table for a given class larger, but remove the need to recursively search every table in the hierarchy
* Optimize out the additional interfaces list scan to compute the interface offset once we find a match in the variance table
This is largely a placeholder just to get the MethodDesc/MethodDescChunk infrastructure in place. To further fill out ValidateMethodDesc and to implement the GetMethodDescData DAC API, I also need to add an executable code manager contract for mapping between native code pointer values and methods. I'd like to do that as a separate PR.
Debugged WinDbg enough to verify that GetMethodDescData is implemented enough to extract the correct MethodTable pointer value from a MethodDesc.
* start GetMethodDescDataImpl
* add MethodDesc and MethodDescChunk
* checkpoint: MethodDesc validation
* update contract
* fix RuntimeTypeSystem unit tests
mock the additional data and globals
* fix GetMethodDescChunkPointerMayThrow
* add data descriptor description to the contract
* Apply suggestions from code review
Co-authored-by: Elinor Fung <elfung@microsoft.com>
* MayThrow -> Throwing
* Slot is ushort not byte
* remove unused property
* add TargetPointer 32-/64-bit max constants
* use NewArrayHolder
* spelling
* add globals to RTS contract
* remove unused usings
* constexpr cdac_offsets, not const
* Apply suggestions from code review
Co-authored-by: Elinor Fung <elfung@microsoft.com>
* make GetNumVtableSlots private
---------
Co-authored-by: Elinor Fung <elfung@microsoft.com>
* Build a .dll if 'CustomNativeMain' is set
* Switch on 'NativeLib' instead for .exe args
* Actually output a .dll if 'NativeLib' is set
---------
Co-authored-by: Jan Kotas <jkotas@microsoft.com>
Co-authored-by: Michal Strehovský <MichalStrehovsky@users.noreply.github.com>
* Replace a few stackallocs with collection expressions
* Update src/libraries/System.Text.Encodings.Web/src/System/Text/Encodings/Web/OptimizedInboxTextEncoder.Ascii.cs
* OpenSSL providers support
* Address self feedback (Lazy+leak)
* Attempt to fix EVP_PKEY_CTX_new_from_pkey errors
* update osslcompat_30.h with EVP_PKEY types
* properly ifdef extraHandle code
* fix: unused parameter extraHandle when OSSL 3 not available
* bugfixes, feedback
* ifndef some defines in compat layer, remove CryptoNative_EvpPkeyExtraHandleDestroy
* change style to match old RsaSignHash
* XML doc + extra test case
* remote OSSL_STORE_open usage and revert comment on the DuplicateKeyHandle
* Address feedback
* Add back HasNoPrivateKey check on OSSL ver LT 3
* move check to SignHash
* address feedback (ThrowIfNull + switch expression)
* update XML doc
* attempt to fix ossl 1.0.2 build by moving ifndef to opensslshim.h
The SCEV analysis does not care about the value of something once it is
seen to be invariant inside the loop we are currently analyzing. This
was problematic for this logic that tries to peel additions away from
offsets; for arm64, we may have hoisted `array + 0x10` outside the loop,
which would cause us to fail to get back to the base array.
Switch the reasoning to use VNs and peel the offsets from the VNs
instead.
No x64 diffs are expected as we do not hoist the `array + 0x10` out of
the loop there. Improvements expected on arm64 where we can now prove
that a "full" strength reduction is allowable more often.
* Fix the reloc type typo
* do not track tls_index reference
* Update guid so the new collection contains correct reloc data
* fix the code for Add
* remove old code and add comment
* jit format
* Add Arm64 target in reproNative.vcxproj
* jit format
* review feedback
* jit format
* Disable AVX for Sve leg
* REVERT: Dummy change
* wrap in quotes
* Revert "REVERT: Dummy change"
This reverts commit 3d3df5a3744ab71df8d4983ccfc1da469590e056.
* Enable ServerAsyncAuthenticate_MismatchProtocols_Fails
* Enable subset of CertificateSelectionCallback_DelayedCertificate_OK
* Enable SslStream_StreamToStream_Alpn_NonMatchingProtocols_Fail and do not assume android backend supports ALPN
* Enable ConnectWithRevocation_WithCallback and pass full chain to ServerCertificateContext
* Enable or permanently disable tests in SslStreamNetworkStreamTest
* Adjust host name data for Android in SslStreamSniTest
* Fix expected outcome of TransportContext_ConnectToServerWithSsl_GetExpectedChannelBindings for Android
* Fix ChainTests active issue on Android
* Fix failing test
* TMP: Print full exception stacktrace
* Adjust expected exception for server authentication protocol mismatch
* Revert "TMP: Print full exception stacktrace"
This reverts commit 1be0a16c75b53f6873163b1efa5b12021cfb5350.
* Adjust the expected exceptions for arm and x86/x64
* Fix assert
* Address review comments
Add the Exception, Object, Array of Object, and String method tables to the data descriptor and use them to implement ISOSDacInterface::GetUsefulGlobals in the cDAC.
Contracts are unaffected - this is just exposing those globals via the DAC API.
* Fix the ExposedLocalsNumbering test
The test had a stack corrupting race condition:
1) Main thread returns from "Main".
2) Main thread calls some runtime code on the stack of former "Main".
3) Mutator thread writes to the "safeIndex" variable, which is now
part of that runtime's code stack.
4) Things crash.
Fix by 'parking' the mutated index in some dynamic memory instead.
* issues.targets de-exclusion
* Remove class constraint from Interlocked.{Compare}Exchange
Today `Interlocked.CompareExchange<T>` and `Interlocked.Exchange<T>` support only reference type `T`s. Now that we have corresponding {Compare}Exchange methods that support types of size 1, 2, 4, and 8, we can remove the constraint and support any `T` that's either a reference type, a primitive type, or an enum type, making the generic overload more useful and avoiding consumers needing to choose less-than-ideal types just because of the need for atomicity with Interlocked.{Compare}Exchange.
---------
Co-authored-by: Michal Strehovský <MichalStrehovsky@users.noreply.github.com>
* Allow using a more efficient algorithm if twice the vector size is accelerated
* Remove an unnecessary generic parameter from ExpDouble
* Expose the Sin, Cos, and SinCos methods on the Vector types
* Use the vector Sin, Cos, and SinCos methods where possible
* Adding tests covering the vector Sin, Cos, and SinCos APIs
* Fix some small bugs in the Sin, Cos, and SinCos impls
* Ensure that very large inputs are handled
* Ensure region is correctly adjusted when determining the sign of sin
* Ensure that TernaryLogic lowering accounts for AND_NOT since it is not commutative
* Don't vectorize too large SinPi or CosPi inputs for TensorPrimitives
* Don't accelerate SinCosPi for the time being
* Don't accelerate TensorPrimitives.SinCos for the time being
* Don't include JIT changes, they were extracted to their own PR
- Include `String` and `Object` in data descriptor
- Start an `Object` contract for getting information about known managed objects
- Make cDAC implement `ISOSDacInterface::GetObjectStringData`
This PR adds Mono support for SwiftSelf<T> in the Swift calling convention. This type enables the correct passing of frozen value types in instance methods in Swift.
- For string accesses we also produce `ARR_ADDR`, so we must take care
to use `GenTreeArrAddr::GetFirstElemOffset` instead of hardcoding
`OFFSETOF__CORINFO_Array__data`
- There are cases where VN is fully able to prove that bound <
ARR_LENGTH(vn), specifically when the array is stored in a static
readonly field. In those cases everything reduces to constants, so
allow VN to try to prove it but fall back to our manual logic
otherwise.
- Rephrase the fallback as a VN test as well. In a standard `for (;i <
arr.Length;)` loop we have a bound on the backedge of the shape
`ARR_LENGTH(array) - 1`. The previous strategy was to syntactically
check if the LHS was such an array length on the same array as the
base of the add recurrence.
Instead of doing that, we can ask more generally for any shape `x - c`
whether we know that `x <= ARR_LENGTH(array)`. In the usual case of `x
== ARR_LENGTH(array)` this is trivially true and VN knows that.
However, there are other cases where this is provable by RBO due to a
dominating compare; particularly loop cloning introduces these
dominating compares when cloning loops of the shape `for (; i < n;)`.
This fixes#105087.
This adds a new optimization in the IV opts phase that removes unused
primary IVs from loops. Liveness is unable to remove IVs since they are
self-referential, and strength reduction can sometimes leave old IVs
unused (normally they would get removed by the downwards loop
optimization, but only if the old primary IV was used in a loop test).
Removes code in the downwards loop optimization to remove statements;
this will be handled by this new phase.
Also factors IV widening into its own function.
* WIP to implement out-of-proc sampling spec for tracing.
* Clean up.
* Adjust sampling precedence rules.
* Code review and refactor.
* Drop support for specifying wild card activity source with specific activity name. Improve internal logging.
* Remove unsupported scenario from code comments.
* Discard additional rules once a match has been established.
* Refactor away DiagnosticSourceEventSourceListener class.
* Code review.
* Revert partial addition.
* Skip lookup using activity name if no rules were defined.
* Remove static coupling.
* Cleanup.
* Fix up trim warnings.
- Add placeholder value in `apphost` for .NET install search options. Format:
- `<search_location_flags> /0 <app_relative_dotnet_path>`
- Make `apphost` conditionally look at app-local, app-relative, environment variables, and global locations based on configured behaviour
- Default (placeholder not changed) is to look at app-local, environment variables, and global locations.
- Update error and tracing messages to include information about any configured search options
- Allow specifying search options in `HostWriter.CreateAppHost`
- Add unit/integration tests
Part of https://github.com/dotnet/designs/blob/main/proposed/apphost-embed-install-location.md.
There still needs to be a corresponding change on the SDK side to allow configuration via `AppHostDotNetSearch` and `AppHostRelativeDotNet` properties.
* Ensure that TernaryLogic lowering accounts for AND_NOT since it is not commutative
* Ensure we create a valid node when DOTNET_EnableSSE2=0 is set
* Apply formatting patch
Ensure we don't reorder evaluation and change exceptional behavior.
Closes#89565.
Co-authored-by: Jakob Botsch Nielsen <Jakob.botsch.nielsen@gmail.com>
The previous equality check does not catch the case where the SCEV is
just a widened version of the previous primary IV. We want to leave that
handling up to IV widening.
* Enable full SwiftCallbackAbiStress tests
* [arm64] Swift struct lowering in callback returns
* [amd64] Swift struct lowering in callback returns
* [x64] refactor return buffer save condition