• Marius Wachtler's avatar
    ICs: variable size IC slots · 258a2b0a
    Marius Wachtler authored
    before this change we had a fixed number of equal size slots inside an IC.
    Because of the large difference in rewrite sizes a fixed slot size is not ideal.
    We often ended up with too large slots which prevented us from emitting more slots.
    (or very large ICs in general which are bad for memory usage and the instruction cache)
    
    With this commit we will start with a single slot with the size of the whole IC and then decreasing its size to the actual bytes emitted
    and creating a new slot which starts directly at the end of the previous slot.
    We will repeat to to this until the space left is smaller than the number of bytes the last slot required.
    This makes it a little bit less likely that we will be successful in overwritting an existing slot
    but our benchmarks show that it is still a large win on all our benchmarks.
    
    Some notable changes are:
    - we pick the slot to rewrite much earlier now and prevent it from getting rewritten while we rewrite using num_inside = 1
      the reason is that we would otherwise not know how big the slot is
    - when we resize a slot we have to patch the failing guard jumps to the address of the next slot
    258a2b0a
icinfo.h 6.94 KB