Open gjh33 opened 7 years ago
As I mentioned on facebook, I'm fairly certain this is not how the arithmetic operators work in java bytecode, so the examples you posted would never be a 'lone' operation that you could remove without knowing more context. An example of a single inefficient div would be:
ldc x
ldc x
idiv
In your examples, only one thing is put on the stack before the arithmetic instructions, which means we have no idea what the other thing on the stack that is being operated on is, or if there is even anything else on the stack.
Oh wait I see. You are assuming there is something on the stack. Your example code would add x to it, then remove x from it.
Need to drink my coffee :confused:
examples