Make JNI work correctly with default methods.

Also adds some tests for JNI and DefaultMethods.

Bug: 27259142
Bug: 24618811

Change-Id: I31222e3e41059d803be1dbb0f40e1144ac4bf457
diff --git a/compiler/driver/compiler_driver.cc b/compiler/driver/compiler_driver.cc
index a51dd32..9ed5ec8 100644
--- a/compiler/driver/compiler_driver.cc
+++ b/compiler/driver/compiler_driver.cc
@@ -1077,10 +1077,8 @@
                              image_classes);
     }
     for (auto& m : c->GetVirtualMethods(pointer_size)) {
-      if (m.IsMiranda() || (true)) {
-        StackHandleScope<1> hs2(self);
-        MaybeAddToImageClasses(hs2.NewHandle(m.GetDeclaringClass()), image_classes);
-      }
+      StackHandleScope<1> hs2(self);
+      MaybeAddToImageClasses(hs2.NewHandle(m.GetDeclaringClass()), image_classes);
     }
     if (klass->IsArrayClass()) {
       StackHandleScope<1> hs2(self);
diff --git a/compiler/image_writer.cc b/compiler/image_writer.cc
index d50528e..3d31309 100644
--- a/compiler/image_writer.cc
+++ b/compiler/image_writer.cc
@@ -917,7 +917,7 @@
       // Copied methods may be held live by a class which was not an image class but have a
       // declaring class which is an image class. Set it to the resolution method to be safe and
       // prevent dangling pointers.
-      if (method->MightBeCopied() || !KeepClass(declaring_class)) {
+      if (method->IsCopied() || !KeepClass(declaring_class)) {
         mirror::DexCache::SetElementPtrSize(resolved_methods,
                                             i,
                                             resolution_method,
diff --git a/compiler/oat_test.cc b/compiler/oat_test.cc
index d3b404a..fead839 100644
--- a/compiler/oat_test.cc
+++ b/compiler/oat_test.cc
@@ -416,7 +416,7 @@
     // TODO We should also check copied methods in this test.
     for (auto& m : klass->GetDeclaredVirtualMethods(pointer_size)) {
       if (!klass->IsInterface()) {
-        EXPECT_FALSE(m.MightBeCopied());
+        EXPECT_FALSE(m.IsCopied());
       }
       CheckMethod(&m, oat_class.GetOatMethod(method_index), dex_file);
       ++method_index;