Pass the right class loader when inlining.
Otherwise, method and type resolution can resolve to the wrong
things and as a side effect update the dex cache with wrong data.
bug:30403437
test:./art/test/run-test --host --jit --dev --no-prebuild 613
(cherry picked from commit 0a210d9b108c87c0e7c1d430a92ce6fc89790c95)
Change-Id: I8fdca96fccae079c8e99b8e86e7b6935acfce89d
diff --git a/compiler/optimizing/inliner.cc b/compiler/optimizing/inliner.cc
index a592162..aab24eb 100644
--- a/compiler/optimizing/inliner.cc
+++ b/compiler/optimizing/inliner.cc
@@ -1087,8 +1087,11 @@
uint32_t method_index = resolved_method->GetDexMethodIndex();
ClassLinker* class_linker = caller_compilation_unit_.GetClassLinker();
Handle<mirror::DexCache> dex_cache(handles_->NewHandle(resolved_method->GetDexCache()));
+ Handle<mirror::ClassLoader> class_loader(handles_->NewHandle(
+ resolved_method->GetDeclaringClass()->GetClassLoader()));
+
DexCompilationUnit dex_compilation_unit(
- caller_compilation_unit_.GetClassLoader(),
+ class_loader.ToJObject(),
class_linker,
callee_dex_file,
code_item,