The optimizer algorithm is currently a two-pass design. Want to change to a better algorithm, probably Robertson(1977). I have the full paper, thanks to Robertson himself. Full citation:
MRC Technical Summary Report #1779
Code Generation for Short/Long Address Machines
Edward L. Robertson
Mathematics Research Center
University of Wisconsin-Madison
610 Walnut Street
Madison, Wisconsin 53706
August 1977
Things to consider:
- This algorithm needs to have knowledge of short/long forms and how to intelligently select them. Currently there's no provision for this. Bytecodes should be changed to have more metadata, particularly making it more obvious when there are multiple size choices due to late-binding changes such as jump sizes.