diff options
| author | 2016-06-07 14:14:37 +0000 | |
|---|---|---|
| committer | 2016-06-07 17:29:50 +0100 | |
| commit | 2f116815ae4344c30a9eab1984563b3d969bd769 (patch) | |
| tree | e57d5d01707364e0fcd11d03f5778018182de889 /compiler/optimizing | |
| parent | f102faf1bcbdb2149e3e7bf27b1819f621b7894b (diff) | |
Revert "Revert "Fix ArtMethod::GetInvokeType for static methods on interfaces.""
bug:29089267
bug:27521545
We were hitting a compiler DCHECK that a class would never require to
do access checks on itself. The reason was that the compiler driver
was not trying to resolve a type, but instead relied on the verifier
for pre-populating the dex cache. However, the verifier doesn't
necessarily run in JIT mode.
This reverts commit 12abcbd950bd0ff4528e2e0d27ca5e881c7b0467.
(cherry picked from commit 3aaf9645639ff56fbfe49a981242cbda01d6796e)
Change-Id: I2f0de6e4f00f336dc61b2378054fb6d27a7298d0
Diffstat (limited to 'compiler/optimizing')
| -rw-r--r-- | compiler/optimizing/optimizing_compiler.cc | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/compiler/optimizing/optimizing_compiler.cc b/compiler/optimizing/optimizing_compiler.cc index 0e0a30b4a3..c9a4bfe987 100644 --- a/compiler/optimizing/optimizing_compiler.cc +++ b/compiler/optimizing/optimizing_compiler.cc @@ -696,6 +696,16 @@ CodeGenerator* OptimizingCompiler::TryCompile(ArenaAllocator* arena, graph->SetArtMethod(method); ScopedObjectAccess soa(Thread::Current()); interpreter_metadata = method->GetQuickenedInfo(); + uint16_t type_index = method->GetDeclaringClass()->GetDexTypeIndex(); + + // Update the dex cache if the type is not in it yet. Note that under AOT, + // the verifier must have set it, but under JIT, there's no guarantee, as we + // don't necessarily run the verifier. + // The compiler and the compiler driver assume the compiling class is + // in the dex cache. + if (dex_cache->GetResolvedType(type_index) == nullptr) { + dex_cache->SetResolvedType(type_index, method->GetDeclaringClass()); + } } std::unique_ptr<CodeGenerator> codegen( |