In Type::Initialize, we copy the shared type Dict into a Dict to be used during compilation. This is done with an iteration over the shared dictionary. There is an existing deep copy constructor for Dict, but this actually seems broken (doesn't set _cnt) and inappropriate (doesn't allow specifying arena).
A quick stab at fixing these issues and deep copying the shared type dict reduces each C2 compilation by ~32k insns.
A quick stab at fixing these issues and deep copying the shared type dict reduces each C2 compilation by ~32k insns.