Description
Haxe generated code is a simple machine state while + switch which is not as fast as it should be. In order to generate small and optimized code, we should transform the control flow graph into plain haxe structures: if, for, while...
Relevant concepts and links:
CFG=Control Flow Graph
DFS=Depth First
Dominator
DT=Dominator Tree
DFS and DT are acyclic graphs
We can normalize DFS adding an extra node and all exit points branching to that node
Reductible CFG=
https://en.wikipedia.org/wiki/Control_flow_graph
https://en.wikipedia.org/wiki/Data-flow_analysis
https://en.wikipedia.org/wiki/Depth-first_search
https://en.wikipedia.org/wiki/Directed_acyclic_graph
https://en.wikipedia.org/wiki/Dominator_(graph_theory)
http://infolab.stanford.edu/~ullman/dragon/w06/lectures/dfa3.pdf
http://www.cs.rice.edu/~keith/Embed/dom.pdf
http://pages.cs.wisc.edu/~fischer/cs701.f08/lectures/Lecture19.4up.pdf
http://compilers.cs.uni-saarland.de/ssasem/talks/Dibyendu.Das.pdf
http://dragonbook.stanford.edu/lecture-notes/Columbia-COMS-W4117/07-09-27.html
Relooper: https://github.com/kripken/emscripten/blob/master/docs/paper.pdf?raw=true