因此,我知道许多C风格的语言都有减量(--)和递增(++)运算符,并允许在整个表达式求值之前或之后发生突变。给定一个虚拟机(如JavaScript/JVM)或物理机(如编译的C++),生成的操作码是否如下所示?(假设基于堆栈的参数/返回。)return f(++a) + y++;LOAD 4 APUSH APOP INTO CINC B如果是这样的话,当表达式变得复杂时,这些语言中的
op1 = ++j (Since it is pre-increment, the value is 2, and j is 2)op1 = j-- (Since it is Post-increment, the value is 3, and j is decremented to 2)
op2 = 1 (