1 write to Generator
Microsoft.Extensions.DependencyInjection (1)
ServiceLookup\ILEmit\ILEmitResolverBuilderContext.cs (1)
12
public ILEmitResolverBuilderContext(ILGenerator generator) =>
Generator
= generator;
78 references to Generator
Microsoft.Extensions.DependencyInjection (78)
ServiceLookup\ILEmit\ILEmitResolverBuilder.cs (78)
158
argument.
Generator
.Emit(OpCodes.Unbox_Any, parameterCallSite.ServiceType);
162
argument.
Generator
.Emit(OpCodes.Newobj, constructorCallSite.ConstructorInfo);
165
argument.
Generator
.Emit(OpCodes.Box, constructorCallSite.ImplementationType);
190
argument.
Generator
.Emit(OpCodes.Ldarg_1);
191
argument.
Generator
.Emit(OpCodes.Call, generatedMethod.DynamicMethod);
206
argument.
Generator
.Emit(OpCodes.Ldarg_1);
214
argument.
Generator
.Emit(OpCodes.Call, ServiceLookupHelpers.GetArrayEmptyMethodInfo(enumerableCallSite.ItemType));
222
argument.
Generator
.Emit(OpCodes.Ldc_I4, enumerableCallSite.ServiceCallSites.Length);
223
argument.
Generator
.Emit(OpCodes.Newarr, enumerableCallSite.ItemType);
227
argument.
Generator
.Emit(OpCodes.Dup);
229
argument.
Generator
.Emit(OpCodes.Ldc_I4, i);
235
argument.
Generator
.Emit(OpCodes.Unbox_Any, parameterCallSite.ServiceType);
239
argument.
Generator
.Emit(OpCodes.Stelem, enumerableCallSite.ItemType);
251
argument.
Generator
.Emit(OpCodes.Ldarg_0);
252
argument.
Generator
.Emit(OpCodes.Ldfld, FactoriesField);
254
argument.
Generator
.Emit(OpCodes.Ldc_I4, argument.Factories.Count);
255
argument.
Generator
.Emit(OpCodes.Ldelem, typeof(Func<IServiceProvider, object>));
257
argument.
Generator
.Emit(OpCodes.Ldarg_1);
258
argument.
Generator
.Emit(OpCodes.Call, ServiceLookupHelpers.InvokeFactoryMethodInfo);
269
argument.
Generator
.Emit(OpCodes.Ldarg_0);
270
argument.
Generator
.Emit(OpCodes.Ldfld, ConstantsField);
272
argument.
Generator
.Emit(OpCodes.Ldc_I4, argument.Constants.Count);
273
argument.
Generator
.Emit(OpCodes.Ldelem, typeof(object));
283
argument.
Generator
.Emit(OpCodes.Ldtoken, id.ServiceType);
284
argument.
Generator
.Emit(OpCodes.Call, GetTypeFromHandleMethod);
285
argument.
Generator
.Emit(OpCodes.Ldc_I4, key.Slot);
286
argument.
Generator
.Emit(OpCodes.Newobj, CacheKeyCtor);
328
LocalBuilder cacheKeyLocal = context.
Generator
.DeclareLocal(typeof(ServiceCacheKey));
329
LocalBuilder resolvedServicesLocal = context.
Generator
.DeclareLocal(typeof(IDictionary<ServiceCacheKey, object>));
330
LocalBuilder syncLocal = context.
Generator
.DeclareLocal(typeof(object));
331
LocalBuilder lockTakenLocal = context.
Generator
.DeclareLocal(typeof(bool));
332
LocalBuilder resultLocal = context.
Generator
.DeclareLocal(typeof(object));
334
Label skipCreationLabel = context.
Generator
.DefineLabel();
335
Label returnLabel = context.
Generator
.DefineLabel();
336
Label defaultLabel = context.
Generator
.DefineLabel();
339
context.
Generator
.Emit(OpCodes.Ldarg_1);
340
context.
Generator
.Emit(OpCodes.Callvirt, ScopeIsRootScope);
341
context.
Generator
.Emit(OpCodes.Brfalse_S, defaultLabel);
343
context.
Generator
.Emit(OpCodes.Call, CallSiteRuntimeResolverInstanceField);
345
context.
Generator
.Emit(OpCodes.Ldarg_1);
346
context.
Generator
.Emit(OpCodes.Callvirt, CallSiteRuntimeResolverResolveMethod);
347
context.
Generator
.Emit(OpCodes.Ret);
350
context.
Generator
.MarkLabel(defaultLabel);
353
context.
Generator
.Emit(OpCodes.Stloc, cacheKeyLocal);
355
context.
Generator
.BeginExceptionBlock();
358
context.
Generator
.Emit(OpCodes.Ldarg_1);
360
context.
Generator
.Emit(OpCodes.Callvirt, ResolvedServicesGetter);
362
context.
Generator
.Emit(OpCodes.Stloc, resolvedServicesLocal);
365
context.
Generator
.Emit(OpCodes.Ldarg_1);
367
context.
Generator
.Emit(OpCodes.Callvirt, ScopeLockGetter);
369
context.
Generator
.Emit(OpCodes.Stloc, syncLocal);
372
context.
Generator
.Emit(OpCodes.Ldloc, syncLocal);
374
context.
Generator
.Emit(OpCodes.Ldloca, lockTakenLocal);
376
context.
Generator
.Emit(OpCodes.Call, ServiceLookupHelpers.MonitorEnterMethodInfo);
379
context.
Generator
.Emit(OpCodes.Ldloc, resolvedServicesLocal);
381
context.
Generator
.Emit(OpCodes.Ldloc, cacheKeyLocal);
383
context.
Generator
.Emit(OpCodes.Ldloca, resultLocal);
385
context.
Generator
.Emit(OpCodes.Callvirt, ServiceLookupHelpers.TryGetValueMethodInfo);
388
context.
Generator
.Emit(OpCodes.Brtrue, skipCreationLabel);
392
context.
Generator
.Emit(OpCodes.Stloc, resultLocal);
397
context.
Generator
.Emit(OpCodes.Ldloc, resultLocal);
404
context.
Generator
.Emit(OpCodes.Ldloc, resolvedServicesLocal);
406
context.
Generator
.Emit(OpCodes.Ldloc, cacheKeyLocal);
408
context.
Generator
.Emit(OpCodes.Ldloc, resultLocal);
410
context.
Generator
.Emit(OpCodes.Callvirt, ServiceLookupHelpers.AddMethodInfo);
412
context.
Generator
.MarkLabel(skipCreationLabel);
414
context.
Generator
.BeginFinallyBlock();
417
context.
Generator
.Emit(OpCodes.Ldloc, lockTakenLocal);
419
context.
Generator
.Emit(OpCodes.Brfalse, returnLabel);
421
context.
Generator
.Emit(OpCodes.Ldloc, syncLocal);
423
context.
Generator
.Emit(OpCodes.Call, ServiceLookupHelpers.MonitorExitMethodInfo);
425
context.
Generator
.MarkLabel(returnLabel);
427
context.
Generator
.EndExceptionBlock();
430
context.
Generator
.Emit(OpCodes.Ldloc, resultLocal);
432
context.
Generator
.Emit(OpCodes.Ret);
438
context.
Generator
.Emit(OpCodes.Ret);
450
argument.
Generator
.Emit(OpCodes.Ldarg_1);
456
argument.
Generator
.Emit(OpCodes.Callvirt, ServiceLookupHelpers.CaptureDisposableMethodInfo);