private static IReadOnlyList <LNode> EncodeNewObject(NewObjectPrototype value, EncoderState state) { return(new LNode[] { state.Encode(value.Constructor) }); }
private static NewObjectPrototype DecodeNewObject(IReadOnlyList <LNode> data, DecoderState state) { return(NewObjectPrototype.Create(state.DecodeMethod(data[0]))); }
/// <summary> /// Creates a new-object instruction that allocates storage on the /// heap for an object and initializes it using a constructor. /// </summary> /// <param name="constructor"> /// The constructor to initialize objects with. /// </param> /// <param name="arguments"> /// A list of arguments to call the constructor with. /// </param> /// <returns> /// A new-object instruction. /// </returns> public static Instruction CreateNewObject( IMethod constructor, IReadOnlyList <ValueTag> arguments) { return(NewObjectPrototype.Create(constructor).Instantiate(arguments)); }