1. 08 6月, 2022 33 次提交
    • J
      Stop normalizing managed calls in R2R (#70339) · c6a4b620
      Jakob Botsch Nielsen 提交于
      We no longer need to interop with JIT64 so clean up this TODO. We are in
      fact already relying on the normalization done by the callee since we
      allow tailcalling that skips the inserted normalization in R2R.
      c6a4b620
    • T
      Add support for processing Unified TLS frames (#69848) · eea8673f
      Tomas Weinfurt 提交于
      * initial drop
      
      * cleanup
      eea8673f
    • I
      [wasm][debugger] Implement support for null-conditional operators in simple expressions (#69307) · 2c110b62
      Ilona Tomkowicz 提交于
      * Basic testcase.
      
      * Fixed non-null access to proxy-hidden members.
      
      * Fixing the issue and adding more tests.
      
      * Fixed a failing test: let CompileAndRunTheExpression throw.
      
      * Blocked failing tests on firefox.
      
      * Applied @radical's suggestions.
      
      * Reverted indexing to fix tests.
      
      * Reverted LastOrDefault instead of indexing + corrected names.
      
      * Changed to throw when root name empty.
      
      * Removing null suppression that does not change the evaluation result but fails without this change.
      
      * Applied @radical's comments.
      
      * Change exception on string property evaluation.
      
      * Added @radical's suggestions.
      Co-authored-by: NAnkit Jain <radical@gmail.com>
      2c110b62
    • S
      Implement Equals/GetHashCode for UnixDomainSocketEndPoint (#69722) · fc8ce9b3
      SRV 提交于
      * Added impl of Equals/GetHashCode for UnixDomainSocketEP
      
      * Fixed typo
      
      * Fixed missing underscore
      
      * Clarify new fields using comments
      
      * Review feedback
      
      * Review feedback
      
      * Added platform verification
      
      * Fixed sporadic test failure due to hashcode collision
      fc8ce9b3
    • D
      Disable 2 FSW tests failing only on macOS 12 (#70365) · 5678b79f
      Dan Moseley 提交于
      * Disable 2 osx fsw tests
      
      * Use ConditionalTheory
      Co-authored-by: NJozkee <dacantu@microsoft.com>
      5678b79f
    • A
      JIT: enable cloning based on loop invariant type tests (#70377) · 86efc101
      Andy Ayers 提交于
      Such as those added by GDV.
      
      The JIT will now clone just for type tests, or just for array bounds, or for
      a mixture of the two. The JIT will still produce just one fast and one slow loop.
      If there are a mixture of array bounds and type test conditions, all conditions
      must pass for control to reach the fast loop.
      
      Unlike array bounds checks, type test failures are not intrinsically rare,
      so there is some profitability screening to ensure that a failed type test does
      not force execution to run the slow version "too often". The type test must
      execute frequently within the loop, and be heavily biased towards success.
      
      This is work towards resolving #65206.
      86efc101
    • T
      [wasm] [debugger] Removing usage of serilog (#70382) · 12a6db44
      Thays Grazia 提交于
      * [wasm] [debugger] Adding serilog dlls
      
      Adding serilog dlls
      
      * Removing serilog usage for Blazor.
      12a6db44
    • A
      JIT: add ability to order blocks in dump by bbNum or bbID (#70399) · 655f414c
      Andy Ayers 提交于
      By default the JIT will dump blocks in bbNext order. This adds
      other ordering options, specified by `JitDumpFgBlockOrder`:
      * `0 (default) bbNext`
      * `1 bbNum`
      * `2 bbID`
      
      `bbID` in particular is useful when comparing JIT dumps where blocks
      have been reordered but the blocks themselves have similar content.
      655f414c
    • S
      Tweak NonBacktracking condition used to employ RegexFindOptimizations (#70405) · 77a8d88c
      Stephen Toub 提交于
      Rather than excluding all anchors, only exclude beginning anchors.
      77a8d88c
    • D
      0e1b3bba
    • J
      Remove named mutex workaround for Linux arm/arm64 (#70381) · 31cd7eb9
      Jan Vorlicek 提交于
      The workaround is no longer needed as the underlying issue in
      glibc was fixed in glibc 2.24 and the minimum glibc we now
      support is 2.27.
      31cd7eb9
    • A
      JIT: remove loop if `lpTop` becomes unreachable (#70324) · 7066ca90
      Andy Ayers 提交于
      We may be able to prune the backedge of a middle-entry loop (one where
      `lpEntry != lpTop`). Extend `optUpdateLoopsBeforeRemoveBlock` to handle
      this case.
      
      Fixes #69938.
      7066ca90
    • D
      Update dependencies from https://github.com/dotnet/hotreload-utils build 20220606.2 (#70345) · 9af8d302
      dotnet-maestro[bot] 提交于
      Microsoft.DotNet.HotReload.Utils.Generator.BuildTool
       From Version 1.1.0-alpha.0.22281.2 -> To Version 1.1.0-alpha.0.22306.2
      Co-authored-by: Ndotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
      9af8d302
    • A
      [wasm] Fix Wasm.Build.Tests test failures on windows (#70328) · 07ee2c7f
      Ankit Jain 提交于
      * [wasm] Workaround a python bug which can cause em* scripts to hang
      
      Issue - https://github.com/emscripten-core/emscripten/pull/15146
      
      Emscripten added a workaround enabled by setting
      the environment variable - `EM_WORKAROUND_PYTHON_BUG_34780`.
      
      * [wasm] Wasm.Build.Tests - use a local copy of `dotnet`
      
      .. to avoid conflicting with other instances on helix.
      
      * don't log output from robocopy
      07ee2c7f
    • W
      JIT: Remove unneeded unconditional jumps (#69041) · 11f24dd3
      Wraith 提交于
      * resolve merge conflict
      
      * add checks for post-call jmp removal
      
      * use emitIsLastInsCall() to preclude call,jmp pairs and simplfy emitRemoveJumpToNextInst
      check for aligned instruction groups and skip them to preserve alignment
      linearize emitRemoveJumpToNextInst, add safety asserts for ordering and comment the requirement, add debug output explaining decisions
      
      * address feedback
      
      * change instruction omit to use code size zero
      
      * address feedback
      
      * add assertion info dump
      
      * address feedback
      
      * address feedback
      
      * remove end loop cleanup. cleanup jitdump messages and add early out flag.
      
      * address feedback, formatting
      
      * update variable naming and clarify comments
      
      * more feedback
      
      * add last instruction check and group flag set in emitSavIG
      
      * more feedback
      
      * fix jitdump output and make removal candidate printing optional
      
      * remove emitDispJumpList parameter
      
      * change overall size calculation and allow 0 size align to be printed in dumps
      
      * fix invorrect jmp check, remove inline for emitInstHasNoCode
      
      * allow alignment printing even when zero
      
      * remove debug printf and fix x86
      
      * address feedback
      11f24dd3
    • J
      Clarity atomicity guarantees in ECMA-335 (#70384) · a0ffea86
      Jan Kotas 提交于
      a0ffea86
    • V
      Update shared code from linker (#70204) · 174c23e3
      Vitek Karas 提交于
      This brings in relatively recent version of the shared code from the dotnet/linker repo.
      Main changes:
      * ValueNode -> SingleValue - and the partial classes implementation for the values
      * Adapt MethodBodyScanner to the SingleValue/MultiValue
        * Includes some fixes around array handling and unknown values
      * Removal of ReflectionPatternContext
        * Partially replaced by DiagnosticContext
        * Partially removed (the checks that everything reports something are nto needed anymore)
      * Use HandleCallAction and RequireDynamicallyAccessedMembersAction - this replaces most of the functionality in ReflectionMethodBodyScanner.
      
      Formatting:
      The files which are shared exactly from linker are kept as is (so tabs and so on)
      The files which are AOT specific should follow the formatting of AOT projects
      
      Testing:
      Passes smoke tests and some additional validation done via linker tests which is not part of this change
      
      Note: This is not up-to-date with linker but it's getting us much closer. Known "TODOs":
      * CompilerGeneratedState - linker has a much newer and much more capable version. Port of that will come later (as it was in heavy development while I was doing this port, and it's not strictly necessary for current functionality)
      * Type hierarchy marking - this needs work on the linker side as it's not yet part of the shared codebase
      * Correctly handle RUC/RDC for all "reflection accesses" to methods - some of the change improve on this, but it's nowhere near where it needs to be. Future work item.
      174c23e3
    • M
      Keep members on Int128 and Half for testing (#70332) · 7532658e
      Michal Strehovský 提交于
      I was hitting a lot of obscure failures in #70201 that look like this:
      
      ```
        [FAIL] System.Tests.Int128Tests.Parse_Span_Valid(value: "170141183460469231731687303715884105727", offset: 0, count:
        1, style: Integer, provider: null, expected: 1)
        System.ArgumentException : Object of type 'System.Int32' cannot be converted to type 'System.Int128'.
           at System.InvokeUtils.CheckArgument(Object, EETypePtr, InvokeUtils.CheckArgumentSemantics, BinderBundle, InvokeUti
        ls.ArgSetupState&) + 0x1c0
           at System.InvokeUtils.DynamicInvokeParamHelperCore(InvokeUtils.ArgSetupState&, RuntimeTypeHandle, InvokeUtils.Dyna
        micInvokeParamLookupType&, Int32&, InvokeUtils.DynamicInvokeParamType) + 0x228
           at System.InvokeUtils.DynamicInvokeParamHelperIn(InvokeUtils.ArgSetupState&, RuntimeTypeHandle) + 0x1b
           at System.Runtime.Tests!<BaseAddress>+0xffe015
           at System.InvokeUtils.CallDynamicInvokeMethod(Object, IntPtr, IntPtr, IntPtr, Object, Object[], BinderBundle, Bool
        ean, Boolean) + 0x14d
           at Internal.Runtime.Augments.RuntimeAugments.CallDynamicInvokeMethod(Object, IntPtr, IntPtr, IntPtr, Object, Objec
        t[], BinderBundle, Boolean, Boolean) + 0x3e
           at Internal.Reflection.Execution.MethodInvokers.StaticMethodInvoker.Invoke(Object, Object[], BinderBundle, Boolean
        ) + 0x4e
           at Internal.Reflection.Core.Execution.MethodInvoker.Invoke(Object, Object[], Binder, BindingFlags, CultureInfo) +
        0x45
           at System.Reflection.Runtime.MethodInfos.RuntimeMethodInfo.Invoke(Object, BindingFlags, Binder, Object[], CultureI
        nfo) + 0x58
      ```
      
      This stack is showing a reflection invoke attempt by xunit (not by a test, but by xunit itself) to invoke a method taking Int128, but passing a boxed Int32 as an argument. The TestData is indeed doing that.
      
      I was getting myself ready to debug xunit but I thought that maybe xunit has a custom binder that calls the operator methods using reflection to do the conversions. Sure enough the RD.XML fixed it, so the problem was with operators getting trimmed away.
      7532658e
    • M
      Fix double to unlong conversions to handle NaN (#70331) · 88c118f8
      Michal Strehovský 提交于
      This was apparently fixed in 2016 on CoreCLR but no tests were added.
      
      The generic math tests are the first things that exercise this.
      
      Doesn't fail in the CI because this helper is likely not needed on ARM64 and we only test libs with NativeAOT on ARM64.
      
      Thought this was because of my local changes (because the CI was clean) but wasn't. Spent more time on this than I would be willing to admit.
      88c118f8
    • D
      [main] Update dependencies from dotnet/linker (#69710) · 17d6d50e
      dotnet-maestro[bot] 提交于
      * Update dependencies from https://github.com/dotnet/linker build 20220523.1
      
      Microsoft.NET.ILLink.Tasks
       From Version 7.0.100-1.22270.1 -> To Version 7.0.100-1.22273.1
      
      * Update dependencies from https://github.com/dotnet/linker build 20220524.1
      
      Microsoft.NET.ILLink.Tasks
       From Version 7.0.100-1.22270.1 -> To Version 7.0.100-1.22274.1
      
      * Update dependencies from https://github.com/dotnet/linker build 20220525.1
      
      Microsoft.NET.ILLink.Tasks
       From Version 7.0.100-1.22270.1 -> To Version 7.0.100-1.22275.1
      
      * Update dependencies from https://github.com/dotnet/linker build 20220530.1
      
      Microsoft.NET.ILLink.Tasks
       From Version 7.0.100-1.22270.1 -> To Version 7.0.100-1.22280.1
      
      * Update dependencies from https://github.com/dotnet/linker build 20220531.1
      
      Microsoft.NET.ILLink.Tasks
       From Version 7.0.100-1.22270.1 -> To Version 7.0.100-1.22281.1
      
      * Update dependencies from https://github.com/dotnet/linker build 20220601.1
      
      Microsoft.NET.ILLink.Tasks
       From Version 7.0.100-1.22270.1 -> To Version 7.0.100-1.22301.1
      
      * Update dependencies from https://github.com/dotnet/linker build 20220603.2
      
      Microsoft.NET.ILLink.Tasks
       From Version 7.0.100-1.22270.1 -> To Version 7.0.100-1.22303.2
      
      * Update dependencies from https://github.com/dotnet/linker build 20220606.1
      
      Microsoft.NET.ILLink.Tasks
       From Version 7.0.100-1.22281.1 -> To Version 7.0.100-1.22306.1
      Co-authored-by: Ndotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
      Co-authored-by: NVitek Karas <10670590+vitek-karas@users.noreply.github.com>
      17d6d50e
    • E
      Fix race condition in WASM crypto worker (#70185) · 8d34e0a0
      Eric Erhardt 提交于
      When sending a message between LibraryChannel and ChannelWorker, there is a race condition where both threads are reading/writing to shared memory at the same time. This can cause message pages to be skipped.
      
      To fix this, add a shared mutex lock so only one side is reading/writing to shared memory at the same time.
      
      Fix #69806
      8d34e0a0
    • A
      Fix unwind info when fake-splitting; add job to runtime-jit-experimental (#69922) · 08b31707
      Aman Khalid 提交于
      Fake-splitting currently breaks stack walks by not generating unwind
      info for cold code. This commit implements unwind info on x86/64 when
      fake-splitting by generating unwind info for the combined hot/cold
      section just once, rather than generating unwind info for the separate
      sections.
      
      For reasons to be investigated, this implementation does not work when
      the code sections are separated by an arbitrary buffer (such as the 4KB
      buffer previously used). Thus, the buffer has been removed from the
      fake-splitting implementation: Now, the hot and cold sections are
      placed contiguously in memory, but the JIT continues to behave as if
      they are arbitrarily far away (for example, by using long branches
      between sections).
      
      Following this fix, fake-splitting no longer requires the GC to be
      suppressed by setting `COMPlus_GCgen0size=1000000`. A test job
      has been added to `runtime-jit-experimental` to ensure
      fake/stress-splitting does not regress.
      08b31707
    • S
      Use u8 in more places (#69995) · 0c4ee9e7
      Stephen Toub 提交于
      * Use u8 in more places
      
      Primarily replacing Encoding.UTF8/ASCII.GetBytes("literal") with "literal"u8.ToArray()
      
      * Address PR feedback (and fix some vars)
      0c4ee9e7
    • J
      9f654ce1
    • M
      Fix trimmability of various System.Runtime tests (#70329) · c27d571a
      Michal Strehovský 提交于
      The reflection patterns couldn't be statically analyzed.
      
      Needed to unblock #70201. NativeAOT trims by default and CoreLib is marked trimmable.
      c27d571a
    • S
      Delete a few dependencies on field sequences (#69991) · 6a3368b5
      SingleAccretion 提交于
      * Remove field seqs from "gtGetStructHandleIfPresent"
      
      * Ensure block morphing preserves handles
      
      Or, rather, restores them better in case they were lost from FIELD nodes.
      
      * Delete two dependencies on FieldSeq from morph
      
      Two small positive diffs where the following tree:
      
      IND bool
        ADDR [FieldSeq]
           LCL_VAR bool
      
      Is now folded into LCL_VAR instead of LCL_FLD.
      6a3368b5
    • S
      Optimization for "~x + 1" to "-x" (#69003) (#69600) · 8b894eaa
      Sychev Vadim 提交于
      8b894eaa
    • S
      Delete `GT_INDEX` (#69917) · 7bccc676
      SingleAccretion 提交于
      * Do not set NO_CSE on ARR_ADDRs
      
      It is effectively no-CSE already because of how "optIsCSECandidate" works.
      
      * Delete GT_INDEX
      
      Instead:
       1) For "ldelem", import "IND/OBJ(INDEX_ADDR)".
       2) For "ldelema", import "INDEX_ADDR".
      
      This deletes two usages of "ADDR":
       1) "OBJ(ADDR(INDEX))" from "ldelem<struct>".
       2) "ADDR(INDEX)" from "ldelema".
      
      * Add a zero-diff quirk
      
      * Update the first class structs document
      
      Remove references to things that no longer exist.
      7bccc676
    • T
      Re-enable the pause intrinsic test for x86/x64 CoreCLR (#70230) · 7439a889
      Tanner Gooding 提交于
      * Re-enable the pause intrinsic test for x86/x64 CoreCLR
      
      * Ensure we don't skip base intrinsics when only SSE/SSE2 are disabled
      
      * Ensure InstructionSet_Vector64/128/256 are handled correctly in lookupId
      7439a889
    • T
      Mop-up changes per Jakob's PR suggestions (#70180) · 86a59cd7
      Tomáš Rylek 提交于
      1) Rename CORINFO_HELP_STATIC_VIRTUAL_AMBIGUOUS_RESOLUTION to
      CORINFO_HELP_THROW_AMBIGUOUS_RESOLUTION_EXCEPTION and put it next
      to the other CORINFO_HELP_THROW methods;
      
      2) Add the new helper to CorInfoHelpFunc.cs;
      
      3) Remove the jitinterface member doesFieldBelongToClass;
      
      4) Update the JIT EE GUID.
      
      Thanks
      
      Tomas
      
      Fixes: #69900
      86a59cd7
    • T
      Update testing-android.md (#70362) · fd0a8e4b
      Thays Grazia 提交于
      fd0a8e4b
    • S
      DebuggerDisplay Stopwatch (#65753) · 625b8cea
      Sergei Papikian 提交于
      * feat: add DebuggerDisplay method and attribute
      
      * refactor: remove 'this'
      
      * Test
      
      * Fix test
      Co-authored-by: NDan Moseley <danmose@microsoft.com>
      625b8cea
    • J
  2. 07 6月, 2022 7 次提交
    • T
      Fix TZ Tests (#70309) · af2810b1
      Tarek Mahmoud Sayed 提交于
      af2810b1
    • K
      Fix some scaling issues with the global queue in the thread pool (#69386) · deb4044f
      Koundinya Veluri 提交于
      * Fix some scaling issues with the global queue in the thread pool
      
      - The global concurrent queue is not scaling well in some situations on machines with a large number of processors. A lot of contention is seen in dequeuing work on some benchmarks.
      - I initially tried switching to queuing work from thread pool threads more independently with more efficient work stealing, but it looks like that may need more investigation/experimentation. This is a simpler change that seems to work reasonably well for now.
      - Beyond 32 procs, added additional concurrent queues, one per 16 procs. When a worker thread begins dispatching work, it assigns one of those additional queues to itself, trying to limit assignments to 16 worker threads per queue.
      - Work items queued by a worker thread queues to the assigned queue. The worker thread dequeues from the assigned queue first, and later tries to dequeue from other queues. Work items queued by non-thread-pool threads continue to go into the global queue.
      - When a worker thread stops dispatching work items, it unassigns itself from the queue, and may transfer work items from it if it was the last thread assigned to the queue.
      - In the observed cases, work items are distributed to the different queues and contention is reduced due to a limited number of threads operating on each queue
      deb4044f
    • O
      NonBacktracking inner matching loop optimizations (#70217) · da79dc61
      Olli Saarikivi 提交于
      * Inner matching loop optimizations
      
      * Cleanup and comments
      
      * Fix and generalize FixedLength handling in matcher
      
      * Fix FixedLength support again
      
      * Suggestions from code review
      
      * Change _stateInfo type to byte
      da79dc61
    • B
      handle SECURITY_STATUS 0x80090016 (#69942) · 0712aebe
      Badre BSAILA 提交于
      * handle SECURITY_STATUS 0x80090016
      
      * adjust dictionary size
      
      * capital set
      0712aebe
    • J
      JIT ARM32: Fix passing odd sized structs from arbitrary sources (#70075) · 0971e5e2
      Jakob Botsch Nielsen 提交于
      * JIT ARM32: Fix odd sized structs from arbitrary sources
      
      ARM32 ABI allows passing structs in register even when their sizes are
      not divisible by 4. This means we sometimes need to pass 3 bytes in the
      last register. The JIT would not handle this when the source was an
      arbitrary memory location (this would require multiple loads and
      shifts). The fix is to just force a copy into the local stack frame for
      this case.
      
      Fix #61168
      
      * Reenable ABI tests
      
      Fix #68837
      Fix #70042
      0971e5e2
    • A
      JIT: broaden cloning invariant checks (#70232) · bab1a1f2
      Andy Ayers 提交于
      Streamline call effects checks. Use wider bit vectors.
      
      Closes #70100.
      bab1a1f2
    • S
      Fold more "OBJ(ADDR(LCL))" patterns in multi-reg morphing (#70207) · eef6c7f6
      SingleAccretion 提交于
      It is unfortunate that we have to expand this code, but it
      will avoid diffs for a TYP_STRUCT LCL_FLD change.
      eef6c7f6