Compile time null checks for VarHandle intrinsics.

Create a `VarHandleOptimizations` helper class holding the
optimization flags for VarHandle intrinsics.

Add a flag to avoid emitting the intrinsic implementation
and move shared checks previously duplicated in intrinsic
codegens helpers `HasVarHandleIntrinsicImplementation()` to
the instruction simplifier. Individual intrinsic codegens
perform additional checks as needed.

Add the first optimization flag to avoid null check on the
holder object if it cannot be null. And do not emit the
intrinsic implementation if the holder object is null.

Test: testrunner.py --host --optimizing
Test: testrunner.py --target --optimizing
Bug: 191765508
Change-Id: I53b1b57c327f02a9913f22885c1ce663cd9c3d44
6 files changed