compile-assembly: use file-level constants table
authorAndy Wingo <wingo@pobox.com>
Sun, 8 May 2011 14:37:47 +0000 (16:37 +0200)
committerAndy Wingo <wingo@pobox.com>
Sun, 8 May 2011 14:37:47 +0000 (16:37 +0200)
commitf5695488b95263622d5d1202f9f80c624ab4215a
tree0a325beed060add1c84ea12ed23ee36e1fa29b0b
parent7e7b8991b295ac9e6b4a79b7fce906b730ce093f
compile-assembly: use file-level constants table

* module/language/glil/compile-assembly.scm (compile-assembly): Rework
  to handle toplevel-specific code generation here, instead of in
  glil->assembly.  Specifically, here we build a global constant table,
  and arrange for it to be the objtable of the toplevel thunk.

  (compile-program): New helper, compiles a <glil-program> and returns
  just the (load-program ...) form.

  (compile-objtable): New helper, generates assembly to build an object
  table, using some other constants table, and possibly recursing to
  `compile-program' for cached GLIL programs.

  (glil->assembly): Simplify, removing the toplevel? argument, and
  replacing the object alist with an objtable computed in a previous
  pass.  Adapt to the new form of the objtable, and to use
  compile-program and compile-objtable.
module/language/glil/compile-assembly.scm