Although initial purpose of this comment was null check,
it took much time to complete it and it caused many unrelated changes.
Besides just implementing null check in quite naive fashion
(I could not use the trick with memory protection, since I have to
maintain shadow stack, and support WebAssembly), I had to optimize
things. I relied on my existing nullness analysis to eliminate
as much null checks as possible. However, the whole nullness analysis
was wrong. After some thoughts I came up with solution very
close to range analysis, which required me to introduce extension
to IR sometimes called e-SSA form with so called sigma nodes.
Also, I found some bugs in few different places (by the time write this
message I could only remember escape analysis/scalar replacement and
after-inlining devirtualization) and fixed them.
1. During dependency analysis, propagate class literals from
Class.forName return node
2. Use original class source to generate reflection metadata
3. Link classes when they appear in signature of reflectable methods
4. Turn Class.forName(string_literal) into class literal.
The old assumption was: if a block has instructions, it was already processed. However, that might be not true in some cases. This led to duplication of exception handlers in some blocks which in turn broken decompiler. From now on processed blocks are stored in a set.
Since in Java 8 there are default methods in interface, method
resolution algorithm becomes more complicated. This alseocauses
several related changes.
1. Resolve methods as late as possible; do not resolve
virtual call sites during DCE.
2. Due to several reasons we have to improve linking phase
to preserve super methods that aren't actually ever called,
but present in virtual call sites.
Related issue: #311