C# Class kOS.Safe.Compilation.OpcodeCall

Inheritance: Opcode
Exibir arquivo Open project: KSP-KOS/KOS

Private Properties

Property Type Description
OpcodeCall System

Public Methods

Method Description
Execute ( ICpu cpu ) : void
OpcodeCall ( object destination ) : System
PopulateFromMLFields ( List fields ) : void
StaticExecute ( ICpu cpu, bool direct, object destination, bool calledFromKOSDelegateCall ) : int

Performs the actual execution of a subroutine call, either from this opcode or externally from elsewhere. All "call a routine" logic should shunt through this code here, which handles all the complex cases, or at least it should. Note that in the case of a user function, this does not *ACTUALLY* execute the function yet. It just arranges the stack correctly for the call and returns the new location that the IP should be jumped to on the next instruction to begin the subroutine. For all built-in cases, it actually executes the call right now and doesn't return until it's done. But for User functions it can't do that - it can only advise on where to jump on the next instruction to begin the function.

ToString ( ) : string

Private Methods

Method Description
OpcodeCall ( ) : System

Method Details

Execute() public method

public Execute ( ICpu cpu ) : void
cpu ICpu
return void

OpcodeCall() public method

public OpcodeCall ( object destination ) : System
destination object
return System

PopulateFromMLFields() public method

public PopulateFromMLFields ( List fields ) : void
fields List
return void

StaticExecute() public static method

Performs the actual execution of a subroutine call, either from this opcode or externally from elsewhere. All "call a routine" logic should shunt through this code here, which handles all the complex cases, or at least it should. Note that in the case of a user function, this does not *ACTUALLY* execute the function yet. It just arranges the stack correctly for the call and returns the new location that the IP should be jumped to on the next instruction to begin the subroutine. For all built-in cases, it actually executes the call right now and doesn't return until it's done. But for User functions it can't do that - it can only advise on where to jump on the next instruction to begin the function.
public static StaticExecute ( ICpu cpu, bool direct, object destination, bool calledFromKOSDelegateCall ) : int
cpu ICpu the cpu its running on
direct bool same meaning as OpcodeCall.Direct
destination object if direct, then this is the function name
calledFromKOSDelegateCall bool true if KOSDelegate.Call() brought us here. If true that /// means any pre-bound args are already on the stack. If false it means they aren't and this will have to /// put them there.
return int

ToString() public method

public ToString ( ) : string
return string