Code that must be allocation free cannot throw new
AssertionError
. Therefore we convert
the allocation of the error and the constructor invocation to a
BytecodeExceptionNode
that is later lowered to either the allocation-free or the allocating variants in
ImplicitExceptions
.
We only intrinsify the two most common constructors: the nullary constructor (no parameters), and
the constructor that takes a single Object parameter. The other variants are not used in
low-level VM code that must be allocation free, and are rarely used in general.
A side-benefit of this phase is reduced code size of images with assertions enabled, since the
pretty complex machine code for allocation is not inlined at every assertion.