Friday, August 25, 2017

A More Efficient If (VM Code) Than Shimon's

Shimon (or one of his underlings - maybe Yaron)

expression
if-goto IF_TRUE0
goto IF_FALSE0
label IF_TRUE0
if-statements
goto IF_END0
label IF_FALSE0
else-statements
label IF_END0

when all you really need is :

expression
if-goto IF_TRUE0
else-statements
goto IF_END0
label IF_TRUE0
if-statements
label IF_END0

So, why would they choose to implement the less optimal thing?

No comments:

Post a Comment