diff options
| author | 2016-02-22 13:43:29 -0800 | |
|---|---|---|
| committer | 2016-02-23 13:24:05 -0800 | |
| commit | 3612149aee482ab7a17da68b0ef5fef3879729a2 (patch) | |
| tree | 42180a35266333cbf37163a12185cf8824255a71 /compiler | |
| parent | a5502e31cb558c6e257d1dd1889c073a793e3d9d (diff) | |
Make JNI work correctly with default methods.
Also adds some tests for JNI and DefaultMethods.
Bug: 27259142
Bug: 24618811
Change-Id: I31222e3e41059d803be1dbb0f40e1144ac4bf457
Diffstat (limited to 'compiler')
| -rw-r--r-- | compiler/driver/compiler_driver.cc | 6 | ||||
| -rw-r--r-- | compiler/image_writer.cc | 2 | ||||
| -rw-r--r-- | compiler/oat_test.cc | 2 |
3 files changed, 4 insertions, 6 deletions
diff --git a/compiler/driver/compiler_driver.cc b/compiler/driver/compiler_driver.cc index a51dd3209b..9ed5ec80b2 100644 --- a/compiler/driver/compiler_driver.cc +++ b/compiler/driver/compiler_driver.cc @@ -1077,10 +1077,8 @@ static void MaybeAddToImageClasses(Handle<mirror::Class> c, 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 d50528edee..3d3130962a 100644 --- a/compiler/image_writer.cc +++ b/compiler/image_writer.cc @@ -917,7 +917,7 @@ void ImageWriter::PruneNonImageClasses() { // 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 d3b404a3b6..fead839263 100644 --- a/compiler/oat_test.cc +++ b/compiler/oat_test.cc @@ -416,7 +416,7 @@ TEST_F(OatTest, WriteRead) { // 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; |