GarageGames/Torque3D — pull request #776 by jamesu (2014-09-07 21:12:25+00:00)
Title: Simplify compiler ast

This modification abstracts bytecode generation in the compiler so there is no longer a precompile step, in effect making it easier to modify the bytecode generated by the compiler (no more size mismatches!).

As an added bonus, codeStream entries for the StringTable entries have been expanded to 64bits, allowing compiled scripts to work properly on 64bit systems (when TORQUE_64 is defined). The codeStream is similarly expanded for 32bit systems, allowing for scripts to work transparently between 32bit and 64bit platforms. This essentially follows similar code in Torque2D.

In addition similar to Torque2D OP_CALLFUNC_RESOLVE is now automatically converted to OP_CALLFUNC to speed up function calls (excluding methods).

As this pull request touches on the internals of the bytecode compiler, it's entirely possible something completely unexpected will break. I have however tested this code on a production T3D game and as of yet have not noticed any problems. In any event there is a complementary GIST located at https://gist.github.com/jamesu/4966d4689689d058f38a which goes through a few basic tests related to code patching which may prove insightful. Output of this script is currently identical to stock T3D.