Skip to content

Commit

Permalink
Abstract out System.Reflection.Emit.ILGenerator (#86594)
Browse files Browse the repository at this point in the history
* Abstract out ILGenerator

* Finish up abstracting

* Remove protected abstract methods, use more public abstract instead

* Use RuntimeILGenerator for Linq test
  • Loading branch information
buyaa-n authored May 23, 2023
1 parent b066a16 commit 6f97718
Show file tree
Hide file tree
Showing 17 changed files with 344 additions and 514 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -161,14 +161,14 @@
<Compile Include="$(BclSourcesRoot)\System\Reflection\Emit\CustomAttributeBuilder.cs" />
<Compile Include="$(BclSourcesRoot)\System\Reflection\Emit\DynamicILGenerator.cs" />
<Compile Include="$(BclSourcesRoot)\System\Reflection\Emit\DynamicMethod.CoreCLR.cs" />
<Compile Include="$(BclSourcesRoot)\System\Reflection\Emit\ILGenerator.cs" />
<Compile Include="$(BclSourcesRoot)\System\Reflection\Emit\LocalBuilder.cs" />
<Compile Include="$(BclSourcesRoot)\System\Reflection\Emit\RuntimeAssemblyBuilder.cs" />
<Compile Include="$(BclSourcesRoot)\System\Reflection\Emit\RuntimeConstructorBuilder.cs" />
<Compile Include="$(BclSourcesRoot)\System\Reflection\Emit\RuntimeEnumBuilder.cs" />
<Compile Include="$(BclSourcesRoot)\System\Reflection\Emit\RuntimeEventBuilder.cs" />
<Compile Include="$(BclSourcesRoot)\System\Reflection\Emit\RuntimeFieldBuilder.cs" />
<Compile Include="$(BclSourcesRoot)\System\Reflection\Emit\RuntimeGenericTypeParameterBuilder.cs" />
<Compile Include="$(BclSourcesRoot)\System\Reflection\Emit\RuntimeILGenerator.cs" />
<Compile Include="$(BclSourcesRoot)\System\Reflection\Emit\RuntimeMethodBuilder.cs" />
<Compile Include="$(BclSourcesRoot)\System\Reflection\Emit\RuntimeModuleBuilder.cs" />
<Compile Include="$(BclSourcesRoot)\System\Reflection\Emit\RuntimeParameterBuilder.cs" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

namespace System.Reflection.Emit
{
internal sealed class DynamicILGenerator : ILGenerator
internal sealed class DynamicILGenerator : RuntimeILGenerator
{
internal DynamicScope m_scope;
private readonly int m_methodSigToken;
Expand Down Expand Up @@ -105,7 +105,6 @@ public override void Emit(OpCode opcode, MethodInfo meth)
}

UpdateStackSize(opcode, stackchange);

PutInteger4(token);
}

Expand All @@ -131,7 +130,6 @@ public override void Emit(OpCode opcode, ConstructorInfo con)

// need to sort out the stack size story
UpdateStackSize(opcode, 1);

PutInteger4(token);
}

Expand Down
Loading

0 comments on commit 6f97718

Please sign in to comment.