0x7CFE / llst

LLVM powered Little Smalltalk.
Other
93 stars 10 forks source link

Move stack object slot back to local block where it is used #24

Open 0x7CFE opened 11 years ago

0x7CFE commented 11 years ago

Currently object slots are created in the preamble basic block. This is not effective and consumes stack space for all potential objects in all possible branches.

Object slot should be moved back to the origin basic block and it's holder should be updated accordingly: when control flow reaches end of the origin basic block, object holder should be nulled.

This may be achieved using llvm.lifetime.x intrinsics.

P.S.: Object slot was moved to a preamble in commit 1f26550aa355a0ad416fca1c01e8abf63ff66440

0x7CFE commented 10 years ago

Previously commit 1f26550aa355a0ad416fca1c01e8abf63ff66440 fixed the crash by moving the alloca from local basic block to the preamble.

Actually, crash may be triggered by access to a disposed alloca memory referenced throgh gc-root by GC. This may happen if gc-roots are not cleared when leaving the local basic block. We need to check it.