Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/dotnet/runtime.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2022-10-01Reinstate strict prototypes warning (#76463)yowl
* reinstate strict-prototype warning * More fixes * Need to keep the warning disabled for zlib https://github.com/madler/zlib/issues/633 Co-authored-by: Jan Kotas <jkotas@microsoft.com>
2022-10-01Fix SuperPMI unit test error checking (#76411)Bruce Forstall
* Fix SuperPMI unit test error checking We were ignoring test failures, and even ignoring if the test we wanted to run under collection actually existed. This means that at some point during recent test reconfigurations, we stopped building 10w5d_cs_do.cmd/sh but we didn't notice. Because Bytemark kept being built as before, we got at least some .mc files. Add more checking that the programs we want to run exist, and that the tests we invoke pass. * Adjust superpmi unit test collection tests Add CscBench to get better C# coverage. Disable 10w5d_cs_do.csproj due to https://github.com/dotnet/runtime/issues/76421
2022-10-01[JIT] Fix potential division by zero in fgopt.cpp (#76424)Gilles Grospellier
Division by zero in C++ is undefined behavior on some architecture and should be avoided. Co-authored-by: Andy Ayers <andya@microsoft.com>
2022-10-01Implement ChaCha20Poly1305 with CryptoKit on macOSKevin Jones
Co-authored-by: Filip Navara <filip.navara@gmail.com>
2022-10-01JIT: allow forward sub of QMARK nodes (#76476)Andy Ayers
There is often a single-def single use temp consuming a QMARK (which in turn often comes from expansion of `isinst` and friends). This temp assignment tends to stay around and can inhibit redundant branch opts in a number of interesting cases. It may also serve as an attractive nuisance for copy prop. While it would be ideal to generalize RBO to handle assignment side effects, doing so appears quite challenging, as we would need to rewrite possibly large chunks of the SSA and VN graphs. Forward sub eliminates the temp and so clears the way for the existing RBO to remove more branches. Addresses aspects of the "side effect" enhancements for RBO (see #48115).
2022-10-01Update jitrollingbuild.py (#76472)Bruce Forstall
Pick up changes made to superpmi.py for more general finding of `main` branch. Make "list" choose a default git hash if not specified. Change `list --all` to show all the JITs for a particular git hash. Add new `list --global_all` to show all JITs for all git hashes (this was previously `list --all`). Fix obsoleted `logging.warn`; use `logging.warning` instead.
2022-10-01Improve early bail-out logic in GCInfoDecoder (#76359)Filip Navara
Co-authored-by: Jan Kotas <jkotas@microsoft.com>
2022-10-01JIT: Avoid internal register allocation when possible for PUTARG_SPLIT (#76443)Jakob Botsch Nielsen
We can almost always avoid allocating an internal register, which may be expensive if LR is picked since we cannot use thumb encoding for it. The only case where we need an internal register is when we have a source that is in a register, and we have a single taget register to place that conflicts with that source register. The to-stack copies then need an intermediate scratch register to avoid clobbering the source register.
2022-10-01Fix DEBUG/non-DEBUG SuperPMI asm diffs (#76470)Bruce Forstall
Recorded SPMI method contexts include configuration environment variables such as `COMPlus_JITMinOpts` that are replayed. However, when doing asmdiffs replays to compare a Release to a Checked compiler (non-DEBUG to DEBUG), there may be codegen-altering configuration variables such as JitStress that are only read and interpreted by the DEBUG compiler. This leads to asm diffs. Introduce a `-ignoreStoredConfig` argument to superpmi.exe, and use it in superpmi.py when doing Checked/Release asm diffs, that pretends there are no stored config variables. This assumes that the stored config variables only alter JIT behavior but that they JIT will succeed with or without them. This is also slightly more than necessary: if there is a config variable that the Release compiler knows about, we won't use that, either. However, we have no easy way (currently) to distinguish which variables are DEBUG and which are both DEBUG and non-DEBUG available. Contributes to https://github.com/dotnet/runtime/issues/76347
2022-10-01Remove `IDispatchImplAttribute` API (#76416)Aaron Robinson
* Remove IDispatchImplAttribute API This type has never been supported on .NET Core. Removing all supporting code paths.
2022-10-01SuperPMI collections: exclude more files/directories (#76384)Bruce Forstall
* SuperPMI collections: exclude more files/directories Exclude a few more native code files and the 'runtimes' directory that contains uninteresting files, including native code files, to reduce the number of PMI exceptions during collections. * Use python 'list' constructor to avoid modifying global lists
2022-10-01Use BCrypt for ephemeral RSA on WindowsJeremy Barton
Windows CNG has two different libraries: bcrypt.dll (`BCrypt*` functions) for in-memory/ephemeral operations, and ncrypt.dll (`NCrypt*` functions) for persisted key operations. Since the NCrypt functions can also operate on ephemeral keys our cryptographic operations have generally been done in terms of NCrypt. NCrypt's flexibility (to also work with persisted keys) comes at a cost. All key operations are done out-of-process (in lsass.exe), and that requires an (L)RPC call for every operation. It also means there are simply more moving parts, and thus more room for error. With this change we will use BCrypt for RSA operations on Windows from `RSA.Create()` and `cert.GetRSAPublicKey()`. ECDSA/ECDH/DSA can any/all be changed to follow suit later. For keys created from RSA.Create() a verification operation currently looks like * Virtual invoke to RSAWrapper.VerifyHash * Maybe-devirtualized invoke to RSACng.VerifyHash * P/Invoke to NCryptVerifySignature * "Virtual" invoke to MSKSPVerifySignature (or whatever it's really called) * LRPC call * Find key in the MRU ring * Effectively a call to BCryptVerifySignature After this change it is instead * Virtual invoke to RSABCrypt.VerifyHash * P/Invoke to BCryptVerifySignature Removing all of those other indirections removes about 40us from a 50us operation (on my primary devbox). As part of making some code be shared between RSACng and RSABCrypt, some allocating code changed to pooling code and some array code got spanified.
2022-10-01[metadata] Skip null vtable entries when checking covariant return overrides ↵Aleksey Kliger (λgeek)
(#76323) * Add test for covariant reabstraction * [metadata] Skip null vtable entires when checking covariant overrides When there are covariant return overrides, we check the vtable slot in every parent class for signature compatability with the proposed override. However if one of the ancestor classes is abstract, it could have an abstract override for hte method: class Base { public virtual Base Method() => this; } public abstract Intermediate : Base { public override abstract Base Method(); } public Leaf : Intermediate { public override Leaf Method() => this; } In this case when we're checking that Leaf.Method is compatible with the vtable slot in Intermediate, we will see a null method (since Intermediate is abstract). In such cases we can skip over the class and continue with its parent. Fixes https://github.com/dotnet/runtime/issues/76312
2022-10-01[NativeAOT] Enable CI for macOS x64/arm64 (#75421)Filip Navara
* [NativeAOT] Enable CI for macOS x64/arm64 * Update CppCompilerAndLinker condition * Enable NativeAOT osx-arm64 build in regular runtime pipeline * Enable cross-compilation on macOS * Fix HAVE_SHM_OPEN_THAT_WORKS_WELL_ENOUGH_WITH_MMAP when cross-compiling * Update OSVersion_ValidVersion_OSX test on NativeAOT The test tries to validate Environment.OSVersion.Version which works correctly. RuntimeInformation.RuntimeIdentifier, however, doesn't use versioned RIDs when NativeAOT is used. * Add hack to stop linker from corrupting DWARF CFI, bump darwin version in triple to get compact unwinding tables generated * Bump ObjWriter packages * Disable MessageSendTests on NativeAOT Co-authored-by: Adeel <3840695+am11@users.noreply.github.com> Co-authored-by: Jan Kotas <jkotas@microsoft.com>
2022-09-30Quick disasm check CI JitStress fix (#76417)Will Smith
Runtime_33972 was failing in ARM64 in JitStress because it turns off HWIntrinsic - so I force the test to enable it.
2022-09-30NativeAOT: Conversion for opcode conv_u4 is unsigned (#76386)yowl
* fix probable type for conv_u4 to match conv_u8 regards unsigned conversion * Fix conv_u as well Co-authored-by: Jan Kotas <jkotas@microsoft.com>
2022-09-30Always expose parents of exposed promoted fields (#76181)SingleAccretion
* Remove the special case * Simplify code * Add tests
2022-09-30Removing short name column from compphases.h (#76030)Brian Bohe
* Avoiding the use of JIT phases shorName * Removing shortName from JIT phases description * Avoiding memory allocation * Renaming variable
2022-09-30JIT: increase slop tolerance when computing edge weights (#76409)Andy Ayers
Up the tolerance a bit to get past some jit stress errors we're seeing. Fixes the main case in #74169.
2022-09-30[mono] Fix iOS/tvOS build with Xcode 14 (#76433)Alexander Köplinger
Before Xcode 14 the `objc_super` struct definition in the SDK headers looked like this: ``` #if !defined(__cplusplus) && !__OBJC2__ /* For compatibility with old objc-runtime.h header */ __unsafe_unretained _Nonnull Class class; #else __unsafe_unretained _Nonnull Class super_class; #endif ``` With Xcode 14 however the iOS/tvOS SDK header was changed to only define `super_class`, but the MacOSX SDK stayed the same. Added CMake detection of this case so we can compile both on older and newer Xcode SDKs across platforms.
2022-09-30Support running Reflection tests within Visual Studio (#75915)Steve Harter
2022-09-30Implement AuthenticationTagMismatchException exceptionKevin Jones
Co-authored-by: Filip Navara <filip.navara@gmail.com>
2022-09-30[wasm] Add a workaround for issue#76429 to fix CI (#76432)Ankit Jain
2022-09-30Add QuicError.AlpnInUse member (#74754)Radek Zikmund
* Import new MsQuic interop * Detect the new QUIC status * Use correct values for ALPN_IN_USE in interop shim * Update alpine-3.14-helix-amd64 image to newer
2022-09-30[wasm] Pass --web-server-use-cop for threading samples (#76419)Ankit Jain
* [wasm] Pass --web-server-use-cop for threading samples * CI: Add wasm samples to wasm specific paths list
2022-09-30Fix filtered exceptions when checking for ip forwarding (#76383)Radek Zikmund
2022-09-30Fix edit and continue in VS with hardware exceptions (#76401)Jan Vorlicek
There is a subtle bug in hardware exception handling in the runtime that causes the debugged process to crash when a user tries to use the "unwind to this frame" on the frame where the exception happened. This issue was introduced by the recent changes that modified hardware exception handling. The problem turned out to be in how we update the exception and context records in the HandleManagedFaultFilter when we re-raise the exception using RaiseException from the VEH. Updating the context is both not necessary and wrong. All we need to update is the `ExceptionAddress` in the `EXCEPTION_RECORD`, since the RaiseException puts the address of itself there and we need the address of the original access violation to be there. The context should stay untouched as we are unwinding from the RaiseException. The context copying was originally made to mimick the code in the `NakedThrowHelper` used before the exception handling change. That one needed the context update, as it was used to fix unwinding over the NakedThrowHelper that was a hijack helper. In the current state, nothing like that is needed. With this fix, the VS debugger works as expected.
2022-09-30Distributed transaction fixes (#76310)Shay Rojansky
* Retake lock when using a dependent transaction from a TransactionScope (#76010). * Reset TransactionTransmitter and Receiver before reusing them (#76010). * Increase MSDTC startup timeout from 2.5 to 30 seconds (#75822) Fixes #76010 Fixes #75822
2022-09-30[mono] Add Vector128 Negate and OnesComplement intrinsics for amd64 (#74993)Matous Kozak
* Vector128 Negate intrinsics (two's complement) * AMD64 OnesComplement intrinsics for Vector128/64 * Negate + OnesComplement operands,fix missing break * Simplify OP_AMD64_NEGATION * Conditional Select for amd64, refactor arm64 code * Re-use Arm64 code for Negate and OnesComplement * rename ones complement * Update src/mono/mono/mini/mini-ops.h remove space Co-authored-by: Fan Yang <52458914+fanyang-mono@users.noreply.github.com> * remove space mini-ops.hs * remove blank line Co-authored-by: Fan Yang <52458914+fanyang-mono@users.noreply.github.com>
2022-09-30Remove the GenericComPlusCall mechanism (#76415)Aaron Robinson
Remove unused asm constants. Remove comments about context-bound objects and remoting. Use common constants for VtblGap concept.
2022-09-30[NativeAOT] Fix System.Runtime.InteropServices tests (#75669)Michal Strehovský
2022-09-30[mono][jit] For beforefieldinit classes, only field accesses trigger ↵Zoltan Varga
initialization. (#76335)
2022-09-30Remove some dead code from Array.IndexOf (#76388)Stephen Toub
2022-09-30Remove GT_ADDEX and replace with more generalized containment handling (#76273)Tanner Gooding
* Remove GT_ADDEX and replace with more generalized containment handling * Handle small types for (extended register) instructions * Remember to handle IsRegOptional * Applying formatting patch * Preference containing the CAST of `ADD(op1, CAST(op2))` rather than the op2 of CAST * Update src/coreclr/jit/lowerarmarch.cpp * Adding a test covering the caught fuzzlyn scenario * Ensure the new test returns 100 * Skip a Fuzzlyn generated regression test on Mono wasm/llvmaot/llvmfullaot
2022-09-30Disable gen 1 budget accounting fix for segments, so the segments ↵Peter Sollich
implementation of GC behaves like .NET 6.0 did. (#76365)
2022-09-29[tests] Disable source generator tests mobile (#75609)Mitchell Hwang
* Disable Source generator tests on all mobile platforms * Remove redundant source generator test suite exclusions
2022-09-29JIT: optimize redundant branches by looking through phis (#76283)Andy Ayers
In some cases the value of a block's branch predicate is correlated with the predecessor of the block. Often this correlation is hinted at by the presence of phis in the predicate's tree and/or phi VNs in in the predicate's VN graph. For each predecessor of a block, we evaluate the predicate value number using the values brought to the block by that predecessor. If we find correlations, we use them to drive the existing jump threading optimization. Make sure that when we search local PHIs we also match the ssa def number to ensure we're looking at the right PHI. Also, if we end up partially disambiguating such that there is just one remaining predecessor, update the value number of the predicate to reflect the values that flow in from that predecessor. Fixes #75944. Contributes to #48115.
2022-09-29Ensure that StoreInd for contained HWIntrinsics has the constant "fit in ↵Tanner Gooding
byte" (#76385)
2022-09-29SPMI: Improve speed significantly for large diffs (#76238)Jakob Botsch Nielsen
This starts communicating more information about diffs back from superpmi and starts using it in the driver. The current information is the base size, diff size, base instructions, diff instructions and context size. The driver uses the base size/diff size to pick a small number of interesting contexts and only creates disassembly for these contexts. jit-analyze is then also invoked on only these contexts, but the contexts are picked so that they overlap with what jit-analyze would display. Additionally, we also pick the top 20 smallest contexts (in terms of context size) -- I frequently use the smallest contexts with diffs to investigate my change. The new behavior is only enabled when no custom metrics are specified. If custom metrics are specified we fall back to producing all disassembly files and leave it up to jit-analyze to extract and analyze the metrics specified. Also, the retainTopFilesOnly option is no longer necessary since our CI pipeline will at most produce 100 .dasm files now. Another benefit is that this means that all contexts mentioned in the jit-analyze output will now be part of the artifacts. The net result is that we can now get SPMI diffs for changes with even hundreds of thousands of diffs in the same time as it takes to get diffs for a small change. Fix #76178
2022-09-29Return s_defaultResultTask from Task.FromResult in more cases (#76349)Stephen Toub
* Return s_defaultResultTask from Task.FromResult in more cases Today we return a cached task from Task.FromResult when the TResult is a primitive and its value is 0. But it needn't be constrained to only being a primitive; what matters is that we need to be able to efficiently compare its bit pattern to 0. And we can do that easily now by using Unsafe.SizeOf to check if the size is the same as a primitive, Unsafe casting to that primitive, and then comparing against 0. * Update tests
2022-09-29remove explicit LangVersion from a few projects (#75806)kasperk81
* remove explicit LangVersion from a few projects * feedback * net7.0 * net7.0 Co-authored-by: kasperk81 <kasperk81 83082615+kasperk81@users.noreply.github.com> Co-authored-by: kasperk81 <kasperk81 kasperk81 83082615+kasperk81@users.noreply.github.com>
2022-09-29Delete malformed package.json used for tests, it confuses Component ↵Alexander Köplinger
Governance tooling (#76309)
2022-09-29Remove some extra static arrays used in Split() (#76003)Ilya
* Remove some extra static arrays used in Split * Remove const
2022-09-29Fix using DependencyGraphViewer with AOT compilers (#76357)Michal Strehovský
The `readonly` addition was one of the 3600 diffs in #74825. `MarkStrategy` can have mutable state that was getting lost because Roslyn considers it valid to put `_marker` into a temporary before calling instance methods on it. This resulted in DependencyGraphViewer hanging after seeing tens of thousands of new graphs being added.
2022-09-29Fix value type with static method fails to load (#76262)James S. Wang
* Allow static methods if checking type equivalence * Add test for loading value type with static method * Add test in which loading a value type with an instance method should throw a TypeLoadException
2022-09-29Generate single interface dispatch map per canonical form (#76362)Michal Strehovský
The dispatch maps are identical because canonically-equivalent types have the same vtable layouts.
2022-09-29Make KeysCollection.Contains methods public. (#76319)Eirik Tsarpalis
2022-09-29Bring back ReadOnlySpan in QuicStream (#76088)Ilya
2022-09-29Issue #75070 - Add PriorityQueue DequeueEnqueue Method (#75993)Ryan Thomas
* Issue #75070 - Add a DequeueEnqueue method to the System.Collections.Generic.PriorityQueue public api and unit test cases for the new method * Issue #75070 - Remove unnecessary PriorityQueue DequeueEnqueue property test case and update DequeueEnqueue test assertion and xunit attribute * Item #75070 - Revert the unnecessary name changes to the PriorityQueue.PropertyTests.cs test case method names
2022-09-29Reduce Enum.GetEnumName overheads (#76162)Stephen Toub
* Reduce Enum.GetEnumName overheads This also helps Enum.ToString(), Enum.IsDefined, etc. Many enums are composed of sequential values starting at 0 (half of all enums in corelib, for example, meet this criteria). Today when looking up a value, we search the array of values, but if an enum is known to have such sequential values, we can instead just index into the array at the appropriate location. * Address PR feedback