deep

a Cross Development Platform for Java

User Tools

Site Tools


dev:crosscompiler:backend:register_allocator

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Last revisionBoth sides next revision
dev:crosscompiler:backend:register_allocator [2018/10/31 12:14] – [Releasing of Registers of phi-Functions] ursgrafdev:crosscompiler:backend:register_allocator [2018/10/31 12:58] – [Locals on the Stack] ursgraf
Line 94: Line 94:
  
 ===== Locals on the Stack ===== ===== Locals on the Stack =====
-Local variables which cannot be assigned a variable get assigned a stack slot.+Local variables which cannot be assigned a register get assigned a stack slot. Stack slots are numbered from 0x100. The code generator will handle the transfer to and from these stack slots. Whenever the code generator tries to translate an SSA instruction and one of the operands is on the stack, the following has to be dones:
  
 +  * load stack slot into free register
 +  * execute instruction
 +
 +If the result of the SSA instruction is assigned a stack slot, the code generator will have to save to the stack:
 +
 +  * execute instruction, destination register is free register
 +  * store destination register onto stack
 +
 +During register allocation of a method a variable //fullRegSet// signals, if at least one stack slot was used. If that was the case the register allocation is done again, but this time with a reduced register set, because some of the registers must be free in order to be used for fetching stack slots and using them in the following instructions.
  
dev/crosscompiler/backend/register_allocator.txt · Last modified: 2019/08/29 16:53 by ursgraf