Problem
Each variable assignment requires 3 opcodes: POP + PUSH + ASSIGN. See example below:
282: POP
283 : PUSH_LONG, -2
284 : ASSIGN, 11, true
285 : POP
286 : PUSH_LONG, 2
287 : ASSIGN, 12, true
288 : POP
289 : PUSH_LONG, 4
290 : ASSIGN, 13, true
Specification
Assigning a variable with hardcoded value shouldn't require to PUSH and then ASSIGN. We should have ASSIGN_LONG, ASSIGN_DOUBLE, ASSIGN_STRING opcodes to assign a variable to a hardcoded value.
Many variable assignments don't need to be pushed on the stack, just to be poped immediately and discarded. Combinations of ASSIGN + POP + PUSH should be simplified so that ASSIGN doesn't push to the stack.
Problem
Each variable assignment requires 3 opcodes: POP + PUSH + ASSIGN. See example below:
Specification
Assigning a variable with hardcoded value shouldn't require to PUSH and then ASSIGN. We should have ASSIGN_LONG, ASSIGN_DOUBLE, ASSIGN_STRING opcodes to assign a variable to a hardcoded value.
Many variable assignments don't need to be pushed on the stack, just to be poped immediately and discarded. Combinations of ASSIGN + POP + PUSH should be simplified so that ASSIGN doesn't push to the stack.