NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

ILGenerator.Emit

Puts an instruction onto the instruction stream for the JIT compiler. If the opcode requires an argument, the caller must ensure that the argument length matches the length of the declared parameter. Otherwise, results will be unpredictable. For example, if the Emit instruction requires a 2-byte operand and the caller supplies a 4-byte operand, the runtime will emit two additional bytes to the instruction stream. These extra bytes will be Opcodes.Nop instructions.

Overload List

Puts the specified instruction onto the stream and leaves space to include a Label when fixes are done.

Emits a switch table.

[Visual Basic] Overloads Overridable Public Sub Emit(OpCode, Label())
[C#] public virtual void Emit(OpCode, Label[]);
[C++] public: virtual void Emit(OpCode, Label[]);
[JScript] public function Emit(OpCode, Label[]);

Puts the specified instruction and metadata token for the specified field onto the stream of instructions.

[Visual Basic] Overloads Overridable Public Sub Emit(OpCode, FieldInfo)
[C#] public virtual void Emit(OpCode, FieldInfo);
[C++] public: virtual void Emit(OpCode, FieldInfo);
[JScript] public function Emit(OpCode, FieldInfo);

Puts the specified instruction onto the IL stream followed by the metadata token for the given string.

[Visual Basic] Overloads Overridable Public Sub Emit(OpCode, String)
[C#] public virtual void Emit(OpCode, String);
[C++] public: virtual void Emit(OpCode, String);
[JScript] public function Emit(OpCode, String);

Puts the specified instruction onto the stream and leaves space to include a Label when fixes are done.

[Visual Basic] Overloads Overridable Public Sub Emit(OpCode, Label)
[C#] public virtual void Emit(OpCode, Label);
[C++] public: virtual void Emit(OpCode, Label);
[JScript] public function Emit(OpCode, Label);

Puts the specified instruction and numerical argument onto the stream of instructions.

[Visual Basic] Overloads Overridable Public Sub Emit(OpCode, Integer)
[C#] public virtual void Emit(OpCode, short);
[C++] public: virtual void Emit(OpCode, short);
[JScript] public function Emit(OpCode, Int16);

Puts the specified instruction and numerical argument onto the stream of instructions.

[Visual Basic] Overloads Overridable Public Sub Emit(OpCode, Integer)
[C#] public virtual void Emit(OpCode, int);
[C++] public: virtual void Emit(OpCode, int);
[JScript] public function Emit(OpCode, int);

Puts the specified instruction onto the IL stream followed by the metadata token for the given method.

[Visual Basic] Overloads Overridable Public Sub Emit(OpCode, MethodInfo)
[C#] public virtual void Emit(OpCode, MethodInfo);
[C++] public: virtual void Emit(OpCode, MethodInfo);
[JScript] public function Emit(OpCode, MethodInfo);

Puts the specified instruction and character argument onto the stream of instructions.

[Visual Basic] Overloads Public Sub Emit(OpCode, SByte)
[C#] public void Emit(OpCode, sbyte);
[C++] public: void Emit(OpCode, char);
[JScript] public function Emit(OpCode, SByte);

Puts the specified instruction onto the stream of instructions.

[Visual Basic] Overloads Overridable Public Sub Emit(OpCode)
[C#] public virtual void Emit(OpCode);
[C++] public: virtual void Emit(OpCode);
[JScript] public function Emit(OpCode);

Puts the specified instruction and character argument onto the stream of instructions.

[Visual Basic] Overloads Overridable Public Sub Emit(OpCode, Byte)
[C#] public virtual void Emit(OpCode, byte);
[C++] public: virtual void Emit(OpCode, unsigned char);
[JScript] public function Emit(OpCode, Byte);

Puts the specified instruction and numerical argument onto the stream of instructions.

[Visual Basic] Overloads Overridable Public Sub Emit(OpCode, Long)
[C#] public virtual void Emit(OpCode, long);
[C++] public: virtual void Emit(OpCode, __int64);
[JScript] public function Emit(OpCode, long);

Puts the specified instruction and numerical argument onto the stream of instructions.

[Visual Basic] Overloads Overridable Public Sub Emit(OpCode, Single)
[C#] public virtual void Emit(OpCode, float);
[C++] public: virtual void Emit(OpCode, float);
[JScript] public function Emit(OpCode, float);

Puts the specified instruction and numerical argument onto the stream of instructions.

[Visual Basic] Overloads Overridable Public Sub Emit(OpCode, Double)
[C#] public virtual void Emit(OpCode, double);
[C++] public: virtual void Emit(OpCode, double);
[JScript] public function Emit(OpCode, double);

Puts the specified instruction and a signature token onto the stream of instructions.

[Visual Basic] Overloads Overridable Public Sub Emit(OpCode, SignatureHelper)
[C#] public virtual void Emit(OpCode, SignatureHelper);
[C++] public: virtual void Emit(OpCode, SignatureHelper);
[JScript] public function Emit(OpCode, SignatureHelper);

Puts the specified instruction and metadata token for the specified constructor onto the stream of instructions.

[Visual Basic] Overloads Overridable Public Sub Emit(OpCode, ConstructorInfo)
[C#] public virtual void Emit(OpCode, ConstructorInfo);
[C++] public: virtual void Emit(OpCode, ConstructorInfo);
[JScript] public function Emit(OpCode, ConstructorInfo);

Puts the specified instruction onto the IL stream followed by the metadata token for the given type.

[Visual Basic] Overloads Overridable Public Sub Emit(OpCode, Type)
[C#] public virtual void Emit(OpCode, Type);
[C++] public: virtual void Emit(OpCode, Type);
[JScript] public function Emit(OpCode, Type);

Puts the specified instruction onto the IL stream followed by the metadata token for the given local variable.

[Visual Basic] Overloads Overridable Public Sub Emit(OpCode, LocalBuilder)
[C#] public virtual void Emit(OpCode, LocalBuilder);
[C++] public: virtual void Emit(OpCode, LocalBuilder);
[JScript] public function Emit(OpCode, LocalBuilder);

See Also

ILGenerator Class | ILGenerator Members | System.Reflection.Emit Namespace