This is nontrivial because lots of optimizations depend on class load ordering and runtime profile information.