コード例 #1
0
        public override void RenderIL_Load(ILCanvas canvas)
        {
            ILCanvasLabel end_label  = canvas.CreateLabel();
            ILCanvasLabel true_label = canvas.CreateLabel();

            foreach (ILValue value in values)
            {
                value.RenderIL_Load(canvas);
                true_label.Emit_Brtrue();
            }

            canvas.Emit_Ldc_I4(0);
            end_label.Emit_Br();

            true_label.Emit_Label();
            canvas.Emit_Ldc_I4(1);

            end_label.Emit_Label();
        }
コード例 #2
0
        public override void RenderIL_Load(ILCanvas canvas)
        {
            BasicType basic_type = value_type.GetBasicType();

            switch (basic_type)
            {
            case BasicType.Bool: canvas.Emit_Ldc_I4(0); break;

            case BasicType.SByte: canvas.Emit_Ldc_I4(0); break;

            case BasicType.Short: canvas.Emit_Ldc_I4(0); break;

            case BasicType.Int: canvas.Emit_Ldc_I4(0); break;

            case BasicType.Long: canvas.Emit_Ldc_I8(0); break;

            case BasicType.Byte: canvas.Emit_Ldc_U4(0); break;

            case BasicType.UShort: canvas.Emit_Ldc_U4(0); break;

            case BasicType.UInt: canvas.Emit_Ldc_U4(0); break;

            case BasicType.ULong: canvas.Emit_Ldc_U8(0); break;

            case BasicType.Float: canvas.Emit_Ldc_R4(0.0f); break;

            case BasicType.Double: canvas.Emit_Ldc_R8(0.0); break;

            case BasicType.Char: canvas.Emit_Ldc_I4(0); break;

            case BasicType.String: canvas.Emit_Ldstr(""); break;

            case BasicType.Array: canvas.Emit_Ldnull(); break;

            case BasicType.Enum: canvas.Emit_Ldc_I4(0); break;

            case BasicType.Class: canvas.Emit_Ldnull(); break;

            case BasicType.Struct:
                canvas.UseLocal(value_type, delegate(ILLocal local) {
                    local.RenderIL_LoadAddress(canvas);
                    canvas.Emit_Initobj(value_type);
                    local.RenderIL_Load(canvas);
                });
                break;

            default: throw new UnaccountedBranchException("basic_type", basic_type);
            }
        }
コード例 #3
0
 public override void RenderIL_Load(ILCanvas canvas)
 {
     canvas.Emit_Ldc_I4(constant);
 }
コード例 #4
0
 public override void RenderIL_Load(ILCanvas canvas)
 {
     canvas.Emit_Ldc_I4(constant.ConvertBool(1, 0));
 }