-
Notifications
You must be signed in to change notification settings - Fork 21
The backend never generates iinc #7452
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Imported From: https://issues.scala-lang.org/browse/SI-7452?orig=1 |
@paulp said (edited on May 3, 2013 8:26:57 AM UTC): LOAD_LOCAL(variable idx)
CONSTANT(1)
CALL_PRIMITIVE(Arithmetic(ADD,INT))
STORE_LOCAL(variable idx) Given the local's index and the constant increment, asm has a method to do the rest: jmethod.visitIincInsn(idx, inc) |
@magarciaEPFL said: |
@magarciaEPFL said: |
The backend is now able to turn `x += 42` into an `iinc 42` instruction. The optimization only applies to `+=` and `-=`, provided the the net increment fits inside a signed 16-bit value (the ASM library handles choosing `iinc` or `wide iinc` as is appropriate). Fixes scala/bug#7452
The backend is now able to turn `x += 42` into an `iinc 42` instruction. The optimization only applies to `+=` and `-=`, provided the the net increment fits inside a signed 16-bit value (the ASM library handles choosing `iinc` or `wide iinc` as is appropriate). Fixes scala/bug#7452
The backend is now able to turn `x += 42` into an `iinc 42` instruction. The optimization only applies to `+=` and `-=`, provided the the net increment fits inside a signed 16-bit value (the ASM library handles choosing `iinc` or `wide iinc` as is appropriate). Fixes scala/bug#7452
The backend is now able to turn `x += 42` into an `iinc 42` instruction. The optimization only applies to `+=` and `-=`, provided the the net increment fits inside a signed 16-bit value (the ASM library handles choosing `iinc` or `wide iinc` as is appropriate). Fixes scala/bug#7452
The backend is now able to turn `x += 42` into an `iinc 42` instruction. The optimization only applies to `+=` and `-=`, provided the the net increment fits inside a signed 16-bit value (the ASM library handles choosing `iinc` or `wide iinc` as is appropriate). Fixes scala/bug#7452
In the slightly shocking fact of the day dept. It is a decadent waste of bytecode to be generating four instructions including a load and a store when a single instruction can increment in-place.
A typical example - this is a single class:
The text was updated successfully, but these errors were encountered: