compile lexical variable access and closure creation to the new ops
authorAndy Wingo <wingo@pobox.com>
Thu, 23 Jul 2009 15:00:56 +0000 (17:00 +0200)
committerAndy Wingo <wingo@pobox.com>
Thu, 23 Jul 2009 15:00:56 +0000 (17:00 +0200)
commit66d3e9a32c2da4eedb3f316e0dcffe92e6631f87
treed73674854ccd71512c7cdb828bf9153ba27396b1
parent8d90b356560b9cf54300ff9eabf4675acb650e03
compile lexical variable access and closure creation to the new ops

* module/language/glil.scm (<glil>): New GLIL type, <glil-lexical>,
  which will subsume other lexical types.
* module/language/glil/compile-assembly.scm: Compile <glil-lexical>.
  (make-open-binding): Change the interpretation of the second argument
  -- instead of indicating an "external" var, it now indicates a boxed
  var.
  (open-binding): Adapt to new glil-bind format.
* module/language/tree-il/analyze.scm: Add a lot more docs.
  (analyze-lexicals): Change the allocation algorithm and output format
  to allow the tree-il->glil compiler to capture free variables
  appropriately and to reference bound variables in boxes if necessary.
  Amply documented.

* module/language/tree-il/compile-glil.scm (compile-glil): Compile
  lexical variable access to <glil-lexical>. Emit variable capture and
  closure creation code here, instead of leaving that task to the
  GLIL->assembly compiler.

* test-suite/tests/tree-il.test: Update expected code emission.
module/language/glil.scm
module/language/glil/compile-assembly.scm
module/language/tree-il/analyze.scm
module/language/tree-il/compile-glil.scm
test-suite/tests/tree-il.test