- Added the TAIL instruction to perform a CALL and a RET in the same instruction. The called
function will pass its results directly to this function's caller. Eventually, this should be changed to do a proper tail call for scripted functions. SVN r3769 (scripting)
This commit is contained in:
parent
644f0c0e05
commit
e1a2f3b546
5 changed files with 58 additions and 9 deletions
|
|
@ -300,8 +300,7 @@ static void FinishThingdef()
|
|||
p->Emit(&buildit);
|
||||
delete p;
|
||||
}
|
||||
buildit.Emit(OP_CALL_K, buildit.GetConstantAddress(tcall->Function, ATAG_OBJECT), NAP + j, 0);
|
||||
buildit.Emit(OP_RET, 0, REGT_NIL, 0);
|
||||
buildit.Emit(OP_TAIL_K, buildit.GetConstantAddress(tcall->Function, ATAG_OBJECT), NAP + j, 0);
|
||||
VMScriptFunction *sfunc = buildit.MakeFunction();
|
||||
sfunc->NumArgs = NAP;
|
||||
func = sfunc;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue