Share dex register maps between stack maps when possible.

If two stack maps have the same dex register map then one of them will
reference the register map from the other instead of owning an
independent copy.

This saves around 1.5% of space.

Change-Id: Ic2c2c81210c6c45a5c5f650f7ba82a46ff6f45e4
diff --git a/runtime/stack_map.h b/runtime/stack_map.h
index 629fc9a..6ec7cc8 100644
--- a/runtime/stack_map.h
+++ b/runtime/stack_map.h
@@ -212,6 +212,14 @@
   // Get the actual kind of the location.
   Kind GetInternalKind() const { return kind_; }
 
+  bool operator==(DexRegisterLocation other) const {
+    return kind_ == other.kind_ && value_ == other.value_;
+  }
+
+  bool operator!=(DexRegisterLocation other) const {
+    return !(*this == other);
+  }
+
  private:
   Kind kind_;
   int32_t value_;