slash-lang/slash — pull request #13 by charliesome (2013-04-20 10:28:41+00:00)
Title: Pack bytecode so each opcode/operand is not pointer sized

At the moment, each opcode and operand is represented by the `sl_vm_insn_t` union. This means that the largest possible operand (a pointer) bloats the size of operands that could be smaller (eg. opcodes, which can be as small as a single byte).

This pull request modifies the compiler and VM so that different opcodes/operands can be different sizes, ranging from 1 byte to 8 bytes. This will significantly reduce memory usage, as well as perhaps improve performance (more instructions can fit in a CPU cache line). The downside to this approach is that reads are no longer always aligned, which will cause a minor performance hit.