Add specialized instructions for loading some locals.

Not having to decode a separate arg byte improves some benchmarks:

binary_trees - wren           ..........  3094  0.32s  101.95% relative to baseline
delta_blue - wren             ..........  6555  0.15s  101.05% relative to baseline
fib - wren                    ..........  2326  0.43s  107.32% relative to baseline
for - wren                    ..........  6183  0.16s  102.81% relative to baseline
method_call - wren            ..........  4746  0.21s  105.97% relative to baseline
This commit is contained in:
Bob Nystrom
2014-12-06 19:59:11 -08:00
parent a94dfdac10
commit ac67386208
5 changed files with 174 additions and 34 deletions
+11
View File
@@ -40,6 +40,17 @@ typedef enum
// Push true onto the stack.
CODE_TRUE,
// Pushes the value in the given local slot.
CODE_LOAD_LOCAL_0,
CODE_LOAD_LOCAL_1,
CODE_LOAD_LOCAL_2,
CODE_LOAD_LOCAL_3,
CODE_LOAD_LOCAL_4,
CODE_LOAD_LOCAL_5,
CODE_LOAD_LOCAL_6,
CODE_LOAD_LOCAL_7,
CODE_LOAD_LOCAL_8,
// Pushes the value in local slot [arg].
CODE_LOAD_LOCAL,