Remove unnecessary load class for new instance
Remove the load class for new instance if the load class has only one
use and can not throw. Previously many were not removed due to
MarkInDexCache nulling out the environment of the HLoadClass and
causing CanMoveClinitCheck to fail.
Also keep track of initialized HLoadClass and always remove clinit
checks for these.
Added checker regression test.
Code size savings: ARM64 CC boot.oat: 47896936 -> 47642488 (-0.53%)
Savings from IsInitialized optimization: 65984 bytes
Performance unmeasured, probably faster due to removing unnecessary
work.
Test: test-art-host with CC baker
Bug: 29516974
Change-Id: I43358762ffb380ebe7e6518d0d440a5e1cc03b61
5 files changed