I wonder are there any compilers that recognizes switch-in-loop pattern of interprets and optimizes it to be branch-predictor friendly using multiple indirect jumps?
However, this optimization is less effective on modern CPUs with more powerful indirect predictors using global history.