Igor pointed me that null could be passed as argument so its value
will be not known during compilation.
Added null check with uncommon trap but using special Reason_intrinsic.
The test is updated to pass null as argument.
Vladimir Kozlov wrote:
> Fixed 7009359: HS with -XX:+AggressiveOpts optimize new StringBuffer(null) so it does not throw NPE as expected
> StringConcat optimization replace new StringBuffer(null).toString()
> with new String("null") because new StringBuffer.append(null) is
> producing such string. Passing null to StringBuffer constructor
> is a special case which was not checked.
> Bailout StringConcat optimization if null is passed to
> StringBuffer constructor. Added regression test.