public override void RenderIL_Store(ILCanvas canvas, ILValue value) { value.GetILImplicitCast(GetValueType()) .RenderIL_Load(canvas); canvas.Emit_Starg(GetArgIndex(canvas)); }
public override void RenderIL_Execute(ILCanvas canvas) { ILCanvasLabel exit_label = canvas.CreateLabel(); condition.GetILImplicitCast(typeof(bool)) .RenderIL_Load(canvas); if (HasElse()) { ILCanvasLabel false_label = canvas.CreateLabel(); false_label.Emit_Brfalse(); if_true_statement.RenderIL_Execute(canvas); exit_label.Emit_Br(); false_label.Emit_Label(); if_false_statement.RenderIL_Execute(canvas); } else { exit_label.Emit_Brfalse(); if_true_statement.RenderIL_Execute(canvas); } exit_label.Emit_Label(); }
public override void RenderIL_Load(ILCanvas canvas) { if (method.IsEffectivelyInstanceMethod() && caller != null) { caller.GetILImplicitCast(method.GetILMethodInvokationType()) .RenderIL_Load(canvas); arguments.GetILImplicitCasts(method.GetEffectiveParameterTypes()) .RenderIL_Load(canvas); if (method.IsTechnicallyInstanceMethod() && method.DeclaringType.IsReferenceType()) { canvas.Emit_Callvirt(method); } else { canvas.Emit_Call(method); } } else { arguments.GetILImplicitCasts(method.GetTechnicalParameterTypes()) .RenderIL_Load(canvas); canvas.Emit_Call(method); } }
public override void RenderIL_Execute(ILCanvas canvas) { if (value != null) { value.GetILImplicitCast(canvas.GetMethod().GetReturnType()) .RenderIL_Load(canvas); } canvas.Emit_Ret(); }
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_I4(); }
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 override void RenderIL_Execute(ILCanvas canvas) { ILCanvasLabel entry_label = canvas.CreateLabel(); ILCanvasLabel exit_label = canvas.CreateLabel(); entry_label.Emit_Label(); condition.GetILImplicitCast(typeof(bool)) .RenderIL_Load(canvas); exit_label.Emit_Brfalse(); while_statement.RenderIL_Execute(canvas); entry_label.Emit_Br(); exit_label.Emit_Label(); }
static public ILValue GetILIsFalse(this ILValue item) { return(item.GetILImplicitCast(typeof(bool)).GetILLogicalNegated()); }
static public ILValue GetILIsTrue(this ILValue item) { return(item.GetILImplicitCast(typeof(bool))); }
protected void LoadValues(ILCanvas canvas, ILValue left, ILValue right) { left.GetILImplicitCast(input_type).RenderIL_Load(canvas); right.GetILImplicitCast(input_type).RenderIL_Load(canvas); }
protected void LoadValue(ILCanvas canvas, ILValue input) { input.GetILImplicitCast(input_type).RenderIL_Load(canvas); }
private void RenderIL_LoadTarget(ILCanvas canvas) { target.GetILImplicitCast(field.GetILFieldInvokationType()) .RenderIL_Load(canvas); }