Пример #1
0
        int SerializeEnvFrame(VmEnvFrame frame, object obj)
        {
            var composite = new Composite {
                Kind     = ObjectTypes.EnvFrame,
                Elements = new int[3]
            };
            var result = SerializeOneHashed(composite, obj);

            composite.Elements [0] = Serialize(frame.VarNames);
            composite.Elements [1] = Serialize(frame.Values);
            composite.Elements [2] = SerializeOne(frame.IntroducedAtProgramCounter);
            return(result);
        }
Пример #2
0
        VmEnvFrame RebuildEnvFrame(
            object[] objects, int index, Composite composite, Func <int, object> reader)
        {
            var result = new VmEnvFrame();

            objects [index] = result;

            result.VarNames = (string[])reader(composite.Elements [0]);
            result.Values   = (Value[])reader(composite.Elements [1]);
            result.IntroducedAtProgramCounter = (int)(long)reader(composite.Elements [2]);

            return(result);
        }