Open cristianstaicu opened 5 years ago
We didn't have a use case that needs to distinguish x++
or ++x
. One possible solution is to add some additional information in the binary callback to distinguish them. We would not necessarily provide exactly the same events as Jalangi if we can capture the same thing with fewer events.
Hey,
When encountering a self-increment operator like
x++
, NodeProf translates it into five callbacks/hook invocations:read
,literal
,binaryPre
,binary
,write
. Is that intended? Jalangi invokes additional hooks:unaryPres
andunary
and sometimes even additionalbinary
ones.Moreover, there is no way to distinguish between
x++
and++x
. As I understand, Jalangi employs some weird hack for this: it performs the write and then re-reads the value and does ax-1
binary operation in the case ofx++
.For more details about this issue check this example analysis and the output on a simple test case both on NodeProf and on Jalangi2: https://www.dropbox.com/sh/rfkubnia8tns2jp/AACUArk9WalFR0VoPWxpzhfDa?dl=0
Best, Cris