← Back to context

Comment by the8472

2 years ago

      0x100002ec0: b 0x100002d1c       ; jump back to the dispatch loop

I'd expect tail call based control flow - i.e. computing the jump destination at the end of each opcode function - to be nicer to the branch predictor because it could track targets separately.

Currently that's hard to achieve in Rust. There's an experiment in progress to see if guaranteed tail calls can be added to the language

https://github.com/rust-lang/rust/issues/112788