There is one further refinement that is possible w.r.t. my previous
note. I said that REF was not a value constructor, but another possible
interpretation is that

        (REF x)

is a value constructor that returns a reference to X, with the side
effect that if X is stack allocated it must be rewritten at compile time
in heap-allocated form if the reference escapes. Note that this does not
require new mechanism in the compiler. The required analysis is the same
as the analysis for lambda escape, and it is done conservatively.


I also neglected to mention that assignment of the form

        a : (stack-ref T) :=  b : (ref T)

is legal, but

        a : (ref T) := b: (stack-ref T)

is not. The former is legal because the use of a stack-ref is more
restricted than the use of a ref.

shap

_______________________________________________
bitc-dev mailing list
[email protected]
http://www.coyotos.org/mailman/listinfo/bitc-dev

Reply via email to