Beispiel #1
0
        public override void WriteTo(ref WASMWriter output)
        {
            output.WriteULEB128((uint)ParameterTypes.Count);
            foreach (Type parameterType in ParameterTypes)
            {
                output.Write(parameterType);
            }

            output.WriteULEB128((uint)ResultTypes.Count);
            foreach (Type resultType in ResultTypes)
            {
                output.Write(resultType);
            }
        }
Beispiel #2
0
 public override void WriteTo(ref WASMWriter output)
 {
     output.Write(HasMaximum);
     output.WriteULEB128(Minimum);
     if (HasMaximum)
     {
         output.WriteULEB128(Maximum);
     }
 }
Beispiel #3
0
 public override void WriteTo(ref WASMWriter output)
 {
     output.WriteULEB128(MemoryIndex);
     foreach (WASMInstruction instruction in Expression)
     {
         instruction.WriteTo(ref output);
     }
     output.WriteULEB128((uint)Package.Length);
     output.Write(Package);
 }
Beispiel #4
0
        protected override void WriteBodyTo(ref WASMWriter output)
        {
            const byte FUNCTION_TYPE = 0x60;

            output.WriteULEB128((uint)Count);
            foreach (FuncType functionType in this)
            {
                output.Write(FUNCTION_TYPE);
                functionType.WriteTo(ref output);
            }
        }
Beispiel #5
0
 public override void WriteTo(ref WASMWriter output)
 {
     output.WriteString(Module);
     output.WriteString(Name);
     output.Write((byte)Description);
     if (Description == ImpexDesc.Function)
     {
         output.WriteULEB128((uint)Value);
     }
     else
     {
         ((WASMObject)Value).WriteTo(ref output);
     }
 }
Beispiel #6
0
        public override void WriteTo(ref WASMWriter output)
        {
            int funcSize = 0;

            funcSize += WASMReader.GetULEB128Size((uint)Locals.Count);
            foreach (Local local in Locals)
            {
                funcSize += local.GetSize();
            }
            funcSize += Bytecode.Length;

            output.WriteULEB128((uint)funcSize);
            output.WriteULEB128((uint)Locals.Count);
            foreach (Local local in Locals)
            {
                local.WriteTo(ref output);
            }
            output.Write(Bytecode);
        }
Beispiel #7
0
 public override void WriteTo(ref WASMWriter output)
 {
     output.WriteULEB128(Rank);
     output.Write(Type);
 }
Beispiel #8
0
 protected override void WriteBodyTo(ref WASMWriter output)
 {
     output.Write(Constant);
 }
Beispiel #9
0
 protected override void WriteBodyTo(ref WASMWriter output)
 {
     output.Write(Index);
 }
Beispiel #10
0
 public override void WriteTo(ref WASMWriter output)
 {
     output.Write(ElementType);
     Limits.WriteTo(ref output);
 }
Beispiel #11
0
 public override void WriteTo(ref WASMWriter output)
 {
     output.WriteString(Name);
     output.Write((byte)Description);
     output.WriteULEB128(Index + (uint)(Description == ImpexDesc.Function ? (_functionOffsetProvider?.FunctionOffset ?? 0) : 0));
 }
Beispiel #12
0
 public override void WriteTo(ref WASMWriter output)
 {
     output.Write(ValueType);
     output.Write(IsMutable);
 }
Beispiel #13
0
 protected override void WriteBodyTo(ref WASMWriter output)
 {
     output.WriteString(Name);
     output.Write(Package);
 }
Beispiel #14
0
 protected override void WriteBodyTo(ref WASMWriter output)
 {
     output.WriteULEB128(TypeIndex);
     output.Write((byte)0);
 }