-
Bug
-
Resolution: Fixed
-
P4
-
10
-
b12
Comma-expressions shouldn't use any temporary variable. For example, the boxed post-incrementation (this.i++) is actually translated as follows:
(let /*synthetic*/ final Integer $5222779 = (Integer)this.i in
(let /*synthetic*/ final Integer $18695331 = this.i = Integer.valueOf((int)(this.i.intValue() + 1)) in
$5222779));
Creating a temporary variable $18695331 is useless and should be avoided (it's never used and immediately discarded).
To achieve this goal, let-expressions have to be refactored to allow more than one statement, probably in the form of block-expressions to give even more freedom.
Comma-expressions (see Lower.makeComma()) could then be translated naturally without any temporary variable.
(let /*synthetic*/ final Integer $5222779 = (Integer)this.i in
(let /*synthetic*/ final Integer $18695331 = this.i = Integer.valueOf((int)(this.i.intValue() + 1)) in
$5222779));
Creating a temporary variable $18695331 is useless and should be avoided (it's never used and immediately discarded).
To achieve this goal, let-expressions have to be refactored to allow more than one statement, probably in the form of block-expressions to give even more freedom.
Comma-expressions (see Lower.makeComma()) could then be translated naturally without any temporary variable.
- relates to
-
JDK-8147527 Wrong code generated for postfix unary operators
-
- Closed
-
- links to