Compiler improvements also make room for languages, like Java, in more compact environments, allowing it to be used where assembler, C, and C++ are king. In many cases, the optimizations are very similar to those being applied in 8- and 16-bit microcontroller compilers. For example, arithmetic operations in a register-based machine aren't performed on the Java stack, but instead employ processor registers. The resulting code is as fast and as compact as comparable C or C++ code.
In many instances, method invocation and new object creation can be optimized as well. Global optimization often provides static-type information, enabling optimizations that aren't possible when considering code on a function or class basis.