开发者

How does short circuit evaluation work in MSIL

开发者 https://www.devze.com 2023-01-05 10:58 出处:网络
How does the sho开发者_如何学Pythonrt circuit evaluation work in the msil interpreter? Does the And instruction contain information about where to jump to if false, and same for the Or with true?No -

How does the sho开发者_如何学Pythonrt circuit evaluation work in the msil interpreter? Does the And instruction contain information about where to jump to if false, and same for the Or with true?


No - the IL instructions for And and Or actually perform bitwise operations on the top two operands on the stack. If a high level language uses short circuit evaluation, it is compiled down to explicit branching operations at the IL level and doesn't rely on the And instruction at all. Use a tool like Reflector to see the actual IL produced by the compiler in question.

0

精彩评论

暂无评论...
验证码 换一张
取 消