Optimizing away getter/setter calls and function call overhead in general is well within the reach of current compilers.
A very smart compiler could probably attempt to prove that no such modification can occur at run time throughout the whole program; but this is much harder than simply deciding whether inlining a given call is worth it or not.