Class CallPrototype
An instruction prototype for call instructions: instructions that call a method.
Inherited Members
Namespace: Flame.Compiler.Instructions
Assembly: Flame.Compiler.dll
Syntax
public sealed class CallPrototype : InstructionPrototype
Properties
| Improve this Doc View SourceCallee
Gets the method to call.
Declaration
public IMethod Callee { get; }
Property Value
Type | Description |
---|---|
IMethod | The callee. |
Lookup
Gets the method lookup strategy used by this call.
Declaration
public MethodLookup Lookup { get; }
Property Value
Type | Description |
---|---|
MethodLookup |
ParameterCount
Gets the number of arguments this instruction takes when instantiated.
Declaration
public override int ParameterCount { get; }
Property Value
Type | Description |
---|---|
System.Int32 | The number of arguments this instruction takes. |
Overrides
| Improve this Doc View SourceResultType
Gets the type of value produced instantiations of this prototype.
Declaration
public override IType ResultType { get; }
Property Value
Type | Description |
---|---|
IType | A type of value. |
Overrides
Methods
| Improve this Doc View SourceCheckConformance(Instruction, MethodBody)
Checks if a particular instance of this prototype conforms to the rules for this instruction prototype.
Declaration
public override IReadOnlyList<string> CheckConformance(Instruction instance, MethodBody body)
Parameters
Type | Name | Description |
---|---|---|
Instruction | instance | An instance of this prototype. |
MethodBody | body | The method body that defines the instruction. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IReadOnlyList<System.String> | A list of conformance errors in the instruction. |
Overrides
| Improve this Doc View SourceCreate(IMethod, MethodLookup)
Gets the call instruction prototype for a particular callee.
Declaration
public static CallPrototype Create(IMethod callee, MethodLookup lookup)
Parameters
Type | Name | Description |
---|---|---|
IMethod | callee | The method to call. |
MethodLookup | lookup | The method lookup strategy for the call. |
Returns
Type | Description |
---|---|
CallPrototype | A call instruction prototype. |
GetArgumentList(Instruction)
Gets the argument list in an instruction that conforms to this prototype.
Declaration
public ReadOnlySlice<ValueTag> GetArgumentList(Instruction instruction)
Parameters
Type | Name | Description |
---|---|---|
Instruction | instruction | An instruction that conforms to this prototype. |
Returns
Type | Description |
---|---|
ReadOnlySlice<ValueTag> | The formal argument list. |
GetThisArgument(Instruction)
Gets the 'this' argument in an instruction that conforms to this prototype.
Declaration
public ValueTag GetThisArgument(Instruction instruction)
Parameters
Type | Name | Description |
---|---|---|
Instruction | instruction | An instruction that conforms to this prototype. |
Returns
Type | Description |
---|---|
ValueTag | The 'this' argument. |
Instantiate(ValueTag, IReadOnlyList<ValueTag>)
Instantiates this call instruction prototype.
Declaration
public Instruction Instantiate(ValueTag thisArgument, IReadOnlyList<ValueTag> arguments)
Parameters
Type | Name | Description |
---|---|---|
ValueTag | thisArgument | The 'this' argument for the call. |
System.Collections.Generic.IReadOnlyList<ValueTag> | arguments | The argument list for the call. |
Returns
Type | Description |
---|---|
Instruction | A call instruction. |
Map(MemberMapping)
Applies a member mapping to this instruction prototype.
Declaration
public override InstructionPrototype Map(MemberMapping mapping)
Parameters
Type | Name | Description |
---|---|---|
MemberMapping | mapping | A member mapping. |
Returns
Type | Description |
---|---|
InstructionPrototype | A transformed instruction prototype. |