Refactor the PeepholeOptimizer into arbitrary passes
Changed the peephole optimizer to support arbitrary passes over the bytecode with different optimizations instead of trying (and failing) to do everything in one go, as opts like PushNFloats would break the GetOpcodes() checks of other optimizations.
IPeepholeOptimization has been renamed to IOptimization. Individual optimizer passes are the inheritor interfaces of this parent interface.
Here are the passes in order:
IPeepholeOptimization- Runs pretty much everything not involvingPushNopcodesIBytecodeCompactor- Converts multiplePushopcodes toPushNopcodesIListCompactor- ConvertsPushN... CreateListtoCreateListN...opcodes
I ran my usual bytecode analysis scripts on TG and confirmed that we're now running const folding optimizations (in the first pass) 100% of the time. I also confirmed that second-pass and third-pass optimizations are also being applied.
I booted TG and confirmed it doesn't explode. I also ran the profiler and confirmed that the performance impact is negligible:
Closes #2059