title: What are the 'shadow$_klass_' and 'shadow$_monitor_' variables for in java.lang.Object?
body: <p>In the latest Android update (SDK 21), it appears that two new variables have been added to <code>java.lang.Object</code>:</p>
  
  <pre><code>private transient Class&lt;?&gt; shadow$_klass_;
  private transient int shadow$_monitor_;
  </code></pre>
  
  <p>I notice that <code>shadow$_monitor_</code> is briefly used in <code>hashCode()</code>:</p>
  
  <pre><code>public int hashCode() {
      int lockWord = shadow$_monitor_;
      final int lockWordMask = 0xC0000000;  // Top 2 bits.
      final int lockWordStateHash = 0x80000000;  // Top 2 bits are value 2 (kStateHash).
      if ((lockWord &amp; lockWordMask) == lockWordStateHash) {
          return lockWord &amp; ~lockWordMask;
      }
      return System.identityHashCode(this);
  }
  </code></pre>
  
  <p>But otherwise there are no references to them.  Are they somehow related to GC in ART? Or some sort of native stuff?</p>