Changes by: Jason Hickey (jyh at cs.caltech.edu)
Date: 2004-03-26 10:35:58 -0800 (Fri, 26 Mar 2004)
Revision: 5567
Log message:
. test_fact compiles, runs, and produces the correct answer! At this
. point the compiler is in fair working condition, and we should
. spend the day organizing the paper. We can finish the harder
. examples in parallel.
.
. TODO:
. 1. The quality of the code is pretty bad. Some notable problems:
. a. All relations are bare at this point, even if the result
. is only used in a conditional. We have code like this:
.
. let b = (i == 0) in
. if b then e1[] else e2[]
.
. The relation should be migrated into the conditional.
.
. A related note: we are using set/cc to compute bare
. relations, but set/cc requires a byte register. We
. will get a failure in the backend if the register
. allocator happens to choose %esi or %edi. It is
. probably best to force the register choice here
. to, say, %edx.
.
. b. The assembly has far too many register-to-register mov
. instructions.
. c. It looks like closures are being allocated even for
. recursive function calls.
. d. We don't do enough constant folding, so we get silly
. instruction sequences like this.
.
. add $3, %eax // eax += 3
. dec %eax // eax--
.
. 2. Incomplete parts:
. a. Reserve is not implemented, so the garbage collector is
. never called.
. b. Even for factorial, there are no spills, so the spill
. code is not tested.
. c. Currently, every function uses the standard calling
. convention, where function arguments go in registers
. eax, ebx, ecx, edx, esi, edi. This is both inefficient
. and it means we can't handle functions with more than
. 6 arguments.