1. 12 6月, 2021 19 次提交
    • D
      Scope events to the execution of the entry point (#54090) · 2a011f80
      David Fowler 提交于
      * Scope events to the execution of the entry point
      - Today we're using the global event source and events that fire in the app domain get captured and this can result in capturing the wrong instances. This fix uses an async local to scope the events for the HostingEventListener to the execution of the application's entry point.
      - Removed the RemoteExecutor as a result of this change
      - Remove RequirementsMet property
      2a011f80
    • A
      [mono] Componentize hot reload (#52866) · 23336b89
      Aleksey Kliger (λgeek) 提交于
      * Move most of the code to hot_reload.c
      
      For the fast path data, we will leave a struct in the runtime with the values
      and pass its address to the component to fill in.
      
      * Mark functions used by hot reload with MONO_COMPONENT_API
      
      * Drop the metadata_update_init EE and runtime callbacks
      
      They're unused now
      
      * remove mono_ prefix from some static methods in hot reload
      
      * Always define metadata_update_published runtime callback
      
      * Move metadata update data out of MonoImage, into hot_reload component
      
      Use separate baseline and delta structs for tracking updates
      
      * move slowpath metadata lookup, and cleanup to hot_reload component
      
      Move the delta_image and method_table_update data into BaselineInfo
      and DeltaInfo.  Keep a single `MonoImage:has_updates` flag to switch
      over to the slow path through the component.
      
      * fixup: set has_updates on first update, too
      
      Also setup the BaselineInfo and DeltaInfo earlier before the first
      string heap lookup
      
      * fixup after rebase
      
      * ConsoleDelta sample: build on osx-arm64, use hotreload buildtool
      
      instead of hotreload-delta-gen CLI tool
      
      * fix whitespace
      
      * bugfix - get the value of MonoImage:has_updates not its address
      
      * Dynamically query runtime for GetApplyUpdateCapabilities
      
      if the hot reload component is stubbed out, return empty capabilities.
      
      This is a step toward removing FEATURE_METADATA_UPDATE and
      ENABLE_METADATA_UPDATE defines and solely using component
      infrastrucutre for controlling behavior
      
      * Mark some runtime functions with MONO_COMPONENT_API
      
      * fixup icall declaration
      
      * fix whitespace and indentation
      
      * Return capabilities if hot reload component is available, even if env var isn't set.
      
      Match CoreCLR behavior.  Also makes our testsuite actually run the
      tests (we check for capabilities before running setting
      DOTNET_MODIFIABLE_ASSEMBLIES using the remote executor)
      23336b89
    • J
      simplify gh53564 test (#54081) · 1b382e2b
      John Salem 提交于
      1b382e2b
    • D
      Add support for IServiceProviderIsService (#54047) · c14ac488
      David Fowler 提交于
      * Add support for IServiceProviderIsService
      - This optional service lets consumers query to see if a service is resolvable without side effects (not having to explicitly resolve the service).
      - Added new spec tests to verify the baseline behavior based on IServiceCollection features.
      - Handle built in services as part of IsServce
      - Special case built in services as part of the IsService check
      - Make the tests part of the core DI tests and enable skipping via a property
      Co-authored-by: NTravis Illig <tillig@paraesthesia.com>
      c14ac488
    • A
    • S
      Fix 54025 (#54070) · b2fe6678
      Steve MacLean 提交于
      b2fe6678
    • S
      Fix Deflate/Brotli/CryptoStream handling of partial and zero-byte reads (#53644) · 68dec6ac
      Stephen Toub 提交于
      Stream.Read{Async} is supposed to return once at least a byte of data is available, and in particular, if there's any data already available, it shouldn't block.  But Read{Async} on DeflateStream (and thus also GZipStream and ZLibStream), BrotliStream, and CryptoStream won't return until either it hits the end of the stream or the caller's buffer is filled.  This makes it behave very unexpectedly when used in a context where the app is using a large read buffer but expects to be able to process data as it's available, e.g. in networked streaming scenarios where messages are being sent as part of bidirectional communication.
      
      This fixes that by stopping looping once any data is consumed.  Just doing that, though, caused problems for zero-byte reads.  Zero-byte reads are typically used by code that's trying to delay-allocate a buffer for the read data until data will be available to read.  At present, however, zero-byte reads return immediately regardless of whether data is available to be consumed.  I've changed the flow to make it so that zero-byte reads don't return until there's at least some data available as input to the inflater/transform (this, though, doesn't 100% guarantee the inflater/transform will be able to produce output data).
      
      Note that both of these changes have the potential to introduce breaks into an app that erroneously depended on these implementation details:
      - If an app passing in a buffer of size N to Read{Async} depended on that call always producing the requested number of bytes (rather than what the Stream contract defines), they might experience behavioral changes.
      - If an app passing in a zero-byte buffer expected it to return immediately, it might instead end up waiting until data was actually available.
      68dec6ac
    • H
      Expose RoundUpToPowerOf2 (#53992) · ffcef4af
      Huo Yaoyuan 提交于
      * 32bit
      
      * 64bit
      
      * Expose in public api
      
      * Unit test
      
      * Add more tests
      
      * Use in test
      
      * Apply suggestions from code review
      Co-authored-by: NStephen Toub <stoub@microsoft.com>
      Co-authored-by: NStephen Toub <stoub@microsoft.com>
      ffcef4af
    • J
      Improve dotnet-pgo output and fix null type handles (#53494) · 146b3b16
      Jakob Botsch Nielsen 提交于
      * Improve dotnet-pgo output and fix null type handles
      
      * When comparing .mibc files, find a unique name to print for both files
        by repeatedly appending another parent directory on it.
      
      * When comparing .mibc files, print a comparison of type handle
        histogram data
      
      * Fix a potential division by zero
      
      * Print some info when producing .mibc that are based on samples/LBR
        data
      
      * Fix .mibc read type handles with value 0 to actually return IsNull
      
      * Use different devirt threshold for interfaces and classes
      
      * Add ClassProfileFlags to PgoFormat.cs
      146b3b16
    • Z
      [mono][llvm] Remove some dead code. (#53920) · dd72b1d2
      Zoltan Varga 提交于
      dd72b1d2
    • B
      Fix mismatch between morph and lower (#53911) · e492dc7e
      Bruce Forstall 提交于
      For x86 delegate invoke tailcall via helper calls,
      Lower expects the `this` pointer in a LCL_VAR. Morph
      (`fgMorphTailCallViaJitHelper`) was letting a LCL_FLD go through
      instead of inserting a copy of the field to a temp local.
      
      Simply change the condition in morph to match the condition in Lower.
      
      Fixes #53568
      e492dc7e
    • S
      Reenable 48786 (#54028) · 6cea5f70
      Steve MacLean 提交于
      Reenable tests disabled for issue 48786
      
      This should be fixed now that we have moved to crossgen2
      6cea5f70
    • T
      make MsQuicStatusCodes platform specific (#54031) · cf10c2dc
      Tomas Weinfurt 提交于
      * make MsQuicStatusCodes platform specific
      
      * add missing StreamLimit
      cf10c2dc
    • M
      Re-enabled mock tests for H/3. (#53802) · 9ea8c200
      Marie Píchová 提交于
      * Re-enabled mock tests for H/3.
      
      * Used IsMockQuicSupported to run the mock tests only on supported platforms.
      
      * Disabling mock test completely.
      
      * Hanging test fix experiment.
      
      * Disabled some mock tests failing in CI.
      9ea8c200
    • T
      Fix assertion on debugger-engine (#54041) · 645dfe69
      Thays Grazia 提交于
      Sync to mono/mono #21100
      645dfe69
    • V
      Update dotnet SDK to 6.0 Preview 4 (#53808) · 8698d0f3
      Viktor Hofer 提交于
      * Update dotnet SDK to 6.0 Preview 4
      
      Update the minimum and target version of the SDK to 6.0 Preview 4.
      
      Part of https://github.com/dotnet/runtime/issues/53411
      
      * Switch to using eng/targetingpacks.targets for redirecting runtime pack location in src/mono/sample
      
      * Fix binder tracing tests
      
      * Set UseMonoRuntime property so the dotnet SDK can pull the mono runtime packs
      
      This is necessary after the changes from https://github.com/dotnet/sdk/pull/16909.
      
      * Move UseMonoRuntimeProperty and set it to false in coreclr
      Co-authored-by: NAlexander Köplinger <alex.koeplinger@outlook.com>
      Co-authored-by: NElinor Fung <elfung@microsoft.com>
      8698d0f3
    • I
      Vector.Sum(Vector<T>) API implementation for horizontal add. (#53527) · 6afe03ef
      Ivan Zlatanov 提交于
      * Vector.Sum(Vector<T>) API implementation for horizontal add.
      
      * Fixed inccorrect referece to Arm64 AddAccross intrinsic function.
      
      * Added implementation for hardware accelerated Vector<T>.Sum for long, ulong, float, double on ARM64.
      
      * Fixed formatting issue.
      
      * Correctness.
      
      * Fixed compiler error for ARM64.
      
      * Formatting issue.
      
      * More explicit switch statement. Fixed wrong simd size for NI_Vector64_ToScalar.
      
      * Fixed auto formatting issue.
      
      * Use AddPairwiseScalar for double, long and ulong on ARM64 for VectorT128_Sum.
      
      * Forgot ToScalar call after AddPairwiseScalar.
      
      * Fixed wrong return type.
      6afe03ef
    • P
    • A
      Increase timeouts for PGO tests (#54030) · 80259643
      Andy Ayers 提交于
      80259643
  2. 11 6月, 2021 21 次提交
    • P
    • D
      Follow up on HostFactoryResolver changes (#54052) · b88b34c6
      David Fowler 提交于
      - Cleaned up the comments to explain what ResolveHostFactory does.
      - Added entry point completed callback to let callers know when the entry point code is done running.
      - Added tests for the various callbacks.
      b88b34c6
    • T
      [HTTP/3] Fix #53632 by using original host when omitted (#53648) · 75ede832
      TimTim 提交于
      * Fix #53632
      
      * Annotate non-nullable _originAuthority
      
      * Test inheriting original host for HTTP/3 Alt-Svc
      75ede832
    • E
      Make some Brotli p/invokes blittable (#54029) · ef9e276c
      Elinor Fung 提交于
      * Make some Brotli p/invokes blittable
      
      * Use Interop.BOOL
      ef9e276c
    • L
      ComActivator tests with built-in COM disabled (#53733) · 9ac357df
      Lakshan Fernando 提交于
      * ComActivator tests with built-in COM disabled
      
      * Added negative scnearios with built-in com disabled
      
      * FB
      
      * FB
      
      * FB
      
      * Update src/tests/Interop/COM/Activator/Program.cs
      Co-authored-by: NElinor Fung <elfung@microsoft.com>
      Co-authored-by: NElinor Fung <elfung@microsoft.com>
      9ac357df
    • V
      [interp] Fix loading of ThreadStatic value types (#53391) · ddbce77f
      Vlad Brezae 提交于
      * [interp] Fix loading of ThreadStatic value types
      
      * Add runtime test for ThreadStatic valuetype access
      ddbce77f
    • V
      [interp] Fix IL offset tracking of inlined bblocks (#53989) · e3c8ecc9
      Vlad Brezae 提交于
      * [interp] Fix il offset tracking of inlined bblocks
      
      During method compilation we maintain the `td->offset_to_bb` array that maps an IL offset to the bblock that contains generated code for those IL instructions. When a bblock is removed, we update this mapping so it no longer points to the removed bblock (even if those IL offsets are unreachable, we might still query them to get ranges for EH clauses). For bblocks that were added during inlining, their `bb->ip` didn't point to code inside the original transformed method, so we failed to remove them from `offset_to_bb` array. Once we finish inlining a method, we update the il_offsets of all newly added basic blocks.
      
      * [interp] Correctly update il offset mapping for merged bblocks
      
      If il_offset1 belongs to BB2 and BB2 is merged into BB1 (BB1->next_bb == BB2), then, once BB2 is removed, il_offset1 should belong to BB1 and not to BB2->next_bb. While it's unclear if this leads to bugs, the previous behavior was conceptually wrong.
      e3c8ecc9
    • P
      In gc_heap::walk_heap_per_heap, we need to iterate through the SOH generations... · f2b5f1c3
      Peter Sollich 提交于
      In gc_heap::walk_heap_per_heap, we need to iterate through the SOH generations if USE_REGIONS is enabled. (#53995)
      
      In gc_heap::walk_heap_per_heap, we need to iterate through the SOH generations if USE_REGIONS is enabled - otherwise the lower SOH generations may be skipped.
      f2b5f1c3
    • K
      Add trimmer annotations to System.Data.Common (#52046) · c2f559cf
      Krzysztof Wicher 提交于
      Add trimmer annotations to System.Data.Common
      Co-authored-by: NEric Erhardt <eric.erhardt@microsoft.com>
      c2f559cf
    • K
      Consider reloadWeight while evaluating spill cost (#53853) · 6cf9af28
      Kunal Pathak 提交于
      * Consider reloadWeight while evaluating spill cost
      
      * fix linux arm issue
      
      * jit format
      6cf9af28
    • A
      [wasm][aot] Enable tests that are passing now (#53977) · e6daad20
      Ankit Jain 提交于
      * [wasm][aot] Enable tests that are passing now
      
      These don't reproduce on `main` anymore, after the exceptions fix.
      
      `System.Transactions.Locals.Tests` Fixes https://github.com/dotnet/runtime/issues/50969
      `System.Threading.Tasks.Parallel.Tests` Fixes https://github.com/dotnet/runtime/issues/51677
      
      * [wasm][aot][tests] Enable `System.Xml.Xsl.XslCompiledTransformApi.Tests`
      
      This hasn't been crashing for quite some time.
      The individual test failures are already disabled with
      https://github.com/dotnet/runtime/issues/51244, and
      https://github.com/dotnet/runtime/issues/51911 .
      
      Fixes https://github.com/dotnet/runtime/issues/51245
      e6daad20
    • D
      Enable devirtualization in more scenarios on crossgen2 (#53567) · d07f9111
      David Wrighton 提交于
      Address deficiencies in current devirtualization infrastructure
      
      - Remove the responsibility of creating a CORINFO_RESOLVED_TOKEN structure from the JIT and make it a responsibility of the VM side of the jit interface.
        - This enables the component (crossgen2) which has deeper understanding of the requirements here to correctly handle scenarios that would otherwise require expressing crossgen2 specific details across the jit interface.
      - Add a new set of fixups (`READYTORUN_FIXUP_Check_VirtualFunctionOverride` and `READYTORUN_FIXUP_Verify_VirtualFunctionOverride`) these are used to validate that the behavior of the runtime and crossgen2 compiler is equivalent for a virtual resolution event
        - `READYTORUN_FIXUP_Check_VirtualFunctionOverride` will ensure that the virtual resolution decision is the same at crossgen2 time and runtime, and if the decision differs, any generated code affected by the decision will not be used.
        - `READYTORUN_FIXUP_Verify_VirtualFunctionOverride` will perform the same checks as `READYTORUN_FIXUP_Check_VirtualFunctionOverride`, but if it fails the check, the process will be terminated with a fail-fast. It is intended for use under the `--verify-type-and-field-layout` stress mode.
        - Currently only the `READYTORUN_FIXUP_Verify_VirtualFunctionOverride` is actually generated, and it is only generated when using the `--verify-type-and-field-layout` switch to crossgen2. Future work will identify if there are scenarios where we need to generate the `READYTORUN_FIXUP_Check_VirtualFunctionOverride` flag. One area of possible concern is around covariant returns, another is around handling of type equivalence.
      - In order to express the fixup signature for the VirtualFunctionOverride fixups, a new flag has been added to `ReadyToRunMethodSigFlags`. `READYTORUN_METHOD_SIG_UpdateContext` will allow the method signature to internally specify the assembly which is associated with the method token, instead of relying on the ambient context.
      - R2RDump and the ReadyToRun format documentation have been updated with the details of the new fixups/flags.
      - Update the rules for handling unboxing stubs
        - See #51918 for details. This adds a new test, as well as proper handling for unboxing stubs to match the JIT behavior
        - Also revert #52605, which avoided the problem by simply disabling devirtualization in the presence of structs
      - Adjust the rules for when it is legal to devirtualize and maintain version resiliency
        - The VersionsWithCode and VersionsWithType rules are unnecessarily restrictive.
        - Instead Validate that the metadata is safely checkable, and rely on the canInline logic to ensure that no IL that can't be handled is inlined.
        - This also involved adding a check that the chain of types from the implementation type to the declaration method table type is within the version bubble.
        - And changing the `VersionsWithType` check on the implementation type, to a new `VersionsWithTypeReference` check which can be used to validate that the type can be referred to, in combination with using `VersionsWithType` on the type definition.
        - By adjusting the way that the declMethod is referred to, it becomes possible to use the declMethod without checking the full method is `VersionsWithCode`, and it just needs a relationship to version matching code.
      - In `resolveVirtualMethod` generate the `CORINFO_RESOLVED_TOKEN` structures for the jit
        - In particular we are now able to resolve to methods where the decl method is the resolution result but is not within the version bubble itself. This can happen if we can prove that the decl method is the only method which can possibly implement a virtual.
      - Add support for devirtualization reasons to crossgen2
      - Port all devirtualization abort conditions to crossgen2 from runtime that were not already present
      - Fix devirtualization from a canonical virtual method when the actual implementation is more exact
      - Fix variant interface override scenario where there is an interface that requires implementation of the variant interface as well as the variant interface itself.
      d07f9111
    • F
      Use custom mobile testing API (#53871) · e4751aee
      Fan Yang 提交于
      * Use custom Android testing API
      
      * Fix for non-mobile cases
      
      * Use Collection Fixtures for mobile only
      
      * Update src/tests/Common/Coreclr.TestWrapper/MobileAppHandler.cs
      Co-authored-by: NPřemek Vysoký <premek.vysoky@microsoft.com>
      
      * Update src/tests/Common/Coreclr.TestWrapper/MobileAppHandler.cs
      Co-authored-by: NPřemek Vysoký <premek.vysoky@microsoft.com>
      
      * Update src/tests/run.proj
      Co-authored-by: NPřemek Vysoký <premek.vysoky@microsoft.com>
      
      * Fix the ios app extension
      
      * Add back Path and remove redundant namespace string
      
      * Add missing class name Path
      Co-authored-by: NPřemek Vysoký <premek.vysoky@microsoft.com>
      e4751aee
    • D
      [main] Update dependencies from dnceng/internal/dotnet-optimization (#53864) · 5c508661
      dotnet-maestro[bot] 提交于
      [main] Update dependencies from dnceng/internal/dotnet-optimization
      5c508661
    • G
      small improvements to HTTP Cancellation Tests and rename (#54018) · 6830ba14
      Geoff Kizer 提交于
      * improve HttpClientHandler_Http11_Cancellation_Test and rename to SocketsHttpHandler_Http11_Cancellation_Test
      Co-authored-by: NGeoffrey Kizer <geoffrek@windows.microsoft.com>
      6830ba14
    • D
      [main] Update dependencies from dotnet/icu dotnet/llvm-project... · 627fe8c9
      dotnet-maestro[bot] 提交于
      [main] Update dependencies from dotnet/icu dotnet/llvm-project dotnet/runtime-assets dotnet/hotreload-utils (#53865)
      
      * Update dependencies from https://github.com/dotnet/icu build 20210607.1
      
      Microsoft.NETCore.Runtime.ICU.Transport
       From Version 6.0.0-preview.6.21281.1 -> To Version 6.0.0-preview.6.21307.1
      
      * Update dependencies from https://github.com/dotnet/llvm-project build 20210607.2
      
      runtime.win-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools , runtime.win-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk , runtime.osx.10.12-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools , runtime.osx.10.12-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk , runtime.linux-arm64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk , runtime.linux-arm64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools , runtime.linux-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk , runtime.linux-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools
       From Version 9.0.1-alpha.1.21281.1 -> To Version 11.1.0-alpha.1.21307.2
      
      * Update dependencies from https://github.com/dotnet/hotreload-utils build 20210607.1
      
      Microsoft.DotNet.HotReload.Utils.Generator.BuildTool
       From Version 1.0.1-alpha.0.21305.2 -> To Version 1.0.1-alpha.0.21307.1
      
      * Update dependencies from https://github.com/dotnet/runtime-assets build 20210607.1
      
      System.ComponentModel.TypeConverter.TestData , System.Drawing.Common.TestData , System.IO.Compression.TestData , System.IO.Packaging.TestData , System.Net.TestData , System.Private.Runtime.UnicodeData , System.Runtime.TimeZoneData , System.Security.Cryptography.X509Certificates.TestData , System.Windows.Extensions.TestData
       From Version 6.0.0-beta.21301.1 -> To Version 6.0.0-beta.21307.1
      
      * Update dependencies from https://github.com/dotnet/llvm-project build 20210608.1
      
      runtime.win-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools , runtime.win-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk , runtime.osx.10.12-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools , runtime.osx.10.12-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk , runtime.linux-arm64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk , runtime.linux-arm64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools , runtime.linux-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk , runtime.linux-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools
       From Version 9.0.1-alpha.1.21281.1 -> To Version 11.1.0-alpha.1.21308.1
      Co-authored-by: Ndotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
      627fe8c9
    • V
      Don't reference the netstandard shim inside the shared framework (#53023) · bbf96599
      Viktor Hofer 提交于
      * Don't reference ns.dll inside shared framework
      
      The netstandard.dll shim shouldn't be referenced inside the shared
      framework as it's a compat shim that shouldn't be required to compose
      the shared framework.
      
      This removes the necessity of a separate RefPath build and improves
      incremental build times as only the few OOB projects that require the
      shim would need to rebuild.
      
      * Reference netstandard shim in OOBs that require it
      
      There are a few OOB projects that require the netstandard.dll shim as
      they intentionally reference projects that only expose a netstandard
      configuration.
      Co-authored-by: NBuyaa Namnan <buyankhishig.namnan@microsoft.com>
      bbf96599
    • J
      Handle Counter Polling Interval of 0 (#53836) · 207bb77a
      John Salem 提交于
      207bb77a
    • D
      [main] Update dependencies from mono/linker (#53866) · 31a389f3
      dotnet-maestro[bot] 提交于
      [main] Update dependencies from mono/linker
      31a389f3
    • A
      Make the ZLib P/Invokes all blittable (#53968) · c40ddebb
      Aaron Robinson 提交于
      * Make the ZLib P/Invokes all blittable
      c40ddebb
    • Z
      f18a7043