Vitaly
Vitaly

Reputation: 875

Transformations of Java Compiler

According to section 17.4 of JLS8 there are two Transformations of the Java Code performed by the Compiler:

  1. Statement Reordering
  2. Forward Substitution

Is there any other transformations which can be performed by the Java Compiler?

Upvotes: 1

Views: 60

Answers (1)

Ortomala Lokni
Ortomala Lokni

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

Related Questions