Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: dotnet/runtime
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 338db1a1ba498f308797ce7a54c0ed54e7286d50
Choose a base ref
...
head repository: dotnet/runtime
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: ffcb0149763663a55a79784be216afe81f6bf76c
Choose a head ref
  • 19 commits
  • 155 files changed
  • 19 contributors

Commits on Jul 5, 2022

  1. Polyfill the incremental generator ForAttributeWithMetadataName from …

    …roslyn. (#70911)
    
    * Add the initial roslyn files
    
    * IN progress
    
    * Builds
    
    * Use api
    
    * ifdef
    
    * Move using outside namespace
    
    * Move to debug assert
    
    * Optimize common cases
    
    * Explain if'defed regions
    
    * Explain if'defed regions
    
    * Update System.Text.RegularExpressions.Generator.csproj
    
    * Port latest changes over
    
    * Renames
    
    * Update src/libraries/Common/src/Roslyn/CSharpSyntaxHelper.cs
    
    * Simplify
    
    * Dispose builders
    
    * Dispose builders
    
    * Simplify by removing support for nested attributes
    
    * Simplify
    CyrusNajmabadi authored Jul 5, 2022
    Configuration menu
    Copy the full SHA
    d4ac721 View commit details
    Browse the repository at this point in the history
  2. [wasm][debugger]Fix debugging when it's using a external library with…

    …out debug information (#71560)
    
    * Fix debugging when it's using a external library without debug information.
    
    * [wasm] Rationalize TypeInfo construction
    
    * separating dynamic assemblies
    
    * lazy-debugger-test-embedded should only be available to the tests on disk, but *not* the test app
    
    * debugger-test.csproj: cleanup
    
    * Fix metadata name for not only building project references
    
    * Fixing not getting codeview information from assemblies that don't have this information.
    
    * Adressing @radical comments.
    
    Co-authored-by: Ankit Jain <radical@gmail.com>
    thaystg and radical authored Jul 5, 2022
    Configuration menu
    Copy the full SHA
    2c840ab View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    5384c95 View commit details
    Browse the repository at this point in the history
  4. Refactoring IShiftOperators to take a TOther (#71405)

    * Refactoring IShiftOperators to take a `TOther`
    
    * Break IShiftOperators typeloading cycle
    
    Co-authored-by: Jan Kotas <jkotas@microsoft.com>
    tannergooding and jkotas authored Jul 5, 2022
    Configuration menu
    Copy the full SHA
    6b0d373 View commit details
    Browse the repository at this point in the history
  5. Release global lock before throwing exceptions from the Unix WaitSyst…

    …em (#71626)
    
    The exception throwing and handling can enter wait system recursively that will lead to deadlock.
    
    Fixes #70010
    jkotas authored Jul 5, 2022
    Configuration menu
    Copy the full SHA
    a4f2109 View commit details
    Browse the repository at this point in the history
  6. Blazor Hybrid iOS & Mac Catalyst Performance Profiling (#68685)

    * [MAUI][Blazor][PERF] Add APK file usage for Android Maui Blazor SOD
    
    * Update android_scenarios.proj
    
    * Call ReportFullyDrawn
    
    * Add  --use-fully-drawn-time --fully-drawn-extra-delay
    
    * Add System.Console.WriteLine for non-android platforms
    
    * Add 6 second delay
    
    * Missing `;`
    
    * Add back Directory.Build.{props, targets}
    
    (cherry picked from commit 28d9ef3ab4ac53b947dd435e6494428238b4dea5)
    
    * Fixes based on CI 1729796
    
    https://dev.azure.com/dnceng/internal/_build/results?buildId=1729796&view=logs&j=4d93e3ae-0b8e-5532-bed2-af5c8a7c58d3&t=b13dec14-3eb2-5f1a-4501-8a9fdadb0e3a
    (cherry picked from commit d470655576d3abe6a6fec478c221c4d9de698ba9)
    
    * [REVERT THIS] Temporarily skip other jobs
    
    (cherry picked from commit df51582df9e7bb9d1ca82759d664823c76823c29)
    
    * [MAUI][Blazor][PERF] Add IPA file usage for iOS/MacCatalyst Maui Blazor SOD
    
    (cherry picked from commit b1aaaf2)
    
    * Remove / restore nuget.config
    
    * Escape quotes
    
    * Fix typo
    
    * Replicate changes from #67670
    
    * use-fully-drawn-time
    
    * Use akoeplinger/performance
    
    * Fix misplaced quote character
    
    * Revert "Use akoeplinger/performance"
    
    This reverts commit 12358b6.
    
    The change was merged to dotnet/performance.
    
    * Add ` --startup-iterations 7`
    
    * Revert "[REVERT THIS] Temporarily skip other jobs"
    
    This reverts commit 54fa30d.
    
    * Remove SOD Startup Iterations
    
    Co-authored-by: Alexander Köplinger <alex.koeplinger@outlook.com>
    TanayParikh and akoeplinger authored Jul 5, 2022
    Configuration menu
    Copy the full SHA
    05c4467 View commit details
    Browse the repository at this point in the history
  7. [mono][aot] Avoid inflating methods with instantiations with a wrong …

    …argument count when using profiled AOT. (#70926)
    
    Fixes #70773.
    vargaz authored Jul 5, 2022
    Configuration menu
    Copy the full SHA
    66aaeb0 View commit details
    Browse the repository at this point in the history
  8. [mono][wasm] Add a minimal version of gsharedvt for llvmonly, enabled… (

    #70867)
    
    * [mono][wasm] Add a minimal version of gsharedvt for llvmonly, enabled by default.
    
    In this version, variable length arguments/locals are not supported. This means
    that these compiled methods don't have the overhead of gsharedvt, i.e. wrappers,
    dynamically allocated/copied locals, etc. They have similar performance to normal
    generic sharing.
    
    This can handle methods like List<T>.get_Item (), System.GC:AllocateArray<T>, etc.
    
    * Fix gsharedvt returns on wasm.
    
    * Allow byref gsharedvt types in gsharedvt in/out wrappers.
    
    * Avoid setting both ctx->values and ctx->addresses for arguments of type LLVMArgGsharedvtFixedVtype.
    
    * Fix support for gsharedvt+deopt.
    
    * Disable UNBOX_ANY in gsharedvt_min mode.
    
    * Fix llvmonly support for static methods with bound NULL first argument.
    
    Some code paths can end up calling the general delegate invoke wrapper, which used
    target!=NULL to decide whenever the call is bound, but the bound argument can be NULL.
    So add a 'bound' field to Delegate and check it in the wrapper.
    
    Some code paths might not set 'bound' so retain the target!=NULL check as well.
    vargaz authored Jul 5, 2022
    Configuration menu
    Copy the full SHA
    bcbe87d View commit details
    Browse the repository at this point in the history
  9. Exposing static bool IsSupported { get; } on Vector<T> and Vector64/1…

    …28/256<T> (#71240)
    
    * Exposing static bool IsSupported { get; } on Vector<T> and Vector64/128/256<T>
    
    * Adding tests covering the new IsSupported API on Vector<T> and Vector64/128/256<T>
    
    * Fix Mono JIT
    
    * Fix warning on windows
    
    * Let Vector64/128/256 IsSupported be handled by the fallback software implementation.
    
    Co-authored-by: Fan Yang <yangfan@microsoft.com>
    tannergooding and fanyang-mono authored Jul 5, 2022
    Configuration menu
    Copy the full SHA
    dfbc648 View commit details
    Browse the repository at this point in the history
  10. Optimize multi-dimensional array access (#70271)

    Currently, multi-dimensional (MD) array access operations are treated as opaque to most of
    the JIT; they pass through the optimization pipeline untouched. Lowering expands the `GT_ARR_ELEM`
    node (representing a `a[i,j]` operation, for example) to `GT_ARR_OFFSET` and `GT_ARR_INDEX` trees,
    to expand the register requirements of the operation. These are then directly used to generate code.
    
    This change moves the expansion of `GT_ARR_ELEM` to a new pass that follows loop optimization but precedes
    Value Numbering, CSE, and the rest of the optimizer. This placement allows for future improvement to
    loop cloning to support cloning loops with MD references, but allows the optimizer to kick in on the new
    expansion. One nice feature of this change: there is no machine-dependent code required; all the nodes
    get lowered to machine-independent nodes before code generation.
    
    The MDBenchI and MDBenchF micro-benchmarks (very targeted to this work) improve about 10% to 60%, but there is
    one significant CQ regression in MDMulMatrix of over 20%. Future loop cloning, CSE, and/or LSRA work will be needed to get that back.
    
    In this change, `GT_ARR_ELEM` nodes are morphed to appropriate trees. Note that an MD array `Get`, `Set`, or `Address`
    operation is imported as a call, and, if all required conditions are satisfied, is treated as an intrinsic
    and replaced by IR nodes, especially `GT_ARR_ELEM` nodes, in `impArrayAccessIntrinsic()`.
    
    For example, a simple 2-dimensional array access like `a[i,j]` looks like:
    
    ```
    \--*  ARR_ELEM[,] byref
       +--*  LCL_VAR   ref    V00 arg0
       +--*  LCL_VAR   int    V01 arg1
       \--*  LCL_VAR   int    V02 arg2
    ```
    
    This is replaced by:
    
    ```
    &a + offset + elemSize * ((i - a.GetLowerBound(0)) * a.GetLength(1) + (j - a.GetLowerBound(1)))
    ```
    
    plus the appropriate `i` and `j` bounds checks.
    
    In IR, this is:
    
    ```
    *  ADD       byref
    +--*  ADD       long
    |  +--*  MUL       long
    |  |  +--*  CAST      long <- uint
    |  |  |  \--*  ADD       int
    |  |  |     +--*  MUL       int
    |  |  |     |  +--*  COMMA     int
    |  |  |     |  |  +--*  ASG       int
    |  |  |     |  |  |  +--*  LCL_VAR   int    V04 tmp1
    |  |  |     |  |  |  \--*  SUB       int
    |  |  |     |  |  |     +--*  LCL_VAR   int    V01 arg1
    |  |  |     |  |  |     \--*  MDARR_LOWER_BOUND int    (0)
    |  |  |     |  |  |        \--*  LCL_VAR   ref    V00 arg0
    |  |  |     |  |  \--*  COMMA     int
    |  |  |     |  |     +--*  BOUNDS_CHECK_Rng void
    |  |  |     |  |     |  +--*  LCL_VAR   int    V04 tmp1
    |  |  |     |  |     |  \--*  MDARR_LENGTH int    (0)
    |  |  |     |  |     |     \--*  LCL_VAR   ref    V00 arg0
    |  |  |     |  |     \--*  LCL_VAR   int    V04 tmp1
    |  |  |     |  \--*  MDARR_LENGTH int    (1)
    |  |  |     |     \--*  LCL_VAR   ref    V00 arg0
    |  |  |     \--*  COMMA     int
    |  |  |        +--*  ASG       int
    |  |  |        |  +--*  LCL_VAR   int    V05 tmp2
    |  |  |        |  \--*  SUB       int
    |  |  |        |     +--*  LCL_VAR   int    V02 arg2
    |  |  |        |     \--*  MDARR_LOWER_BOUND int    (1)
    |  |  |        |        \--*  LCL_VAR   ref    V00 arg0
    |  |  |        \--*  COMMA     int
    |  |  |           +--*  BOUNDS_CHECK_Rng void
    |  |  |           |  +--*  LCL_VAR   int    V05 tmp2
    |  |  |           |  \--*  MDARR_LENGTH int    (1)
    |  |  |           |     \--*  LCL_VAR   ref    V00 arg0
    |  |  |           \--*  LCL_VAR   int    V05 tmp2
    |  |  \--*  CNS_INT   long   4
    |  \--*  CNS_INT   long   32
    \--*  LCL_VAR   ref    V00 arg0
    ```
    
    before being morphed by the usual morph transformations.
    
    Some things to consider:
    1. MD arrays have both a lower bound and length for each dimension (even if very few MD arrays actually have a
       non-zero lower bound)
    2. The new `GT_MDARR_LOWER_BOUND(dim)` node represents the lower-bound value for a particular array dimension. The "effective index" for a dimension is the index minus the lower bound.
    3. The new `GT_MDARR_LENGTH(dim)` node represents the length value (number of elements in a dimension) for a particular array dimension.
    4. The effective index is bounds checked against the dimension length.
    5. The lower bound and length values are 32-bit signed integers (`TYP_INT`).
    6. After constructing a "linearized index", the index is scaled by the array element size, and the offset from
       the array object to the beginning of the array data is added.
    7. Much of the complexity above is simply to assign temps to the various values that are used subsequently.
    8. The index expressions are used exactly once. However, if have side effects, they need to be copied, early,
       to preserve exception ordering.
    9. Only the top-level operation adds the array object to the scaled, linearized index, to create the final
       address `byref`. As usual, we need to be careful to not create an illegal byref by adding any partial index.
       calculation.
    10. To avoid doing unnecessary work, the importer sets the global `OMF_HAS_MDARRAYREF` flag if there are any
       MD array expressions to expand. Also, the block flag `BBF_HAS_MDARRAYREF` is set on blocks where these exist,
       so only those blocks are processed.
    
    Remaining work:
    1. Implement `optEarlyProp` support for MD arrays.
    2. Implement loop cloning support for MD arrays.
    3. (optionally) Remove old `GT_ARR_OFFSET` and `GT_ARR_INDEX` nodes and related code, as well as `GT_ARR_ELEM`
    code used after the new expansion.
    4. Implement improvements in CSE and LSRA to improve codegen for the MDMulMatrix benchmark.
    
    The new early expansion is enabled by default. It can be disabled (even in Release, currently), by setting
    `COMPlus_JitEarlyExpandMDArrays=0`. If disabled, it can be selectively enabled using
    `COMPlus_JitEarlyExpandMDArraysFilter=<method_set>` (e.g., as specified for `JitDump`).
    
    Fixes #60785.
    BruceForstall authored Jul 5, 2022
    Configuration menu
    Copy the full SHA
    cc0ccbe View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    2170ea9 View commit details
    Browse the repository at this point in the history
  12. [main] Update dependencies from dotnet/runtime dotnet/icu dotnet/xhar…

    …ness dotnet/emsdk (#71533)
    
    [main] Update dependencies from dotnet/runtime dotnet/icu dotnet/xharness dotnet/emsdk
    dotnet-maestro[bot] authored Jul 5, 2022
    Configuration menu
    Copy the full SHA
    2dc6b46 View commit details
    Browse the repository at this point in the history
  13. Make getTypeForPrimitiveValueClass treat different signs as different…

    … types (#71633)
    
    * Make getTypeForPrimitiveValueClass treat different sizes as different types
    
    * Handle missing types
    
    * Update jitinterface.cpp
    
    * Test removing pointers
    MichalPetryka authored Jul 5, 2022
    Configuration menu
    Copy the full SHA
    874043b View commit details
    Browse the repository at this point in the history
  14. Do not spill "mis-sized" struct args passed on stack (#71399)

    * Enable a test on Unix x64
    
    * Handle mis-sized structs in LA PUTARG_STK codegen
    
    * Handle mis-sized structs in LA PUTARG_SPLIT codegen
    
    * MisSizedStructs_ArmSplit -> MisSizedStructs_ArmArch
    
    * Add tests
    
    * Do not spill mis-sized stack args
    
    All backends support them.
    SingleAccretion authored Jul 5, 2022
    Configuration menu
    Copy the full SHA
    eb123a7 View commit details
    Browse the repository at this point in the history
  15. Configuration menu
    Copy the full SHA
    b9b5c8f View commit details
    Browse the repository at this point in the history

Commits on Jul 6, 2022

  1. Configuration menu
    Copy the full SHA
    0e5fcea View commit details
    Browse the repository at this point in the history
  2. Use crypto.subtle for AES on Browser WASM (#71501)

    * Use crypto.subtle for AES on Browser WASM
    
    Implement the browser "native" portion for AES on Browser WASM.
    
    There are two issues to solve .NET's Aes API on crypto.subtle:
    1. The .NET API supports streaming while crypto.subtle only supports "one shot" APIs.
    2. The .NET API supports multiple padding modes while crypto.subtle only supports PKCS7.
    
    To solve these issues, we use the following approach:
    
    1. We only invoke crypto.subtle with complete AES "blocks" of data. This allows us to make assumptions about the padding behavior.
    2. To implement streaming, remember the last block of the previous cipher text to use as the IV for the next stream of data.
    3. When encrypting, since we have a complete block of data and crypto.subtle uses PKCS7 padding, strip off the last block of cipher text which will always be a full block of padding.
    4. When decrypting do the inverse of encrypting - append an encrypted block of padding to the cipher text so crypto.subtle will return the full message as plain text.
    
    Other changes:
    - Make a few refactoring / simplifications where necessary.
    - SubtleCrypto doesn't support 192 bit AES keys, so no longer support AES-192 on Browser.
    
    Contributes to #40074
    
    * Use an empty array to create encrypted padding block.
    eerhardt authored Jul 6, 2022
    Configuration menu
    Copy the full SHA
    4222e69 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    a33b9d8 View commit details
    Browse the repository at this point in the history
  4. JIT: Avoid reordering operands in fgMorphModToSubMulDiv (#71615)

    * JIT: Avoid reordering operands in fgMorphModToSubMulDiv
    
    fgMorphModToSubMulDiv tries to check if it is ok to "clone" locals
    instead of spilling them by checking for address exposure. This was
    necessary because GTF_GLOB_REF is not up-to-date in preorder during
    morph, which is when this runs. However, address exposure is not valid
    for implicit byrefs at this point, so the check is not enough.
    
    The logic is trying to figure out which of the operands need to be
    spilled and which of them can be cloned. However, the logic was also
    wrong in the face of potential embedded assignments. Thus, rework it to
    be a bit more conservative but correct.
    
    As part of this, remove fgIsSafeToClone and make fgMakeMultiUse less
    conservative by avoiding checking for address exposure. This was
    probably an attempt at some limited interference checks, but from what I
    could see other uses do not need this.
    
    Fix #65118
    
    * Add a test
    
    * Revert unnecessary change
    
    * Switch to gtCloneExpr
    jakobbotsch authored Jul 6, 2022
    Configuration menu
    Copy the full SHA
    ffcb014 View commit details
    Browse the repository at this point in the history
Loading