protected internal override void OnCompile() { Builder = this.TargetClass.Builder.DefineMethod(this.Name , this.Attributes , this.CallingConvention , (this.ReturnType != null) ? this.ReturnType.Target : null , this.ParameterTypes ); ILGenerator il = SetILGenerator(Builder.GetILGenerator()); try { CompileParameters(Builder); CompileLocals(il); ILHelper msil = new ILHelper(il); EmitInstructions(msil); if (_checkOverride != null) { if (_checkOverride.IsAbstract) { this.TargetClass.Builder.DefineMethodOverride(Builder, _checkOverride); } } msil.Return(); } finally { SetILGenerator(null); } }
protected internal override void OnCompile() { Builder = this.TargetClass.Builder.DefineConstructor(this.Attributes , this.CallingConvention, this.ParameterTypes ); ILGenerator il = SetILGenerator(Builder.GetILGenerator()); try { CompileParameters(Builder); CompileLocals(il); ILHelper msil = new ILHelper(il); base.EmitInstructions(msil); msil.Return(); } finally { SetILGenerator(il); } }
public void StoreValue(ILHelper il) { if (!IsCompiled) Compile(); il.StoreProperty(Builder, true); }
public void LoadValue(ILHelper il) { if (!IsCompiled) Compile(); il.LoadProperty(Builder, true); }
public void LoadAddress(ILHelper il) { throw new NotImplementedException(); }
public void StoreValue(ILHelper il) { Contracts.Require.IsNotNull("il", il); il.StoreProperty(_prop, false); }
public void LoadValue(ILHelper il) { Contracts.Require.IsNotNull("il", il); il.LoadProperty(_prop, false); }
public override void EmitCall(ILHelper il) { if (!IsCompiled) Compile(); il.Call(Builder); }
protected virtual void EmitInstructions(ILHelper il) { if (_gen != null) { foreach (Action<EmittedMethodBase, ILHelper> gen in _gen) { gen(this, il); } } }
public abstract void EmitCall(ILHelper il);
public void StoreValue(ILHelper il) { if (_builder == null) throw new InvalidOperationException("EmittedLocal not compiled: {0}"); il.StoreLocal(LocalIndex); }
public void LoadAddress(ILHelper il) { if (_builder == null) throw new InvalidOperationException("EmittedLocal not compiled: {0}"); il.LoadLocalAddress(LocalIndex); }
public void StoreValue(ILHelper il) { if (!this.IsCompiled) throw new InvalidOperationException("EmittedField not compiled: {0}"); il.StoreField(Builder); }
public void LoadAddress(ILHelper il) { if (!this.IsCompiled) throw new InvalidOperationException("EmittedField not compiled: {0}"); il.LoadFieldAddress(Builder); }