Previous: References Up: Deferred Compilation:
The Automation of Run-Time Code Generation Next: Appendix B Extended Example
The emit pseudo-instruction is interpreted by our RISC simulator rather than being expanded by the code generator, which facilitates the investigation of various peephole optimizations. The timings described in Section 4 attribute a cost of four cycles and a size of four words to most emit instructions. On the MIPS, two cycles would be required to load the 32-bit representation of a fixed-operand instruction into a register. Two additional cycles are required to store the instruction and update a code-segment pointer; the pointer update fills the delay slot of the store instruction. The cost of updating the pointer could be amortized over several emits, so we can reduce the average cost if another instruction is available to fill the delay slot. Fast allocation of code space is a critical requirement. We assume a garbage-collected code segment with amortized or hardware-supported overflow checking and cache flushing.
