Functions | |
CENTUMSHAREDCODE_API ExecutionReturn | HandleReturnValue (CScope *scope, ExecutionReturn ret) |
This function takes the return value of a function that is to have its results pushed onto the local stack and calls HandleReturnValueAll with the appropriate parameters. | |
CENTUMSHAREDCODE_API ExecutionReturn | HandleUReturnValue (CScope *scope, ExecutionReturn ret) |
This function takes the return value of a function that is to have its results pushed onto the usings stack and calls HandleReturnValueAll with the appropriate parameters. | |
CENTUMSHAREDCODE_API void | ExtractAndReleaseParamsAndUsings (CScope *scope) |
The ExtractAndReleaseParamsAndUsings takes a substack from both the parms and usings stacks passed to a function and finishes them. | |
CENTUMSHAREDCODE_API ExecutionReturn | MakeARegisteredCall (CThing *func, CScope *scope) |
The MakeARegisteredCall function is used when a rebi with the CTHING_REGISTEREDFUNCTION flag is to be called. | |
CENTUMSHAREDCODE_API ExecutionReturn | MakeADLLCall (CThing *func, CScope *scope) |
The MakeADllCall function is used when a rebi with the CTHING_DLLFUNCTION flag is to be called. | |
CENTUMSHAREDCODE_API ExecutionReturn | MakeANormalCall (CThing *func, CScope *scope) |
This function is used to execute a rebi that has no special flags relating to its call. | |
CENTUMSHAREDCODE_API ExecutionReturn | HandleReturnValueAll (CScope *scope, ExecutionReturn ret, CThingStack *dest) |
This function deals with the results of a function return as appropriate, adding them to the correct stack, retuning them further or handling an excpetion. | |
CENTUMSHAREDCODE_API ExecutionReturn | HandleReturnedException (CScope *scope, ExecutionReturn ret) |
The HandleReturnedException function attempts to use an exception handler with the current scope. | |
CENTUMSHAREDCODE_API ExecutionReturn | CleanReturnValue (ExecutionReturn ret) |
This function adjusts the return type of a return value to represent that it has passed though a function. |
|
This function adjusts the return type of a return value to represent that it has passed though a function. Multiple return values are adjusted to reflect having returned through another layer, and single returns are turned into normal results to signal that they should be added to the stack and not passed further on.
|
|
The ExtractAndReleaseParamsAndUsings takes a substack from both the parms and usings stacks passed to a function and finishes them.
|
|
The HandleReturnedException function attempts to use an exception handler with the current scope. This function searches though the byte code of the current scope, starting at the current position looking for a bytecode with an ident of 0x03, singifying that it is a handler. This handler is then called with the returned value and the returned value of the handler is subsequently returned. If no handler can be found the value passed to this function is returned unchanged.
|
|
This function takes the return value of a function that is to have its results pushed onto the local stack and calls HandleReturnValueAll with the appropriate parameters. This function provides a layer of indirection that prevents code duplication.
|
|
This function deals with the results of a function return as appropriate, adding them to the correct stack, retuning them further or handling an excpetion. First return values of type EXEC_NORMAL have their values pushed onto the stack passed to the function, and normal return with no stack is returned from the function. Return values of type EXEC_RETURN or multiple returns are passed on with no action taken. Return values of type EXEC_RETURNTO or EXEC_RETURNFROM have their top value of their return stack compared either to the label of the current scope if it is a string reference or if their pointers and the scope's rebi if it is a bare reference. If they pass this test return values of type EXEC_RETURNTO have their return stack added to the appropriate stack as if they were a normal return and returns of type EXEC_RETURNFROM are converted into normal returns. Finally exceptions have HandleReturnedException called on them repeatedly until a handler returns a non-exception which is then returned, or until no more handlers can be found (each passed the result of the previous handler) in that case the resulting exception is returned to be handled in the calling scope.
|
|
This function takes the return value of a function that is to have its results pushed onto the usings stack and calls HandleReturnValueAll with the appropriate parameters. This function provides a layer of indirection that prevents code duplication.
|
|
The MakeADllCall function is used when a rebi with the CTHING_DLLFUNCTION flag is to be called. This function gets the dll name, stored as local data of type DATA_TYPE_DLL_NAME, and then either the name of the function to call, as stored in local data with type: DATA_TYPE_DLL_FUNCTION_NAME or the ordinal as stored in local data of type DATA_TYPE_DLL_FUNCTION_VALUE. Then parameters and usings are extracted from the calling scope ( using CThingStack::GetASubStackUnsafe() ). After being called once as a dll function the rebi is converted into a registed function rebi (flag CTHING_REGISTEREDFUNCTION) for a speed boost. Finally the function itself is called, and then its return stack is reversed and then its return value is processed by the CleanReturnValue function before being returned.
|
|
This function is used to execute a rebi that has no special flags relating to its call. Parameters and usings are extracted from the calling scope ( using CThingStack::GetASubStack() ). Finally the function itself is called, and its return value is processed by the CleanReturnValue function before being returned.
|
|
The MakeARegisteredCall function is used when a rebi with the CTHING_REGISTEREDFUNCTION flag is to be called. This function gets the address of the external function, stored as local data of type DATA_TYPE_EXTERNAL_FUNCTION. Then parameters and usings are extracted from the calling scope ( using CThingStack::GetASubStackUnsafe() ). Finally the function itself is called, and then its return stack is reversed and then its return value is processed by the CleanReturnValue function before being returned.
|