implemented jump table dispatch

- currently only enabled on supported platforms (GNU C Compiler + Clang)
- when enabled, sped up examples/fibtest.cosmo by about 20% (avg of 11.179s prior and 8.799 after)

NOTE: malicious dumps can trivially cause crashes now by having junk function chunks
This commit is contained in:
2023-06-03 01:17:28 -05:00
committed by cpunch
parent 7bca6927a9
commit 2b3825d258
4 changed files with 647 additions and 589 deletions

View File

@@ -64,7 +64,7 @@ typedef enum
OP_FALSE,
OP_NIL,
OP_RETURN
OP_RETURN,
} COPCODE; // there can be a max of 256 instructions
#endif