1. 12 8月, 2023 27 次提交
    • J
      JIT: Prevent generic context runaway during inlining of polymorphic recursive methods (#90306) · 6c38f2ce
      Jakob Botsch Nielsen 提交于
      The inliner heuristics do not take into account that inlining methods
      causes type/method loading of the generic context. After #88749 this can
      quickly cause significant resources to be consumed as part of inlining
      when polymorphic recursion is involved (the blow-up can be exponential,
      as we see in the failing test under jitstress).
      
      This PR adds another safe-guard to the recursive inlining check in terms
      of a complexity limit on the generic context of the inline candidate.
      
      Fix #90144
      6c38f2ce
    • S
      Remove all use of <Nullable>annotations</Nullable> (#90401) · 616f7581
      Stephen Toub 提交于
      * Remove all use of <Nullable>annotations</Nullable>
      
      We've inadvertently shipped multiple libraries with incorrect nullable reference type annotations because:
      a) Their ref assemblies aren't actually being shipped, and/or
      b) Their src projects using `<Nullable>annotations</Nullable>`
      
      `<Nullable>annotations</Nullable>` means "I'm nullable annotated but don't validate them", which means consumers of these libraries see annotations that we haven't thoughtfully added or reviewed.
      
      This removes all use of it and gets us back to a place where we're only shipping nullable annotations for libraries where we've done the work to ensure they're correct.  We can subsequently finish annotating these stragglers.
      
      * Don't disable LibraryImportGenerator when nullable is disabled
      
      * Add #nullable enable to LibraryImportAttribute file for polyfill scenarios.
      
      * Disable LibraryImportGenerator on ILCompiler.TypeSystem.Tests assemblies.
      Convert a DllImport in HostWriter that now gets the polyfill experience.
      
      ---------
      Co-authored-by: NEric StJohn <ericstj@microsoft.com>
      Co-authored-by: NJeremy Koritzinsky <jekoritz@microsoft.com>
      616f7581
    • E
      Add DiagnosticDescriptorHelper to set HelpURI for generator / analyzer diagnostics (#90353) · 7325cc4c
      Eric StJohn 提交于
      * Add DiagnosticDescriptorHelper
      
      Create a helper method that formats and sets the helpLink for
      DiagnosticDescriptors
      
      * Add HelpLinkUris to ILLink
      
      * Handle different DiagnosticCategories
      7325cc4c
    • S
      [workloads] Add telemetry for mobile and wasm workloads (#90208) · b02e5e15
      Steve Pfister 提交于
      This change adds CLI telemetry for common mobile and wasm scenarios.
      
      Total app size is another element we plan on tracking and that will be added in a follow up.
      
      Fixes https://github.com/dotnet/runtime/issues/88844
      b02e5e15
    • J
      Update Versions.props (#90425) · 39c0dbf5
      Jackson Schuster 提交于
      39c0dbf5
    • J
      Prefix type names with global and use static TypeSyntax and NameSyntax instead... · 05dfb7ed
      Jackson Schuster 提交于
      Prefix type names with global and use static TypeSyntax and NameSyntax instead of Parse(Type)Name (#90339)
      
      * Prefix type names with global and use static TypeSyntax and NameSyntax instead of Parse(Type)Name
      05dfb7ed
    • T
    • A
      [wasm] Fix builds for blazor app + InvariantGlobalization=true (#90432) · 685b593d
      Ankit Jain 提交于
      The following commit caused workload to be required for a blazor app
      when `InvariantGlobalization==true`, but this is not required.
      
      ```
      commit 26ae0978
      Author: Ankit Jain <radical@gmail.com>
      Date:   Thu Aug 10 23:39:10 2023 -0400
      
          [wasm] Fix up conditions to trigger relink, and require `wasm-tools` workload (#89754)
      ```
      
      And this broke some sdk tests.
      685b593d
    • J
      Allow reference types for pinned GC.AllocateArray() (#89293) · b22aa172
      jthorborg 提交于
      * Relaxing constraints of System.GC.AllocateArray<T>.
      
      It's now possible to allocate pinned and default-initialized arrays that contain references.
      
      Fix #48703
      
      * Adding coverage of GC.AllocateArray with ref types.
      
      Added a test that pins a reference type array and resolves references to indices with pointer arithmetic, checking that modifications are visible back in the original array.
      
      Test #48703
      
      * Mono/NativeAOT relaxing of System.GC.AllocateArray<T>.
      
      * Relaxed GC.AllocateUninitializedArray for ref types as well.
      
      This was done by deferring reference types to GC.AllocateArray to avoid potential memory issues with the GC + uninitialized memory. The API only promises to avoid initialization if possible, anyway.
      Refactored tests to parametrically exercise these new relaxed constraints.
      
      * Simplifiy conditionals in AllocateUninitializedArray.
      
      Relying on internal implementation zeroing refs if necessary.
      
      * Also simplify path for NativeOAT.
      
      Mono already piggybacks on the AllocateArray path anyway.
      
      * Simplify pinning paths.
      
      All conditional paths in GC.Allocate*Array now handle pinning unconditionally out of the main branch.
      
      * Don't use `var` if type name doesn't exist explicitly on right-hand side
      
      * PR feedback for using terse method tables and JIT intrinsics for GC array allocation that should be slightly faster.
      
      * Changed EmbeddedValueType and added comment.
      
      After a longer discussion, settled on a slightly augmented suggestion that isn't as controversial as the prior one.
      
      * Fixing signature for `RhAllocateNewArray` in NativeAOT to directly use a `MethodTable*`
      
      * Adding explicit structlayout to silence warning for EmbeddedValueType in GCTests, and improved the comment.
      
      ---------
      Co-authored-by: NJan Kotas <jkotas@microsoft.com>
      b22aa172
    • K
      Fix session-local named mutex compat issue (#90342) · 1c4e4c11
      Koundinya Veluri 提交于
      - A previous change that was serviced back changed session-local named mutexes to be user-specific by restricting the permissions of the session directories and files under them, and adding the sticky bit to some directoires. A compat issue arose from that change, as the session directories have the session ID in their name and session IDs can be reused between different users. The current plan that we have discussed is to revert the change and service back the revert, which also restores the intended behavior, and offer user-specific mutexes as a new feature in a future .NET that would satisfy some user scenarios in a better way.
      - This PR reverts the previous change (first commit) and restores one change from the previous change (second commit) to improve backward compatibility due to differences in permissions for session directories before and after the change
      - Fixes https://github.com/dotnet/runtime/issues/80619
      1c4e4c11
    • P
      Using stackalloc instead of new byte[x] on Streams (#88303) · d87964d7
      Poppyto 提交于
      * first XOR Linq implemetation
      
      * replace classic allocation by stack allocation for ReadByte
      
      * replace classic allocation by stack allocation for ReadByte & WriteByte
      
      * replace classic allocation by stack allocation for ReadByte/CopyToAsync
      
      * add missing ConfigureAwait(false) on ReadAsync
      
      * replace classic allocation by stack allocation for ReadByte/WriteByte
      
      * Revert "first XOR Linq implemetation"
      
      This reverts commit 449fddec66b3311866dc1e57c07ad7127e8039ff.
      
      * indent fix
      
      * rollback stackalloc on async methods
      
      * missing char
      
      * fix ConfigureAwait
      
      * rollback ReadByte optim (degrade perfs)
      
      * variablename fix
      
      * missing comment
      
      * rollback Stream allocations
      
      * missing arguments
      
      * add Write(ReadOnlySpan<byte>) method
      
      * better initialize Span
      
      * add CRLF
      
      * resolve comments
      
      * simplification call method Write
      
      * Update src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/Json/JsonEncodingStreamWrapper.cs
      
      replace Span by ReadOnlySpan
      Co-authored-by: NMichał Petryka <35800402+MichalPetryka@users.noreply.github.com>
      
      * remove trailing whitespace
      
      * Update src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/Json/JsonEncodingStreamWrapper.cs
      Co-authored-by: NStephen Toub <stoub@microsoft.com>
      
      * Update src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/Json/JsonEncodingStreamWrapper.cs
      Co-authored-by: NStephen Toub <stoub@microsoft.com>
      
      ---------
      Co-authored-by: NMichał Petryka <35800402+MichalPetryka@users.noreply.github.com>
      Co-authored-by: NStephen Toub <stoub@microsoft.com>
      d87964d7
    • D
      Reduce contention for Datacontract Serialization (#73893) · 21f3bbef
      Daniel Svensson 提交于
      * Use ConcurrentDictionary to avoid lock contention when serializing using DataContractSerializer
      
      * Improve concurrency for GetId
      
      * Prevent allocating multiple slots in s_dataContractCache for the same typeHandle
      
      * Use RuntimeTypeHandle as key in dictionary
      
      * add readonly
      
      * Remove usage of lazy
      
      * revert whitespace changes
      
      * Use RuntimeTypeHandle.Value as key instead of RuntimeTypeHandle
      
      * Apply same perf improvement to JDCS; Remove Int/TypeHandleRef silliness that we no longer need.
      
      ---------
      Co-authored-by: NSteve Molloy <smolloy@microsoft.com>
      21f3bbef
    • E
      Improve System.Text.Json configuration list debugging (#90411) · 2d9acc6f
      Eirik Tsarpalis 提交于
      * Improve debugging for configuration lists.
      
      * Add missing DebuggerBrowsable.Never annotations.
      
      * Add DebuggerBrowsableState.Never to a few internal getters that may throw.
      
      * Simplify JsonPropertyInfo DebuggerDisplay
      
      * Ensure debugger display matches API name.
      2d9acc6f
    • A
      Enable Automatic Reference Counting (ARC) for Objective-C code that needs it (#90379) · 20f4ff43
      Alexander Köplinger 提交于
      We noticed that ARC isn't enabled for System.Globalization.Native code but we aren't properly doing manual memory management by calling `release`.
      
      Enable ARC for the System.Globalization.Native ObjC code so it is handled automatically by the compiler.
      Disable it for System.Native code since that one is less complex and we can manually manage it.
      
      We need to wrap all public entrypoints to the library in `@autoreleasepool` blocks so that the releasing of autoreleased objects occurs at the end of the block, rather than at some undetermined point in the future (and we don't even know if we have an autorelease pool in the thread).
      20f4ff43
    • M
      [ios][tests] Run functional tests with Mono and Native AOT on Helix (#87773) · 55828b9a
      Milos Kotlar 提交于
      This PR adds support for Native AOT compilation on Helix. It improves test coverage for Mono and Native AOT by running functional tests on Helix. The proxy project is updated with Native AOT props and apple build targets are updated to support Native AOT compilation. Additionally, it simplifies the sample app by utilizing the shared Apple targets.
      55828b9a
    • A
      Revert "Update perf run yaml with changes for crank on helix (#90368)" (#90424) · 0916f7ba
      Ankit Jain 提交于
      This reverts commit bbe40f8c.
      
      This caused perf pipeline runs to break. But https://github.com/dotnet/performance/pull/3251 from @caaavik-msft, along with this revert will fix the issue.
      
      Issue: https://github.com/dotnet/runtime/issues/90420
      0916f7ba
    • E
      Use generated version files when printing/tracing host version info (#90273) · 77624c1c
      Elinor Fung 提交于
      - Use `VER_PRODUCTVERSION_STR` / `sccsid` from generated `_version.(h|c)` for version and commit info (for tracing)
      - Use `RuntimeProductVersion` for version from header generated by `GenerateRuntimeVersionFile`
      - Remove `HOST_*_PKG_VER` defines and script arguments for passing that info around
      77624c1c
    • S
      Don't fallback to PNSE, and give a more descriptive error message. (#88804) · d836fd3f
      Steve Molloy 提交于
      * Don't fallback to PNSE, and give a more descriptive error message.
      
      * CodeGeneratorConversionException is internal. Wrap it before re-throwing.
      
      * Update src/libraries/System.Private.Xml/src/System/Xml/Serialization/Compilation.cs
      
      Fixing comment about lack of compiler at runtime
      Co-authored-by: NJan Kotas <jkotas@microsoft.com>
      
      * Update Compilation.cs
      
      Remove conditional code that was not needed.
      
      ---------
      Co-authored-by: NMatt Connew <mconnew@users.noreply.github.com>
      Co-authored-by: NJan Kotas <jkotas@microsoft.com>
      d836fd3f
    • P
    • P
      df26db30
    • J
      Disable LLVM AOT ARM64 lane (#90413) · 26c7d40e
      Jo Shields 提交于
      26c7d40e
    • V
      [mono] Enabled tests failing previously on fullaot (#90280) · 4c2f1b63
      Vlad-Alexandru Ionescu 提交于
      * Enabled tests
      
      ---------
      Signed-off-by: NVlad <vladionescu1399@gmail.com>
      Co-authored-by: NMilos Kotlar <kotlarmilos@gmail.com>
      4c2f1b63
    • S
      Delete duplicative fallback paths from Ascii (#90390) · 98d3ea49
      Stephen Toub 提交于
      * Delete duplicative fallback paths from Ascii
      
      GetIndexOfFirstNonAsciiChar has four different paths it takes: one for Vector512/256, one for Ssse2/AdvSimd, one for Vector128, and one for everything else. But the Vector512/256 path is capable of both Vector128 and scalar, which obsoletes the default fallback case which uses `Vector<T>` and a scalar path.  We can entirely delete the "_Default" path, and consolidate the calls to the Vector512/256/128/scalar path.
      
      GetIndexOfFirstNonAsciiByte is similar.  Its "_Default" doesn't use `Vector<T>`, but it's still duplicative and deletable.
      
      * Address PR feedback
      98d3ea49
    • M
      Fix Vector512 rightshift (#89339) · 61120283
      Michał Petryka 提交于
      * Fix Vector512 rightshift
      
      Fixes #89338
      
      * Adding tests covering the Vector shift operators
      
      * Ensure Unsafe.Read/Write are marked intrinsic
      
      * Workaround a separate bug on Arm64
      
      * Mark the new vector shift tests with ActiveIssue where relevant
      
      ---------
      Co-authored-by: NTanner Gooding <tagoo@outlook.com>
      61120283
    • S
      Replace Utf16Utility.GetPointerToFirstInvalidChar fallback with Vector128 (#90391) · 2d6421b7
      Stephen Toub 提交于
      * Replace Utf16Utility.GetPointerToFirstInvalidChar fallback with Vector128
      
      The else block will only be used on platforms where `Vector<T>` is 128-bit, so just use Vector128 explicitly.
      
      * Address PR feedback
      2d6421b7
    • B
      Support breakpoints on AVX-512 instructions (#89705) · 08f0dc8e
      Bruce Forstall 提交于
      * Update debugger AMD64 disassembly tables
      
      Regenerate with gdb 12. Fix various bugs in the table generation,
      such as due to incorrect ModRM/reg escape handling, and new instructions.
      
      * Remove 3DNow! table support
      
      * Remove obsolete AMD XOP encoding support
      
      * Update walker for new tables
      
      Especially, removed 3DNow, XOP.
      
      Also, update README.md
      
      * Remove special-case XOP instructions
      
      * Remove unused InstrForm
      
      Due to removing XOP instructions
      
      * Remove another removed InstrForm
      
      * Support EVEX encoding
      
      * Add more logging for patch decode; handle 64-byte memory in patch
      
      * Support EVEX embedded broadcast
      
      * Update comment about EVEX `disp8*N` addressing
      
      * Fix build
      08f0dc8e
    • E
      0dfe81a8
  2. 11 8月, 2023 13 次提交