Skip to content

Conversation

@allantargino
Copy link
Contributor

@allantargino allantargino commented Sep 27, 2021

We were doing some local optimizations with MSIL’s Stloc and Ldloc, but the very same ones are already present in an override of the ILGenerator.Emit function, so we can remove them.

This PR also fixes the use of Ldloca that was generating additional nop operations.

fix #59624

We were doing some local optimizations with MSIL’s Stloc and Ldloc,
but the very same ones are already present in an override of the
ILGenerator.Emit function, so we can remove them.

This PR also fixes the use of Ldloca that was generating additional
nop operations.

fix dotnet#59624
@ghost ghost added area-Extensions-DependencyInjection community-contribution Indicates that the PR has been added by a community member labels Sep 27, 2021
@ghost
Copy link

ghost commented Sep 27, 2021

Tagging subscribers to this area: @eerhardt, @maryamariyan
See info in area-owners.md if you want to be subscribed.

Issue Details

We were doing some local optimizations with MSIL’s Stloc and Ldloc,
but the very same ones are already present in an override of the
ILGenerator.Emit function, so we can remove them.

This PR also fixes the use of Ldloca that was generating additional
nop operations.

fix #59624

Author: allantargino
Assignees: -
Labels:

area-Extensions-DependencyInjection

Milestone: -

@allantargino
Copy link
Contributor Author

For reference, ILGenerator.Emit(OpCode, LocalInfo), per @teo-tsirpanis suggestion.

Copy link
Member

@eerhardt eerhardt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@eerhardt eerhardt merged commit 77bd789 into dotnet:main Sep 28, 2021
@allantargino allantargino deleted the issue-59624 branch September 29, 2021 12:05
@ghost ghost locked as resolved and limited conversation to collaborators Nov 3, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-Extensions-DependencyInjection community-contribution Indicates that the PR has been added by a community member

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Dependency Injection using ILEmit is generating additional MSIL nop operations in the DynamicMethod

2 participants