31 instantiations of DynamicMethod
Aspire.StackExchange.Redis (1)
src\Vendoring\OpenTelemetry.Instrumentation.StackExchangeRedis\Implementation\RedisProfilerEntryToActivityConverter.cs (1)
212DynamicMethod getterMethod = new DynamicMethod(methodName, typeof(TField), new[] { typeof(object) }, true);
dotnet-svcutil-lib (2)
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\CodeGenerator.cs (1)
211_dynamicMethod = new DynamicMethod(methodName, returnType, argTypes, SerializationModule, allowPrivateMemberAccess);
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\ExceptionDataContract.cs (1)
474DynamicMethod baseMessageImpl = new DynamicMethod("NonVirtual_Message", typeof(string), new Type[] { Globals.TypeOfException }, Globals.TypeOfException);
Microsoft.AspNetCore.Routing (1)
Matching\ILEmitTrieFactory.cs (1)
32var method = new DynamicMethod(
Microsoft.Extensions.DependencyInjection (1)
ServiceLookup\ILEmit\ILEmitResolverBuilder.cs (1)
89var dynamicMethod = new DynamicMethod("ResolveService",
Microsoft.ML.Data (4)
Utils\ApiUtils.cs (4)
93var mb = new DynamicMethod("Peek", null, args, typeof(TOwn), true); 113var mb = new DynamicMethod("Peek", null, args, typeof(TOwn), true); 159var mb = new DynamicMethod("Poke", null, args, typeof(TOwn), true); 177var mb = new DynamicMethod("Poke", null, args, typeof(TOwn), true);
Microsoft.ML.Transforms (1)
Expression\MethodGenerator.cs (1)
29_method = new DynamicMethod(name, returnType, parameterTypes, thisType);
Microsoft.VisualBasic.Core (1)
Microsoft\VisualBasic\CompilerServices\IDOBinder.vb (1)
1383Dim InvokerMethod As New DynamicMethod("Invoker", ObjectType, {CallSiteBinderType, ObjectType, GetType(Object())}, True)
System.Linq.Expressions (2)
System\Dynamic\Utils\DelegateHelpers.cs (1)
253DynamicMethod dynamicThunkMethod = new DynamicMethod(thunkName.ToString(), returnType, paramTypes);
System\Linq\Expressions\Compiler\LambdaCompiler.cs (1)
74var method = new DynamicMethod(lambda.Name ?? ("lambda_method" + lambdaMethodIndex.ToString()), lambda.ReturnType, parameterTypes, true);
System.Private.CoreLib (3)
src\libraries\System.Private.CoreLib\src\System\Reflection\InvokerEmitUtil.cs (3)
29var dm = new DynamicMethod( 97var dm = new DynamicMethod( 154var dm = new DynamicMethod(
System.Private.DataContractSerialization (3)
System\Runtime\Serialization\CodeGenerator.cs (1)
135_dynamicMethod = new DynamicMethod(methodName, returnType, argTypes, SerializationModule, allowPrivateMemberAccess);
System\Runtime\Serialization\Json\JsonFormatReaderGenerator.cs (1)
186DynamicMethod dynamicMethod = new DynamicMethod(methodName, signature.ReturnType, paramTypes, typeof(JsonFormatReaderGenerator).Module, allowPrivateMemberAccess);
System\Runtime\Serialization\Json\JsonFormatWriterGenerator.cs (1)
121DynamicMethod dynamicMethod = new DynamicMethod(methodName, signature.ReturnType, paramTypes, typeof(JsonFormatWriterGenerator).Module, allowPrivateMemberAccess);
System.Private.Xml (1)
System\Xml\Xsl\IlGen\XmlILModule.cs (1)
171DynamicMethod methDyn = new DynamicMethod(name, returnType, paramTypes, s_LREModule);
System.Text.Json (8)
System\Text\Json\Serialization\Metadata\ReflectionEmitMemberAccessor.cs (8)
36var dynamicMethod = new DynamicMethod( 85var dynamicMethod = new DynamicMethod( 126var dynamicMethod = new DynamicMethod( 165var dynamicMethod = new DynamicMethod( 190var dynamicMethod = new DynamicMethod( 214var dynamicMethod = new DynamicMethod( 380new DynamicMethod( 388new DynamicMethod(
System.Text.RegularExpressions (1)
System\Text\RegularExpressions\RegexLWCGCompiler.cs (1)
80var dm = new DynamicMethod(methname, Attribs, Conventions, returntype, paramTypes, hostType, skipVisibility: false);
System.Xaml (2)
System\Xaml\Runtime\DynamicMethodRuntime.cs (2)
447return new DynamicMethod(name, returnType, argTypes, _localType); 451return new DynamicMethod(name, returnType, argTypes, _localAssembly.ManifestModule);
100 references to DynamicMethod
Aspire.StackExchange.Redis (1)
src\Vendoring\OpenTelemetry.Instrumentation.StackExchangeRedis\Implementation\RedisProfilerEntryToActivityConverter.cs (1)
212DynamicMethod getterMethod = new DynamicMethod(methodName, typeof(TField), new[] { typeof(object) }, true);
dotnet-svcutil-lib (3)
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\CodeGenerator.cs (2)
156private DynamicMethod _dynamicMethod; 180internal void BeginMethod(DynamicMethod dynamicMethod, Type delegateType, string methodName, Type[] argTypes, bool allowPrivateMemberAccess)
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\ExceptionDataContract.cs (1)
474DynamicMethod baseMessageImpl = new DynamicMethod("NonVirtual_Message", typeof(string), new Type[] { Globals.TypeOfException }, Globals.TypeOfException);
Microsoft.AspNetCore.Routing (1)
Matching\ILEmitTrieFactory.cs (1)
32var method = new DynamicMethod(
Microsoft.Extensions.DependencyInjection (2)
ServiceLookup\ILEmit\ILEmitResolverBuilder.cs (2)
50public DynamicMethod DynamicMethod; 89var dynamicMethod = new DynamicMethod("ResolveService",
Microsoft.ML.Data (4)
Utils\ApiUtils.cs (4)
93var mb = new DynamicMethod("Peek", null, args, typeof(TOwn), true); 113var mb = new DynamicMethod("Peek", null, args, typeof(TOwn), true); 159var mb = new DynamicMethod("Poke", null, args, typeof(TOwn), true); 177var mb = new DynamicMethod("Poke", null, args, typeof(TOwn), true);
Microsoft.ML.Transforms (1)
Expression\MethodGenerator.cs (1)
18private DynamicMethod _method;
mscorlib (1)
src\libraries\shims\mscorlib\ref\mscorlib.cs (1)
432[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Reflection.Emit.DynamicMethod))]
netstandard (1)
netstandard.cs (1)
1400[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Reflection.Emit.DynamicMethod))]
System.Linq.Expressions (10)
System\Dynamic\Utils\DelegateHelpers.cs (1)
253DynamicMethod dynamicThunkMethod = new DynamicMethod(thunkName.ToString(), returnType, paramTypes);
System\Linq\Expressions\Compiler\ILGen.cs (1)
473if (mb is DynamicMethod)
System\Linq\Expressions\Compiler\LambdaCompiler.cs (3)
74var method = new DynamicMethod(lambda.Name ?? ("lambda_method" + lambdaMethodIndex.ToString()), lambda.ReturnType, parameterTypes, true); 263Debug.Assert(_method is DynamicMethod); 288Debug.Assert(_method is DynamicMethod);
System\Linq\Expressions\Compiler\LambdaCompiler.Expressions.cs (1)
588Debug.Assert(_method is DynamicMethod);
System\Linq\Expressions\Compiler\LambdaCompiler.Lambda.cs (4)
28Debug.Assert(_method is DynamicMethod); 95DynamicMethod? dynamicMethod = inner._method as DynamicMethod; 133Debug.Assert(_method is DynamicMethod);
System.Private.CoreLib (30)
src\libraries\System.Private.CoreLib\src\System\Reflection\InvokerEmitUtil.cs (5)
29var dm = new DynamicMethod( 97var dm = new DynamicMethod( 154var dm = new DynamicMethod( 254Debug.Assert(method is DynamicMethod); 255returnType = (RuntimeType)((DynamicMethod)method).ReturnType;
src\libraries\System.Private.CoreLib\src\System\Reflection\MethodInvoker.cs (1)
60if (method is DynamicMethod dm)
src\System\Reflection\Emit\DynamicILGenerator.cs (21)
16internal DynamicILGenerator(DynamicMethod method, byte[] methodSignature, int size) 24internal void GetCallableMethod(RuntimeModule module, DynamicMethod dm) 61DynamicMethod? dynMeth = meth as DynamicMethod; 400DynamicMethod? dm = methodInfo as DynamicMethod; 525private int GetTokenFor(DynamicMethod dm) 536private int GetTokenForVarArgMethod(DynamicMethod dm, SignatureHelper sig) 560private readonly DynamicMethod m_method; 576m_method = (DynamicMethod)ilGenerator.m_methodBuilder; 610DynamicMethod method = m_method; 791DynamicMethod? dm = handle as DynamicMethod; 840private readonly DynamicMethod m_method; 850internal DynamicILInfo(DynamicMethod method, byte[] methodSignature) 862internal void GetCallableMethod(RuntimeModule module, DynamicMethod dm) 875public DynamicMethod DynamicMethod => m_method; 932public int GetTokenFor(DynamicMethod method) 1031public int GetTokenFor(DynamicMethod method) 1091internal DynamicMethod? m_dynamicMethod; 1094internal VarArgMethod(DynamicMethod dm, SignatureHelper signature)
src\System\Reflection\Emit\RuntimeILGenerator.cs (1)
88Debug.Assert(methodBuilder is MethodBuilder || methodBuilder is DynamicMethod);
src\System\Reflection\MethodBaseInvoker.CoreCLR.cs (1)
26internal unsafe MethodBaseInvoker(DynamicMethod method, Signature signature) : this(method, signature.Arguments)
src\System\Reflection\MethodInvoker.CoreCLR.cs (1)
19private unsafe MethodInvoker(DynamicMethod method) : this(method, method.Signature.Arguments)
System.Private.DataContractSerialization (4)
System\Runtime\Serialization\CodeGenerator.cs (2)
100private DynamicMethod _dynamicMethod = null!; // initialized in BeginMethod 111internal void BeginMethod(DynamicMethod dynamicMethod, Type delegateType, Type[] argTypes)
System\Runtime\Serialization\Json\JsonFormatReaderGenerator.cs (1)
186DynamicMethod dynamicMethod = new DynamicMethod(methodName, signature.ReturnType, paramTypes, typeof(JsonFormatReaderGenerator).Module, allowPrivateMemberAccess);
System\Runtime\Serialization\Json\JsonFormatWriterGenerator.cs (1)
121DynamicMethod dynamicMethod = new DynamicMethod(methodName, signature.ReturnType, paramTypes, typeof(JsonFormatWriterGenerator).Module, allowPrivateMemberAccess);
System.Private.Xml (5)
System\Xml\Xsl\IlGen\XmlILModule.cs (4)
171DynamicMethod methDyn = new DynamicMethod(name, returnType, paramTypes, s_LREModule); 187DynamicMethod? methDyn = methInfo as DynamicMethod; 267return ((DynamicMethod)_methods[name]!).CreateDelegate(typDelegate);
System\Xml\Xslt\XslCompiledTransform.cs (1)
230Delegate delExec = executeMethod is DynamicMethod dm
System.Reflection.Emit.Lightweight (1)
artifacts\obj\System.Reflection.Emit.Lightweight\Debug\net10.0\System.Reflection.Emit.Lightweight.Forwards.cs (1)
4[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Reflection.Emit.DynamicMethod))]
System.Text.Json (22)
System\Text\Json\Serialization\Metadata\ReflectionEmitMemberAccessor.cs (22)
36var dynamicMethod = new DynamicMethod( 74private static DynamicMethod CreateParameterizedConstructor(ConstructorInfo constructor) 85var dynamicMethod = new DynamicMethod( 115private static DynamicMethod? CreateParameterizedConstructor(ConstructorInfo constructor, Type parameterType1, Type parameterType2, Type parameterType3, Type parameterType4) 126var dynamicMethod = new DynamicMethod( 159private static DynamicMethod CreateAddMethodDelegate( 165var dynamicMethod = new DynamicMethod( 186private static DynamicMethod CreateImmutableEnumerableCreateRangeDelegate(Type collectionType, Type elementType, Type enumerableType) 190var dynamicMethod = new DynamicMethod( 210private static DynamicMethod CreateImmutableDictionaryCreateRangeDelegate(Type collectionType, Type keyType, Type valueType, Type enumerableType) 214var dynamicMethod = new DynamicMethod( 233private static DynamicMethod CreatePropertyGetter(PropertyInfo propertyInfo, Type runtimePropertyType) 243DynamicMethod dynamicMethod = CreateGetterMethod(propertyInfo.Name, runtimePropertyType); 279private static DynamicMethod CreatePropertySetter(PropertyInfo propertyInfo, Type runtimePropertyType) 289DynamicMethod dynamicMethod = CreateSetterMethod(propertyInfo.Name, runtimePropertyType); 317private static DynamicMethod CreateFieldGetter(FieldInfo fieldInfo, Type runtimeFieldType) 324DynamicMethod dynamicMethod = CreateGetterMethod(fieldInfo.Name, runtimeFieldType); 351private static DynamicMethod CreateFieldSetter(FieldInfo fieldInfo, Type runtimeFieldType) 358DynamicMethod dynamicMethod = CreateSetterMethod(fieldInfo.Name, runtimeFieldType); 379private static DynamicMethod CreateGetterMethod(string memberName, Type memberType) => 387private static DynamicMethod CreateSetterMethod(string memberName, Type memberType) => 396private static T? CreateDelegate<T>(DynamicMethod? method) where T : Delegate =>
System.Text.RegularExpressions (7)
System\Text\RegularExpressions\CompiledRegexRunnerFactory.cs (2)
9internal sealed class CompiledRegexRunnerFactory(DynamicMethod scanMethod, object[]? searchValues, CultureInfo? culture) : RegexRunnerFactory 11private readonly DynamicMethod _scanMethod = scanMethod;
System\Text\RegularExpressions\RegexLWCGCompiler.cs (5)
57DynamicMethod tryfindNextPossibleStartPositionMethod = DefineDynamicMethod($"Regex{regexNum}_TryFindNextPossibleStartingPosition{description}", typeof(bool), typeof(CompiledRegexRunner), s_paramTypes); 60DynamicMethod tryMatchAtCurrentPositionMethod = DefineDynamicMethod($"Regex{regexNum}_TryMatchAtCurrentPosition{description}", typeof(bool), typeof(CompiledRegexRunner), s_paramTypes); 63DynamicMethod scanMethod = DefineDynamicMethod($"Regex{regexNum}_Scan{description}", null, typeof(CompiledRegexRunner), [typeof(RegexRunner), typeof(ReadOnlySpan<char>)]); 71private DynamicMethod DefineDynamicMethod(string methname, Type? returntype, Type hostType, Type[] paramTypes) 80var dm = new DynamicMethod(methname, Attribs, Conventions, returntype, paramTypes, hostType, skipVisibility: false);
System.Xaml (7)
System\Xaml\Runtime\DynamicMethodRuntime.cs (7)
279DynamicMethod dynamicMethod = CreateDynamicMethod($"{targetType.Name}DelegateHelper", 296DynamicMethod dynamicMethod = CreateDynamicMethod("CreateDelegateHelper", 314DynamicMethod dynamicMethod = CreateDynamicMethod($"{ctor.DeclaringType.Name}Ctor", 328DynamicMethod dynamicMethod = CreateDynamicMethod($"{factory.Name}Factory", 406DynamicMethod dynamicMethod = CreateDynamicMethod($"{getter.Name}Getter", 424DynamicMethod dynamicMethod = CreateDynamicMethod($"{setter.Name}Setter", 443private DynamicMethod CreateDynamicMethod(string name, Type returnType, params Type[] argTypes)