Scalar Replacement

Turkish equivalent: Skaler değiştirmeDomain: Java and JVM

A compiler optimization that replaces an object allocation with its individual fields when escape analysis proves the object need not exist as a materialized heap object.

JVM Runtime Context

Scalar replacement lets the compiler represent an object's fields as independent scalar values when escape analysis proves that a materialized heap object is unnecessary. Values may remain in registers or SSA form, reducing allocation and later garbage-collection pressure.

Optimization Boundary

Source code still describes an object, and the JVM does not promise that scalar replacement will occur. If deoptimization requires the original object state, the runtime can materialize the object again.