The NoEscapes annotation is added to the Throwable constructors when building the RVM. If the EscapeTransformations phase decides that the exception or any of its parameters do not escape the scope it removes the call to the constructor. This bug has a potential to break the VM. E.g. if the compiler decides to inline the non-copying String constructor in TypeReference.resolve(), ncdfe is left in an uninitialised state and initCause throws an Illegal State exception when the VM boots up.
To reproduce, execute the included Java program with -X:aos:initial_compiler=opt -X:aos:enable_recompilation=false . The expected output is "Hello World!". With the bug it prints "null null!"
A patch that disables the special handling of the NoEscapes annotation is included.
Reproduced on MacOS and Linux.