SUPPORT FOR CLASSES
We extended WACC to support object-oriented classes, which involved designing an entirely new syntax to add support for fields and methods. It was also necessary to promote WACC's simple pair-heap to a heap with full support for objects.
EFFICIENT REGISTER ALLOCATION
I was responsible for writing the register allocator, which resulted in a >100x increase in the speed of the generated assembly code versus the equivalent stack machine. I implemented the Linear Scan algorithm to rapidly allocate registers in O(n) time, compared to exponential approaches based on graph colouring.
STANDARD FUNCTION LIBRARY
We built a highly optimised standard library for WACC written in ARM assembly. The library adds native support for sorting arrays, finding min/max elements and index calculations, amongst many other useful functions.
Our compiler supports a variety of optimisation options for the generated assembly code which can be selected via command-line flags. Available optimisations include redundant instruction removal and minimisation of stack operations.