Tiered attribution for javac [JEP 215]
JEP 215 represents an impressive undertaking to streamline javac's type checking schema. Let's first review how type checking works in Java 8; then we will explore the changes in Java 9.
In Java 8, type checking of poly expressions is handled by a speculative attribution tool.
Note
Speculative attribution is a method of type checking as part of javac's compilation process. It has a significant processing overhead.
Using the speculative attribution approach to type checking is accurate, but lacks efficiency. These checks include argument position, and are exponentially slower when testing in the midst of recursion, polymorphism, nested loops, and lambda expressions. So the goal with JEP 215 was to change the type checking schema to create faster results. The results themselves were not inaccurate with speculative attribution; they were just not generated rapidly.
The new approach, released with Java 9, uses a tiered attribution tool. This tool implements...