public override void RenderIL_Store(ILCanvas canvas, ILValue target, ILValue index, ILValue value) { target.RenderIL_Load(canvas); index.RenderIL_Load(canvas); value.GetILImplicitCast(GetElementType()) .RenderIL_Load(canvas); canvas.Emit_Stelem_Ref(); }
public override void EmitStore(ILCanvas canvas, ILValue target, ILValue to_store) { if (method_pair.CanSet()) { method_pair.EmitStore(canvas, target, to_store); } else if (backing_field != null) { backing_field.EmitStore(canvas, target, to_store); } }
static public void UseValue(this ILCanvas item, ILValue value, Process <ILValue> process) { if (value.IsILCostTrivial()) { process(value); } else { item.UseLocalValue(value, l => process(l)); } }
public override void EmitLoad(ILCanvas canvas, ILValue target) { if (method_pair.CanGet()) { method_pair.EmitLoad(canvas, target); } else if (backing_field != null) { backing_field.EmitLoad(canvas, target); } }
static public void RenderIL_LoadAddress(this ILValue item, ILCanvas canvas) { ILAddressable cast; if (item.Convert <ILAddressable>(out cast)) { cast.RenderIL_LoadAddress(canvas); } else { item.RenderIL_LoadAddressInternal(canvas); } }
public ILLocal CreateCementedLocal(ILValue value) { ILLocal local; if (value.Convert <ILLocal>(out local)) { if (local.IsCemented()) { return(local); } } return(cemented_locals.AddAndGet(new ILLocal(value.GetValueType(), null, value, true)) .Chain(l => AddStatement(new ILInitializeLocal(l)))); }
public override void RenderIL_Store(ILCanvas canvas, ILValue value) { if (field.IsInstanceField()) { RenderIL_LoadTarget(canvas); value.GetILImplicitCast(field.FieldType) .RenderIL_Load(canvas); canvas.Emit_Stfld(field); } else { value.GetILImplicitCast(field.FieldType) .RenderIL_Load(canvas); canvas.Emit_Stsfld(field); } }
public ILStatement GenerateStatement(ILValue value, IList <ILCase> cases, ILStatement else_statement, int min_index, int max_index, int index) { int less_index = (index + min_index) / 2; int greater_index = (index + max_index) / 2; if (index == min_index || index == max_index) { return(new ILIf( value.GetILEqualTo(label), statement, else_statement )); } return(new ILIf( value.GetILLessThan(label), cases[less_index].GenerateStatement(value, cases, else_statement, min_index, index, less_index), cases[greater_index].GenerateStatement(value, cases, else_statement, index, max_index, greater_index) )); }
public override void EmitCastAddress(ILCanvas canvas, ILValue value) { value.RenderIL_LoadAddress(canvas); }
public override void RenderIL_Operate(ILCanvas canvas, ILValue input) { LoadValue(canvas, input); canvas.Emit_Neg(); }
static public ILConstructorInvokation GetBaseILConstructor(this ILValue item, params ILValue[] arguments) { return(item.GetBaseILConstructor((IEnumerable <ILValue>)arguments)); }
static public ILConstructorInvokation GetILConstructorInvokation(this ILValue item, ConstructorInfo constructor, params ILValue[] arguments) { return(item.GetILConstructorInvokation(constructor, (IEnumerable <ILValue>)arguments)); }
public ILReturn(ILValue v) { value = v; }
public ILWhile(ILValue c, ILStatement w) { condition = c; while_statement = w; }
public override void EmitStore(ILCanvas canvas, ILValue target, ILValue to_store) { new ILField(target, field_info).RenderIL_Store(canvas, to_store); }
public override void RenderIL_Operate(ILCanvas canvas, ILValue left, ILValue right) { typeof(string).GetStaticILMethodInvokation("Concat", left, right).RenderIL_Load(canvas); }
static public void RenderIL_LoadAddressInternal(this ILValue item, ILCanvas canvas) { item.RenderIL_Load(canvas); canvas.MakeAddressImmediate(item.GetValueType()); }
static public ILField GetILField(this ILValue item, string name) { return(item.GetILField(item.GetValueType().GetInstanceField(name))); }
static public ILField GetILField(this ILValue item, FieldInfo field) { return(field.IfNotNull(f => new ILField(item, f))); }
static public ILStatement CreateILCalculate(this ILValue item) { return(item.IfNotNull(i => new ILCalculate(i))); }
public override void RenderIL_Operate(ILCanvas canvas, ILValue left, ILValue right) { LoadValues(canvas, left, right); canvas.Emit_Cgtoe(); }
public ILAssignArray(ILValue a, IEnumerable <ILValue> v) { array = a; values = v.ToList(); }
public override void RenderIL_Operate(ILCanvas canvas, ILValue left, ILValue right) { typeof(ObjectExtensions_Compare).GetStaticILMethodInvokation("NotEqualsEX", left, right).RenderIL_Load(canvas); }
public ILAssign(ILValue d, ILValue s) { destination = d; source = s; }
public override void EmitLoadAddress(ILCanvas canvas, ILValue target) { new ILField(target, field_info).RenderIL_LoadAddress(canvas); }
static public BasicType GetValueBasicType(this ILValue item) { return(item.GetValueType().GetBasicType()); }
public override void EmitCast(ILCanvas canvas, ILValue value) { value.RenderIL_Load(canvas); canvas.Emit_Conv_R8(); }
static public ILValue GetILIsNotNull(this ILValue item) { return(item.GetILNotEqualTo(ILNull.INSTANCE)); }
public override void EmitCast(ILCanvas canvas, ILValue value) { value.RenderIL_Load(canvas); canvas.Emit_Unbox_Any(GetDestinationType()); }
static public ILConstructorInvokation GetILConstructorInvokation(this ILValue item, ConstructorInfo constructor, IEnumerable <ILValue> arguments) { return(constructor.IfNotNull(c => new ILConstructorInvokation(item, constructor, arguments))); }