Method.copy() and leafCopy() creates a copy of a Method object with sharing MethodAccessor object. Since the methodAccessor field is a volatile variable, copying this field needs memory fence to ensure the field is visible to all threads on the weak memory platforms such as POWER and ARM.
When the methodAccessor of the root object is null (i.e., not initialized yet), we do not need to copy the null value because this field of the copied object has been initialized to null in the constructor. We can reduce overhead of the memory fence only when the root's methodAccessor is non-null.