- 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
|
|
@ -273,10 +273,8 @@ VMFrameStack::~VMFrameStack()
|
|||
|
||||
VMFrame *VMFrameStack::AllocFrame(VMScriptFunction *func)
|
||||
{
|
||||
int size = VMFrame::FrameSize(func->NumRegD, func->NumRegF, func->NumRegS, func->NumRegA,
|
||||
func->MaxParam, func->ExtraSpace);
|
||||
VMFrame *frame = Alloc(size);
|
||||
frame->Func = func;
|
||||
VMFrame *frame = Alloc(func->StackSize);
|
||||
frame->NumRegD = func->NumRegD;
|
||||
frame->NumRegF = func->NumRegF;
|
||||
frame->NumRegS = func->NumRegS;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue