C# Class Mono.CSharp.EmitContext

An Emit Context is created for each body of code (from methods, properties bodies, indexer bodies or constructor bodies)
Inheritance: BuilderContext
显示文件 Open project: kumpera/mono Class Usage Examples

Public Properties

Property Type Description
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

Property Type Description

Public Methods

Method Description
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.

Method Details

BeginCatchBlock() public method

public BeginCatchBlock ( System.TypeSpec type ) : void
type System.TypeSpec
return void

BeginExceptionBlock() public method

public BeginExceptionBlock ( ) : void
return void

BeginFinallyBlock() public method

public BeginFinallyBlock ( ) : void
return void

BeginScope() public method

public BeginScope ( ) : void
return void

CreateDynamicSite() public method

public CreateDynamicSite ( ) : DynamicSiteClass
return DynamicSiteClass

DeclareLocal() public method

public DeclareLocal ( System.TypeSpec type, bool pinned ) : LocalBuilder
type System.TypeSpec
pinned bool
return System.Reflection.Emit.LocalBuilder

DefineLabel() public method

public DefineLabel ( ) : Label
return System.Reflection.Emit.Label

DefineLocalVariable() public method

public DefineLocalVariable ( string name, LocalBuilder builder ) : void
name string
builder System.Reflection.Emit.LocalBuilder
return void

Emit() public method

public Emit ( OpCode opcode ) : void
opcode OpCode
return void

Emit() public method

public Emit ( OpCode opcode, FieldSpec field ) : void
opcode OpCode
field FieldSpec
return void

Emit() public method

public Emit ( OpCode opcode, Label label ) : void
opcode OpCode
label System.Reflection.Emit.Label
return void

Emit() public method

public Emit ( OpCode opcode, LocalBuilder local ) : void
opcode OpCode
local System.Reflection.Emit.LocalBuilder
return void

Emit() public method

public Emit ( OpCode opcode, MethodInfo method ) : void
opcode OpCode
method MethodInfo
return void

Emit() public method

public Emit ( OpCode opcode, MethodSpec method ) : void
opcode OpCode
method MethodSpec
return void

Emit() public method

public Emit ( OpCode opcode, MethodSpec method, Type vargs ) : void
opcode OpCode
method MethodSpec
vargs IKVM.Reflection.Type
return void

Emit() public method

public Emit ( OpCode opcode, System.TypeSpec type ) : void
opcode OpCode
type System.TypeSpec
return void

Emit() public method

public Emit ( OpCode opcode, byte arg ) : void
opcode OpCode
arg byte
return void

Emit() public method

public Emit ( OpCode opcode, double arg ) : void
opcode OpCode
arg double
return void

Emit() public method

public Emit ( OpCode opcode, float arg ) : void
opcode OpCode
arg float
return void

Emit() public method

public Emit ( OpCode opcode, int arg ) : void
opcode OpCode
arg int
return void

Emit() public method

public Emit ( OpCode opcode, string arg ) : void
opcode OpCode
arg string
return void

EmitArrayAddress() public method

public EmitArrayAddress ( ArrayContainer ac ) : void
ac ArrayContainer
return void

EmitArrayLoad() public method

public EmitArrayLoad ( ArrayContainer ac ) : void
ac ArrayContainer
return void

EmitArrayNew() public method

public EmitArrayNew ( ArrayContainer ac ) : void
ac ArrayContainer
return void

EmitArrayStore() public method

public EmitArrayStore ( ArrayContainer ac ) : void
ac ArrayContainer
return void

EmitContext() public method

public EmitContext ( IMemberContext rc, ILGenerator ig, System.TypeSpec return_type ) : System
rc IMemberContext
ig System.Reflection.Emit.ILGenerator
return_type System.TypeSpec
return System

EmitInt() public method

public EmitInt ( int i ) : void
i int
return void

EmitLoadFromPtr() public method

public EmitLoadFromPtr ( System.TypeSpec t ) : void
t System.TypeSpec
return void

EmitLong() public method

public EmitLong ( long l ) : void
l long
return void

EmitStoreFromPtr() public method

public EmitStoreFromPtr ( System.TypeSpec type ) : void
type System.TypeSpec
return void

EndExceptionBlock() public method

public EndExceptionBlock ( ) : void
return void

EndScope() public method

public EndScope ( ) : void
return void

FreeTemporaryLocal() public method

public FreeTemporaryLocal ( LocalBuilder b, System.TypeSpec t ) : void
b System.Reflection.Emit.LocalBuilder
t System.TypeSpec
return void

GetTemporaryLocal() public method

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
return System.Reflection.Emit.LocalBuilder

Mark() public method

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
return void

MarkLabel() public method

public MarkLabel ( Label label ) : void
label System.Reflection.Emit.Label
return void

TemporaryReturn() public method

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
return System.Reflection.Emit.LocalBuilder

Property Details

CurrentAnonymousMethod public_oe property

Whether we are inside an anonymous method.
public AnonymousExpression,Mono.CSharp CurrentAnonymousMethod
return AnonymousExpression

DefaultTarget public_oe property

Default target in a switch statement. Only valid if InSwitch is true
public Label,System.Reflection.Emit DefaultTarget
return System.Reflection.Emit.Label

HasReturnLabel public_oe property

If we already defined the ReturnLabel
public bool HasReturnLabel
return bool

LoopBegin public_oe property

Current loop begin and end labels.
public Label,System.Reflection.Emit LoopBegin
return System.Reflection.Emit.Label

MemberContext public_oe property

public IMemberContext MemberContext
return IMemberContext

ReturnLabel public_oe property

The location where return has to jump to return the value
public Label,System.Reflection.Emit ReturnLabel
return System.Reflection.Emit.Label

Switch public_oe property

If this is non-null, points to the current switch statement
public Switch Switch
return Switch

ig public_oe property

public ILGenerator,System.Reflection.Emit ig
return System.Reflection.Emit.ILGenerator

return_value public_oe property

The location where we store the return value.
public LocalBuilder,System.Reflection.Emit return_value
return System.Reflection.Emit.LocalBuilder