Replace hand-written jump table with upstream switch-case statement.
A jump table like this to speed up a switch-case statement is a good idea. In fact, it's so good, that a modern compiler will do the transformation for you :-). I checked the assembly generated by gcc 5.4.0 and clang 3.6.2, which I had readily available on my laptop, and they both produced a jump table for this with -O2. To reduce the diff vs. upstream, and to make this more readable, revert this to a switch-case table, like it is in the upstream. Let's trust the compiler for optimizing.
Showing
想要评论请 注册 或 登录