Difference between JVM's LookupSwitch and TableSwitch?

前端 未结 4 818
花落未央
花落未央 2020-11-27 11:05

I have some difficulty to understand LookUpSwitch and TableSwitch in Java bytecode.

If I understand well, both LookUpSwitch and TableSwitch correspond to the s

4条回答
  •  余生分开走
    2020-11-27 12:10

    Java Virtual Machine Specification describe the difference. "The tableswitch instruction is used when the cases of the switch can be efficiently represented as indices into a table of target offsets." The specification describes the more details.

提交回复
热议问题