예제 #1
0
 public void Dispose()
 {
     if (Local == null)
     {
         return;
     }
     _parent._localsPool.Add((_type, Local));
     Local = null;
 }
예제 #2
0
 public ILEmitContext(IXamlILEmitter emitter, TransformerConfiguration configuration,
                      XamlLanguageEmitMappings <IXamlILEmitter, XamlILNodeEmitResult> emitMappings,
                      XamlRuntimeContext <IXamlILEmitter, XamlILNodeEmitResult> runtimeContext,
                      IXamlLocal contextLocal,
                      Func <string, IXamlType, IXamlTypeBuilder <IXamlILEmitter> > createSubType, IFileSource file, IEnumerable <object> emitters)
     : base(emitter, configuration, emitMappings, runtimeContext,
            contextLocal, createSubType, file, emitters)
 {
     EnableIlVerification = configuration.GetOrCreateExtra <ILEmitContextSettings>().EnableILVerification;
 }
 public XamlEmitContextWithLocals(TBackendEmitter emitter,
                                  TransformerConfiguration configuration,
                                  XamlLanguageEmitMappings <TBackendEmitter, TEmitResult> emitMappings,
                                  XamlRuntimeContext <TBackendEmitter, TEmitResult> runtimeContext,
                                  IXamlLocal contextLocal,
                                  Func <string, IXamlType, IXamlTypeBuilder <TBackendEmitter> > createSubType,
                                  IFileSource file,
                                  IEnumerable <object> emitters)
     : base(emitter, configuration, emitMappings, runtimeContext, contextLocal, createSubType, file, emitters)
 {
 }
예제 #4
0
 public XamlEmitContext(TBackendEmitter emitter, TransformerConfiguration configuration,
                        XamlLanguageEmitMappings <TBackendEmitter, TEmitResult> emitMappings,
                        XamlRuntimeContext <TBackendEmitter, TEmitResult> runtimeContext,
                        IXamlLocal contextLocal,
                        Func <string, IXamlType, IXamlTypeBuilder <TBackendEmitter> > createSubType, IFileSource file,
                        IEnumerable <object> emitters)
 {
     File           = file;
     Emitter        = emitter;
     Emitters       = emitters.ToList();
     Configuration  = configuration;
     RuntimeContext = runtimeContext;
     ContextLocal   = contextLocal;
     CreateSubType  = createSubType;
     EmitMappings   = emitMappings;
 }
예제 #5
0
 public static IXamlILEmitter Stloc(this IXamlILEmitter emitter, IXamlLocal local)
 => emitter.Emit(OpCodes.Stloc, local);
예제 #6
0
 public static IXamlILEmitter Ldloca(this IXamlILEmitter emitter, IXamlLocal local)
 => emitter.Emit(OpCodes.Ldloca, local);
예제 #7
0
 public IXamlILEmitter Emit(OpCode code, IXamlLocal local)
 {
     _ilg.Emit(code, ((SreLocal)local).Local);
     return(this);
 }
 public IXamlILEmitter Emit(OpCode code, IXamlLocal local)
 {
     Record(code, local);
     _inner.Emit(code, local);
     return(this);
 }
예제 #9
0
 public static void EmitConvert(XamlEmitContextWithLocals <IXamlILEmitter, XamlILNodeEmitResult> context, IXamlILEmitter ilgen, IXamlLineInfo node, IXamlType what,
                                IXamlType to, IXamlLocal local)
 {
     EmitConvert(context, node, what, to, lda => ilgen.Emit(lda ? OpCodes.Ldloca : OpCodes.Ldloc, local));
 }
예제 #10
0
 public IXamlILEmitter Emit(SreOpCode code, IXamlLocal local)
 => Emit(Instruction.Create(Dic[code], ((CecilLocal)local).Variable));
예제 #11
0
 public PooledLocal(XamlLocalsPool parent, IXamlType type, IXamlLocal local)
 {
     Local   = local;
     _parent = parent;
     _type   = type;
 }