branlwyd / bdcpu16

DCPU-16 simulator based on version 1.7 of the DCPU-16 specification. See http://dcpu.com/.
0 stars 0 forks source link

Codegen: re-add interpreter/"small" precompiled instruction provider #24

Open branlwyd opened 11 years ago

branlwyd commented 11 years ago

The current instruction providers are:

Neither one of these is ideal. The interpreted instruction provider should be re-added. Alternatively a "small precompiled" provider could be added: instead of generating one class per instruction, generate one class for each possible operator and operand and then plug them together. It would be slightly slower, but the code-size savings would be immense: instead of (operators * operands * operands) = ~55000 classes, we would instead have (operators + operands) = 99 classes.