Interpreter.

The opcodes filled-new-array and packed-switch aren't implemented but
are trivial given that they are variants of implemented opcodes.
Refactor Field::Get routines to take the declaring class in the case of
static field accesses. This avoids a check on every use of a field.
Refactor arg array builder to be shared by JNI invokes and invocations
into the interpreter.
Fix benign bug in const decoding in the verifier.

Change-Id: I8dee6c1f4b7f033e6c003422c56e9471cfaccda8
diff --git a/src/object_utils.h b/src/object_utils.h
index c6e71c3..661773a 100644
--- a/src/object_utils.h
+++ b/src/object_utils.h
@@ -647,7 +647,7 @@
 
   Class* GetDexCacheResolvedType(uint16_t type_idx)
       SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) {
-    return GetDexCache()->GetResolvedType(type_idx);
+    return method_->GetDexCacheResolvedTypes()->Get(type_idx);
   }
 
   const DexFile& GetDexFile() SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) {
@@ -669,11 +669,26 @@
     return result;
   }
 
+  String* ResolveString(uint32_t string_idx) SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) {
+    String* s = method_->GetDexCacheStrings()->Get(string_idx);
+    if (UNLIKELY(s == NULL)) {
+      s = GetClassLinker()->ResolveString(GetDexFile(), string_idx, GetDexCache());
+    }
+    return s;
+  }
+
+  Class* ResolveClass(uint16_t type_idx) SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) {
+    Class* c = GetDexCacheResolvedType(type_idx);
+    if (UNLIKELY(c == NULL)) {
+      c = GetClassLinker()->ResolveType(GetDexFile(), type_idx, GetDexCache(), GetClassLoader());
+    }
+    return c;
+  }
+
  private:
   // Set the method_ field, for proxy methods looking up the interface method via the resolved
   // methods table.
-  void SetMethod(const AbstractMethod* method)
-      SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) {
+  void SetMethod(const AbstractMethod* method) SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) {
     if (method != NULL) {
       Class* klass = method->GetDeclaringClass();
       if (klass->IsProxyClass()) {