My app uses a customized version of Lua 5.0.2 and some customers feed very large (automatically generated) scripts into it. For example, scripts that are 200 megabytes or more in size. It all seems to work fine but I'm wondering how scalable the Lua VM is.
I'm especially concerned about the OP_JMP scalability. In Lua 5.0.2 OP_JMP uses 18 bits to code the destination PC. So it can jump 262144 instructions at a maximum. Can this limitation be a problem with very large scripts? For example, a 200 megabyte script in which a function at the very bottom of the script calls a function at the very top of the script? Will this hit an OP_JMP limit or are function calls implemented in a different way and OP_JMP is only used for coding control structures like for, if, ... which are very unlikely to have to jump more than 2^18 instructions...
Thanks to anybody who can shed some light onto this!