Handle the case of referent clearing during tracing.
Reference objects with non-null referent fields are collected during
tracing for processing after the trace has completed. Before the
trace was made concurrent there was no way for a reference with a
non-null referent field to have its referent become null by any action
of the garbage collector after it was discovered. Assertions were
placed in the reference processing code to check this invariant.
After the trace was made concurrent it became possible for a user to
clear the referent field of an already discovered reference. This
violates the assertions in the reference processing code.
This change replaces the assertions in the reference processing code
with logic to deal with null referent fields. The assert in the
SoftReference preservation code has been converted to a continue that
short circuits the preservation logic. The assert in the white
reference clearing code short circuits the clearing and enqueueing.
Bug:
3342757
Change-Id: I967b011485e2691b2752500a3488fbcb54f129d3