Added second pass which does code flow checking to verifier.

Ran this through libcore and it finds no errors, but I still need to
create tests to make sure it catches errors when it should. Also, it's
still missing 2 pieces, replacement of failing opcodes and generation of
the register map.

Change-Id: I0f4c4c20751b5b030ca44c23e1d1c2e133404e0c
diff --git a/src/object.h b/src/object.h
index 050f571..9106472 100644
--- a/src/object.h
+++ b/src/object.h
@@ -82,6 +82,7 @@
 
 static const uint32_t kAccConstructor = 0x00010000;  // method (Dalvik only)
 static const uint32_t kAccDeclaredSynchronized = 0x00020000;  // method (Dalvik only)
+static const uint32_t kAccWritable = 0x80000000; // method (Dalvik only)
 
 static const uint32_t kAccClassFlagsMask = (kAccPublic
                                             | kAccFinal
@@ -501,6 +502,10 @@
     return (GetAccessFlags() & kAccStatic) != 0;
   }
 
+  bool IsFinal() const {
+    return (access_flags_ & kAccFinal) != 0;
+  }
+
   uint32_t GetTypeIdx() const;
 
   void SetTypeIdx(uint32_t type_idx);
@@ -1666,6 +1671,9 @@
   // method for this class.
   Method* FindVirtualMethodForInterface(Method* method);
 
+  Method* FindInterfaceMethod(const StringPiece& name,
+                              const StringPiece& descriptor);
+
   Method* FindVirtualMethodForVirtualOrInterface(Method* method) {
     if (method->GetDeclaringClass()->IsInterface()) {
       return FindVirtualMethodForInterface(method);
@@ -1931,8 +1939,9 @@
                              new_source_file, false);
   }
 
- private:
   bool Implements(const Class* klass) const;
+
+ private:
   bool IsArrayAssignableFromArray(const Class* klass) const;
   bool IsAssignableFromArray(const Class* klass) const;
   bool IsSubClass(const Class* klass) const;
@@ -1977,7 +1986,7 @@
   // is 2.  Otherwise 0.
   int32_t array_rank_;
 
-  // primitive type index, or PRIM_NOT (-1); set for generated prim classes
+  // primitive type index, or kPrimNot (0); set for generated prim classes
   PrimitiveType primitive_type_;
 
   // The superclass, or NULL if this is java.lang.Object or a