private static BoxPrototype DecodeBox(IReadOnlyList <LNode> data, DecoderState state) { return(BoxPrototype.Create(state.DecodeType(data[0]))); }
private static IReadOnlyList <LNode> EncodeBox(BoxPrototype value, EncoderState state) { return(new LNode[] { state.Encode(value.ElementType) }); }
/// <summary> /// Creates an instruction that boxes a value type, /// turning it into a reference type (aka box pointer). /// </summary> /// <param name="elementType"> /// The type of value to box. /// </param> /// <param name="element"> /// The value to box. /// </param> /// <returns> /// A box instruction. /// </returns> public static Instruction CreateBox(IType elementType, ValueTag element) { return(BoxPrototype.Create(elementType).Instantiate(element)); }