Ejemplo n.º 1
0
 /// <summary>
 /// Creates an operator that takes a single 32-bit signed integer immediate.
 /// </summary>
 /// <param name="opCode">The operator's opcode.</param>
 /// <param name="declaringType">A type that defines the operator, if any.</param>
 /// <param name="mnemonic">The operator's mnemonic.</param>
 public VarInt32Operator(byte opCode, WasmType declaringType, string mnemonic)
     : base(opCode, declaringType, mnemonic)
 {
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Creates a block instruction.
 /// </summary>
 /// <param name="op">The operator performed by the block instruction.</param>
 /// <param name="type">The block instruction's result type.</param>
 /// <param name="contents">The block instruction's contents, as a sequence of instructions.</param>
 public BlockInstruction(BlockOperator op, WasmType type, IEnumerable <Instruction> contents)
 {
     this.opValue  = op;
     this.Type     = type;
     this.Contents = new List <Instruction>(contents);
 }
Ejemplo n.º 3
0
 public Operator(byte OpCode, WasmType DeclaringType, string Mnemonic)
 {
     this.OpCode        = OpCode;
     this.DeclaringType = DeclaringType;
     this.Mnemonic      = Mnemonic;
 }
Ejemplo n.º 4
0
 public BlockInstruction(Operator Op, WasmType Type, IEnumerable <Instruction> Contents)
 {
     this.opValue  = Op;
     this.Type     = Type;
     this.Contents = new List <Instruction>(Contents);
 }
Ejemplo n.º 5
0
 /// <summary>
 /// Writes a textual representation of the given WebAssembly type to
 /// the given text writer.
 /// </summary>
 /// <param name="Value">The type to print to the text writer.</param>
 /// <param name="Writer">The writer to which the textual WebAssembly value type should be written.</param>
 public static void DumpWasmType(WasmType Value, TextWriter Writer)
 {
     Writer.Write(WasmTypeToString(Value));
 }
Ejemplo n.º 6
0
 /// <summary>
 /// Creates a break table operator.
 /// </summary>
 /// <param name="opCode">The operator's opcode.</param>
 /// <param name="declaringType">A type that defines the operator, if any.</param>
 /// <param name="mnemonic">The operator's mnemonic.</param>
 public BrTableOperator(byte opCode, WasmType declaringType, string mnemonic)
     : base(opCode, declaringType, mnemonic)
 {
 }
Ejemplo n.º 7
0
 private static string WasmTypeToIdentifier(WasmType Type)
 {
     return(((object)Type).ToString());
 }
Ejemplo n.º 8
0
 public Float64Operator(byte OpCode, WasmType DeclaringType, string Mnemonic)
     : base(OpCode, DeclaringType, Mnemonic)
 {
 }
Ejemplo n.º 9
0
 /// <summary>
 /// Creates a table description from the given element type and limits.
 /// </summary>
 /// <param name="ElementType">The table's element type.</param>
 /// <param name="Limits">The table's limits.</param>
 public TableType(WasmType ElementType, ResizableLimits Limits)
 {
     this.ElementType = ElementType;
     this.Limits      = Limits;
 }
Ejemplo n.º 10
0
 public VarUInt32Operator(byte OpCode, WasmType DeclaringType, string Mnemonic)
     : base(OpCode, DeclaringType, Mnemonic)
 {
 }
Ejemplo n.º 11
0
 public WasmLocalEntry(WasmType type, uint count)
 {
     Type  = type;
     Count = count;
 }
Ejemplo n.º 12
0
 /// <summary>
 /// Writes a WebAssembly language type.
 /// </summary>
 /// <param name="Value">The WebAssembly language type to write.</param>
 /// <returns>The number of bytes used to encode the type.</returns>
 public int WriteWasmType(WasmType Value)
 {
     return(WriteVarInt7((sbyte)Value));
 }
Ejemplo n.º 13
0
 /// <summary>
 /// Creates an operator.
 /// </summary>
 /// <param name="opCode">The operator's opcode.</param>
 /// <param name="declaringType">A type that defines the operator, if any.</param>
 /// <param name="mnemonic">The operator's mnemonic.</param>
 public Operator(byte opCode, WasmType declaringType, string mnemonic)
 {
     this.OpCode        = opCode;
     this.DeclaringType = declaringType;
     this.Mnemonic      = mnemonic;
 }