[Vm-dev] Register allocation and debugging in Squeak
smalltalk at stefan-marr.de
Mon Aug 19 11:22:20 UTC 2013
On 14 Aug 2013, at 19:26, Jecel Assumpcao Jr. <jecel at merlintec.com> wrote:
> Igor Stasenko wrote:
>> yes, but you need to know how to map existing activations (which
>> optimized stack frames),
>> back to smalltalk contexts. if you can do it, the rest is trivial..
>> but that's the question: imagine you interrupting machine code at random point:
>> - now, how to match it with smalltalk piece of code/AST node?
> A popular solution is to not allow the machine code to be interrupted at
> random points. In the Self VM, for example, you have two defined "safe
> points": at message sends and at the backwards jump at the end of a loop
> without any message sends. The mapping of the optimized stack frames to
> the language level contexts only has to be possible at these points and
> can be arbitrarily complicated between them.
I tend to agree with Jecel. I belief that it is not only popular, but probably the only really maintainable solution.
The GC literature is full of approaches how to figure out what's included in the root set.
And having to maintain information about which registers or stack slots are live for a given machine code fragment is quite a bit of overhead.
I would guess, that's true for maintaining code-to-code mapping information for highly optimized code as well.
So safepoints seem to be a comparably simple, low-overhead solution.
> -- Jecel
Software Languages Lab
Vrije Universiteit Brussel
Pleinlaan 2 / B-1050 Brussels / Belgium
Phone: +32 2 629 2974
Fax: +32 2 629 3525
More information about the Vm-dev