Quick compiler: Method* as a reference

This is the first of two CLs intended to fix up and make consistent
the handling of references in the Quick backend.  A sibling
CL c/96237 updates the runtime to treat Method* as a compressed
reference when stored.  This CL makes a similar change for the
backend.

As far as the general handling of in-register references, though,
the current Quick backend is not consistent even for non-Method*
references.  Sometimes they are treated as references, but other
times are handled as if they were 32-bit ints.  A subsequent CL
will deal with that issue.

Change-Id: I5591c5eea6cca6ed22208ab806fd38b959c9d03d
diff --git a/compiler/dex/quick/gen_invoke.cc b/compiler/dex/quick/gen_invoke.cc
index a6d56bd..eef3294 100644
--- a/compiler/dex/quick/gen_invoke.cc
+++ b/compiler/dex/quick/gen_invoke.cc
@@ -443,14 +443,10 @@
   rl_src.reg = TargetReg(kArg0);
   rl_src.home = false;
   MarkLive(rl_src);
-  if (rl_method.wide) {
-    StoreValueWide(rl_method, rl_src);
-  } else {
-    StoreValue(rl_method, rl_src);
-  }
+  StoreValue(rl_method, rl_src);
   // If Method* has been promoted, explicitly flush
   if (rl_method.location == kLocPhysReg) {
-    StoreWordDisp(TargetReg(kSp), 0, TargetReg(kArg0));
+    StoreRefDisp(TargetReg(kSp), 0, TargetReg(kArg0));
   }
 
   if (cu_->num_ins == 0) {
diff --git a/compiler/dex/vreg_analysis.cc b/compiler/dex/vreg_analysis.cc
index 95b3d86..a4c62ad 100644
--- a/compiler/dex/vreg_analysis.cc
+++ b/compiler/dex/vreg_analysis.cc
@@ -425,6 +425,9 @@
     loc[ct->s_reg_low].defined = true;
   }
 
+  /* Treat Method* as a normal reference */
+  loc[GetMethodSReg()].ref = true;
+
   reg_location_ = loc;
 
   int num_regs = cu_->num_dalvik_registers;