RegAlloc::_node_regs maintains an assignment of registers to nodes between register allocation and code emission. This mapping is currently implemented as a raw array. To accommodate nodes created after its allocation, it is given a fixed length of n + n / 2 + 200, where n is the number of nodes at its allocation point. The fixed-length array implementation has two issues:
1. Lack of correctness guarantees: it does not prevent by construction out-of-bounds accesses, e.g. in the face of programs with a high density of CISC spill instructions (see JDK-8317507) or target-specific peephole optimizations creating a large number of nodes.
2. Memory inefficiency: it generally allocates considerably more memory than necessary.
RegAlloc::_node_regs could be implemented as a growable array instead. Using a growable array would prevent out-of-bound accesses by construction and make it possible to allocate significantly less memory while still avoiding expensive array grow operations in the vast majority of compilations.
Three scheduling mappings are currently also implemented as raw arrays of the same length as _node_regs. They could be revisited as well.