(no title)
CodeArtisan | 1 year ago
# decode next bytecode opcode
movzwl 8(%r12), %eax
# advance bytecode pointer to next bytecode
addq $8, %r12
# load the interpreter function for next bytecode
movq __deegen_interpreter_dispatch_table(,%rax,8), %rax
# dispatch to next bytecode
jmpq *%rax
You may reduce that even further by pre-decoding the bytecode: you replace a bytecode by the address of the its implementation and then do (with GCC extended goto) goto *program_bytecodes[counter]
dkersten|1 year ago
Somewhat off topic, looking at that assembly... mine compiles to (for one of the opcodes):
(also compiled from C++ with clang's musttail annotation)versteegen|1 year ago