Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Respect IsDynamicCodeSupported in more places in Linq.Expressions #88539

Merged
merged 4 commits into from
Jul 11, 2023

Commits on Jul 6, 2023

  1. Respect IsDynamicCodeSupported in more places in Linq.Expressions

    * CanEmitObjectArrayDelegate
    * CanCreateArbitraryDelegates
    
    These properties are all set to `false` when running on NativeAOT, so have them respect RuntimeFeature.IsDynamicCodeSupported.
    
    Fix dotnet#81803
    eerhardt committed Jul 6, 2023
    Configuration menu
    Copy the full SHA
    7f9228e View commit details
    Browse the repository at this point in the history

Commits on Jul 7, 2023

  1. Work around DynamicDelegateAugments.CreateObjectArrayDelegate not exi…

    …sting in CoreClr's System.Private.CoreLib.
    
    Allow System.Linq.Expressions to create an object[] delegate using Ref.Emit even though RuntimeFeature.IsDynamicCodeSupported is set to false (ex. using a feature switch). To enable this, add an internal method in CoreLib that temporarily allows the current thread to skip the RuntimeFeature check and allows DynamicMethod instances to be created. When System.Linq.Expressions needs to generate one of these delegates, it calls the internal method through Reflection and continues to use Ref.Emit to generate the delegate.
    eerhardt committed Jul 7, 2023
    Configuration menu
    Copy the full SHA
    4643eae View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    b57a897 View commit details
    Browse the repository at this point in the history

Commits on Jul 11, 2023

  1. Address PR feedback

    eerhardt committed Jul 11, 2023
    Configuration menu
    Copy the full SHA
    514bd95 View commit details
    Browse the repository at this point in the history