开发者

How does short circuit evaluation work in MSIL

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