Пример #1
0
 private static IReadOnlyList <LNode> EncodeNewObject(NewObjectPrototype value, EncoderState state)
 {
     return(new LNode[]
     {
         state.Encode(value.Constructor)
     });
 }
Пример #2
0
 private static NewObjectPrototype DecodeNewObject(IReadOnlyList <LNode> data, DecoderState state)
 {
     return(NewObjectPrototype.Create(state.DecodeMethod(data[0])));
 }
Пример #3
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));
 }