On 10/24/2013 06:16 PM, Patrick Walton wrote:
On 10/24/13 6:13 PM, Ben Kloosterman wrote:
Yes its a simple region but region analysis is normally compile time
while this is runtime..knowing the pointer points to the stack doesnt
help .
If you copy in a new stack you need to know every pointer to that stack
if you move it to a new location .. Copying GCs do this all the time but
they scan the heap for the mark and know the references and can use
either a global pause or a write barrier .
If you had a precise GC ( which can precisely define all the
references) you could on need to grow stack , stop the world , scan
the whole heap for references to the stack move the stack and update
the references. This is expensive so you would want a warning to the
programmer to increase the stack size. ( Note conservative collectors
can confirm pointers to heap objects its just expensive , there may be a
way of confirming a stack object maybe with a typecheck or wrapping such
an object with some more data which allows precise determination).
Why cant rust do precise marking , is it pointers to internal objects
rather than offsets ? All good modern GCs are precise/copying so not
having it is a big issue .
References (borrowed pointers) are not part of the stack map, so we
can't rewrite them.
Actually, there is no stack map support at all in LLVM (at least, not
stack map support that supports a precise moving GC with roots in
registers). Fixing this would be a lot of work, probably over a year.
There is a new proposal to add stack maps to LLVM for use by the JS JIT:
http://lists.cs.uiuc.edu/pipermail/llvmdev/2013-October/066573.html. I
haven't looked at the details, but this proposal is by Apple so it's
probably going to happen. Could end up being beneficial to us someday.
_______________________________________________
Rust-dev mailing list
Rust-dev@mozilla.org
https://mail.mozilla.org/listinfo/rust-dev