public override List <HighLevel.Instruction> GetHighLevel(HighLevel.HlGraph Context)
        {
            List <HighLevel.Instruction> List = new List <HighLevel.Instruction>();

            HighLevel.Node Result;
            if (FieldInfo.IsStatic)
            {
                Result = new HighLevel.LocationNode(Context.StaticFieldLocation(FieldInfo));
            }
            else
            {
                Result = new HighLevel.InstanceFieldNode(Context.ReadStackLocationNode(Context.StackPointer - 1), FieldInfo);
            }

            List.Add(new HighLevel.AssignmentInstruction(Result, Context.ReadStackLocationNode(Context.StackPointer)));
            return(List);
        }
        public override List <HighLevel.Instruction> GetHighLevel(HighLevel.HlGraph Context)
        {
            List <HighLevel.Instruction> List = new List <HighLevel.Instruction>();

            HighLevel.Node Argument;
            if (FieldInfo.IsStatic)
            {
                Argument = new HighLevel.LocationNode(Context.StaticFieldLocation(FieldInfo));
            }
            else
            {
                Argument = new HighLevel.InstanceFieldNode(Context.ReadStackLocationNode(Context.StackPointer), FieldInfo);
            }

            List.Add(new HighLevel.AssignmentInstruction(Context.DefineStackLocationNode(m_WithoutThis ? Context.StackPointer + 1 : Context.StackPointer), Argument));
            return(List);
        }
示例#3
0
        public override List <HighLevel.Instruction> GetHighLevel(HighLevel.HlGraph Context)
        {
            List <HighLevel.Instruction> List = new List <HighLevel.Instruction>();

            HighLevel.Node Argument;
            if (FieldInfo.IsStatic)
            {
                Argument = new HighLevel.LocationNode(Context.StaticFieldLocation(FieldInfo));
            }
            else
            {
                Argument = new HighLevel.InstanceFieldNode(Context.ReadStackLocationNode(Context.StackPointer), FieldInfo);
            }

            bool isStruct = FieldInfo.FieldType.IsValueType && !FieldInfo.FieldType.IsPrimitive && !FieldInfo.FieldType.IsEnum;

            if (!isStruct)
            {
                Argument = new HighLevel.AddressOfNode(Argument);
            }

            List.Add(new HighLevel.AssignmentInstruction(Context.DefineStackLocationNode(Context.StackPointer), Argument));
            return(List);
        }