C# Класс Mono.CSharp.EmitContext

An Emit Context is created for each body of code (from methods, properties bodies, indexer bodies or constructor bodies)
Наследование: BuilderContext
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
CurrentAnonymousMethod AnonymousExpression
DefaultTarget System.Reflection.Emit.Label
HasReturnLabel bool
LoopBegin System.Reflection.Emit.Label
MemberContext IMemberContext
ReturnLabel System.Reflection.Emit.Label
Switch Switch
ig System.Reflection.Emit.ILGenerator
return_value System.Reflection.Emit.LocalBuilder

Private Properties

Свойство Тип Описание

Открытые методы

Метод Описание
BeginCatchBlock ( System.TypeSpec type ) : void
BeginExceptionBlock ( ) : void
BeginFinallyBlock ( ) : void
BeginScope ( ) : void
CreateDynamicSite ( ) : DynamicSiteClass
DeclareLocal ( System.TypeSpec type, bool pinned ) : LocalBuilder
DefineLabel ( ) : Label
DefineLocalVariable ( string name, LocalBuilder builder ) : void
Emit ( OpCode opcode ) : void
Emit ( OpCode opcode, FieldSpec field ) : void
Emit ( OpCode opcode, Label label ) : void
Emit ( OpCode opcode, LocalBuilder local ) : void
Emit ( OpCode opcode, MethodInfo method ) : void
Emit ( OpCode opcode, MethodSpec method ) : void
Emit ( OpCode opcode, MethodSpec method, Type vargs ) : void
Emit ( OpCode opcode, System.TypeSpec type ) : void
Emit ( OpCode opcode, byte arg ) : void
Emit ( OpCode opcode, double arg ) : void
Emit ( OpCode opcode, float arg ) : void
Emit ( OpCode opcode, int arg ) : void
Emit ( OpCode opcode, string arg ) : void
EmitArrayAddress ( ArrayContainer ac ) : void
EmitArrayLoad ( ArrayContainer ac ) : void
EmitArrayNew ( ArrayContainer ac ) : void
EmitArrayStore ( ArrayContainer ac ) : void
EmitContext ( IMemberContext rc, ILGenerator ig, System.TypeSpec return_type ) : System
EmitInt ( int i ) : void
EmitLoadFromPtr ( System.TypeSpec t ) : void
EmitLong ( long l ) : void
EmitStoreFromPtr ( System.TypeSpec type ) : void
EndExceptionBlock ( ) : void
EndScope ( ) : void
FreeTemporaryLocal ( LocalBuilder b, System.TypeSpec t ) : void
GetTemporaryLocal ( System.TypeSpec t ) : LocalBuilder

Returns a temporary storage for a variable of type t as a local variable in the current body.

Mark ( Mono.CSharp.Location loc ) : void

This is called immediately before emitting an IL opcode to tell the symbol writer to which source line this opcode belongs.

MarkLabel ( Label label ) : void
TemporaryReturn ( ) : LocalBuilder

ReturnValue creates on demand the LocalBuilder for the return value from the function. By default this is not used. This is only required when returns are found inside Try or Catch statements. This method is typically invoked from the Emit phase, so we allow the creation of a return label if it was not requested during the resolution phase. Could be cleaned up, but it would replicate a lot of logic in the Emit phase of the code that uses it.

Описание методов

BeginCatchBlock() публичный Метод

public BeginCatchBlock ( System.TypeSpec type ) : void
type System.TypeSpec
Результат void

BeginExceptionBlock() публичный Метод

public BeginExceptionBlock ( ) : void
Результат void

BeginFinallyBlock() публичный Метод

public BeginFinallyBlock ( ) : void
Результат void

BeginScope() публичный Метод

public BeginScope ( ) : void
Результат void

CreateDynamicSite() публичный Метод

public CreateDynamicSite ( ) : DynamicSiteClass
Результат DynamicSiteClass

DeclareLocal() публичный Метод

public DeclareLocal ( System.TypeSpec type, bool pinned ) : LocalBuilder
type System.TypeSpec
pinned bool
Результат System.Reflection.Emit.LocalBuilder

DefineLabel() публичный Метод

public DefineLabel ( ) : Label
Результат System.Reflection.Emit.Label

DefineLocalVariable() публичный Метод

public DefineLocalVariable ( string name, LocalBuilder builder ) : void
name string
builder System.Reflection.Emit.LocalBuilder
Результат void

Emit() публичный Метод

public Emit ( OpCode opcode ) : void
opcode OpCode
Результат void

Emit() публичный Метод

public Emit ( OpCode opcode, FieldSpec field ) : void
opcode OpCode
field FieldSpec
Результат void

Emit() публичный Метод

public Emit ( OpCode opcode, Label label ) : void
opcode OpCode
label System.Reflection.Emit.Label
Результат void

Emit() публичный Метод

public Emit ( OpCode opcode, LocalBuilder local ) : void
opcode OpCode
local System.Reflection.Emit.LocalBuilder
Результат void

Emit() публичный Метод

public Emit ( OpCode opcode, MethodInfo method ) : void
opcode OpCode
method MethodInfo
Результат void

Emit() публичный Метод

