- implemented code generation for stack variables.
- fixed code generation for using local variables as array index. This must use a different register for the array element offset because the original register may not be overwritten.
This commit is contained in:
parent
d86f03e2e0
commit
2cc48ec378
9 changed files with 306 additions and 92 deletions
|
|
@ -182,15 +182,11 @@ void VMScriptFunction::DestroyExtra(void *addr)
|
|||
}
|
||||
}
|
||||
|
||||
void VMScriptFunction::SetExtraSpecial(PType *type, unsigned offset)
|
||||
{
|
||||
type->SetDefaultValue(nullptr, offset, &SpecialInits);
|
||||
}
|
||||
|
||||
int VMScriptFunction::AllocExtraStack(PType *type)
|
||||
{
|
||||
int address = ((ExtraSpace + type->Align - 1) / type->Align) * type->Align;
|
||||
ExtraSpace = address + type->Size;
|
||||
type->SetDefaultValue(nullptr, address, &SpecialInits);
|
||||
return address;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue