Reputation: 875
According to section 17.4 of JLS8 there are two Transformations of the Java Code performed by the Compiler:
Is there any other transformations which can be performed by the Java Compiler?
Upvotes: 1
Views: 60
Reputation: 62653
Yes, there is other transformations, according to the JLS :
[The memory model] provides a great deal of freedom for the implementor to perform a myriad of code transformations, including the reordering of actions and removal of unnecessary synchronization.
As long as the memory model is respected, compiler implementations are allowed to perform any transformations.
Upvotes: 3