public Emit ( OpCode opcode, MethodSpec method ) : void
opcode OpCode
method MethodSpec
Результат void

Emit() публичный Метод

public Emit ( OpCode opcode, MethodSpec method, Type vargs ) : void
opcode OpCode
method MethodSpec
vargs IKVM.Reflection.Type
Результат void

Emit() публичный Метод

public Emit ( OpCode opcode, System.TypeSpec type ) : void
opcode OpCode
type System.TypeSpec
Результат void

Emit() публичный Метод

public Emit ( OpCode opcode, byte arg ) : void
opcode OpCode
arg byte
Результат void

Emit() публичный Метод

public Emit ( OpCode opcode, double arg ) : void
opcode OpCode
arg double
Результат void

Emit() публичный Метод

public Emit ( OpCode opcode, float arg ) : void
opcode OpCode
arg float
Результат void

Emit() публичный Метод

public Emit ( OpCode opcode, int arg ) : void
opcode OpCode
arg int
Результат void

Emit() публичный Метод

public Emit ( OpCode opcode, string arg ) : void
opcode OpCode
arg string
Результат void

EmitArrayAddress() публичный Метод

public EmitArrayAddress ( ArrayContainer ac ) : void
ac ArrayContainer
Результат void

EmitArrayLoad() публичный Метод

public EmitArrayLoad ( ArrayContainer ac ) : void
ac ArrayContainer
Результат void

EmitArrayNew() публичный Метод

public EmitArrayNew ( ArrayContainer ac ) : void
ac ArrayContainer
Результат void

EmitArrayStore() публичный Метод

public EmitArrayStore ( ArrayContainer ac ) : void
ac ArrayContainer
Результат void

EmitContext() публичный Метод

public EmitContext ( IMemberContext rc, ILGenerator ig, System.TypeSpec return_type ) : System
rc IMemberContext
ig System.Reflection.Emit.ILGenerator
return_type System.TypeSpec
Результат System

EmitInt() публичный Метод

public EmitInt ( int i ) : void
i int
Результат void

EmitLoadFromPtr() публичный Метод

public EmitLoadFromPtr ( System.TypeSpec t ) : void
t System.TypeSpec
Результат void

EmitLong() публичный Метод

public EmitLong ( long l ) : void
l long
Результат void

EmitStoreFromPtr() публичный Метод

public EmitStoreFromPtr ( System.TypeSpec type ) : void
type System.TypeSpec
Результат void

EndExceptionBlock() публичный Метод

public EndExceptionBlock ( ) : void
Результат void

EndScope() публичный Метод

public EndScope ( ) : void
Результат void

FreeTemporaryLocal() публичный Метод

public FreeTemporaryLocal ( LocalBuilder b, System.TypeSpec t ) : void
b System.Reflection.Emit.LocalBuilder
t System.TypeSpec
Результат void

GetTemporaryLocal() публичный Метод

Returns a temporary storage for a variable of type t as a local variable in the current body.
public GetTemporaryLocal ( System.TypeSpec t ) : LocalBuilder
t System.TypeSpec
Результат System.Reflection.Emit.LocalBuilder

Mark() публичный Метод

This is called immediately before emitting an IL opcode to tell the symbol writer to which source line this opcode belongs.
public Mark ( Mono.CSharp.Location loc ) : void
loc Mono.CSharp.Location
Результат void

MarkLabel() публичный Метод

public MarkLabel ( Label label ) : void
label System.Reflection.Emit.Label
Результат void

TemporaryReturn() публичный Метод

ReturnValue creates on demand the LocalBuilder for the return value from the function. By default this is not used. This is only required when returns are found inside Try or Catch statements. This method is typically invoked from the Emit phase, so we allow the creation of a return label if it was not requested during the resolution phase. Could be cleaned up, but it would replicate a lot of logic in the Emit phase of the code that uses it.
public TemporaryReturn ( ) : LocalBuilder
Результат System.Reflection.Emit.LocalBuilder

Описание свойств

CurrentAnonymousMethod публичное свойство

Whether we are inside an anonymous method.
public AnonymousExpression,Mono.CSharp CurrentAnonymousMethod
Результат AnonymousExpression

DefaultTarget публичное свойство

Default target in a switch statement. Only valid if InSwitch is true
public Label,System.Reflection.Emit DefaultTarget
Результат System.Reflection.Emit.Label

HasReturnLabel публичное свойство

If we already defined the ReturnLabel
public bool HasReturnLabel
Результат bool

LoopBegin публичное свойство

Current loop begin and end labels.
public Label,System.Reflection.Emit LoopBegin
Результат System.Reflection.Emit.Label

MemberContext публичное свойство

public IMemberContext MemberContext
Результат IMemberContext

ReturnLabel публичное свойство

The location where return has to jump to return the value
public Label,System.Reflection.Emit ReturnLabel
Результат System.Reflection.Emit.Label

Switch публичное свойство

If this is non-null, points to the current switch statement
public Switch Switch
Результат Switch

ig публичное свойство

public ILGenerator,System.Reflection.Emit ig
Результат System.Reflection.Emit.ILGenerator

return_value публичное свойство

The location where we store the return value.
public LocalBuilder,System.Reflection.Emit return_value
Результат System.Reflection.Emit.LocalBuilder