- minor VM optimization: Precalculate a function's frame size when compiling it instead of doing it each time it gets called.
This made up ca. 10% of the 'call' instruction's execution time.
This commit is contained in:
parent
893607c96c
commit
41f2f61b94
3 changed files with 3 additions and 3 deletions
|
|
@ -139,6 +139,7 @@ void VMFunctionBuilder::MakeFunction(VMScriptFunction *func)
|
|||
func->NumRegA = Registers[REGT_POINTER].MostUsed;
|
||||
func->NumRegS = Registers[REGT_STRING].MostUsed;
|
||||
func->MaxParam = MaxParam;
|
||||
func->StackSize = VMFrame::FrameSize(func->NumRegD, func->NumRegF, func->NumRegS, func->NumRegA, func->MaxParam, func->ExtraSpace);
|
||||
|
||||
// Technically, there's no reason why we can't end the function with
|
||||
// entries on the parameter stack, but it means the caller probably
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue