From 9bc26d68e35027bc58fedecb07510cca838debed Mon Sep 17 00:00:00 2001 From: John Kerl Date: Tue, 11 Oct 2016 08:13:32 -0400 Subject: [PATCH] neaten --- c/mapping/mlr_dsl_stack_allocate.c | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/c/mapping/mlr_dsl_stack_allocate.c b/c/mapping/mlr_dsl_stack_allocate.c index ebbfac4a5..2b4882190 100644 --- a/c/mapping/mlr_dsl_stack_allocate.c +++ b/c/mapping/mlr_dsl_stack_allocate.c @@ -47,10 +47,26 @@ // i = z; # LHS is local 4 at current level; // # RHS is unresolved -> slot 0 at current level. // } # +// +// Notes: +// +// * Pass 1 computes frame-relative indices and upstack-level counts, +// as in the example, for each local variable. +// +// * Pass 2 computes absolute indices for each local variable. These +// aren't computable in pass 1 due to the example 'b = 7' assignment +// above: the number of local variables in an upper level can change +// after the invocation of a child level, so total frame size is not +// known until all AST nodes in the top-level block have been visited. +// +// * Slot 0 of the top level is reserved for an absent-null for unresolved +// names on reads. +// +// * The tree-traversal order is done correctly so that if a variable is read +// before it is defined, then read again after it is defined, then the first +// read gets absent-null and the second gets the defined value. // ================================================================ -// xxx absent - // ---------------------------------------------------------------- // xxx to do: