diff options
| author | 2017-07-18 03:23:31 +0000 | |
|---|---|---|
| committer | 2017-07-18 03:23:31 +0000 | |
| commit | 0d32f4eb356b7823ee39a09e62dfcb496a6cc049 (patch) | |
| tree | 28f669c9e993ca22477690f415a9a553e27a68a2 /compiler/driver/compiler_driver.cc | |
| parent | 1847704d0422dcc75ac30ae0d3caaf210c05a755 (diff) | |
| parent | 93764b8ee58d54118904b8f4473628451e568893 (diff) | |
Merge "Generalize atomic_method_ref_map to support dex references"
Diffstat (limited to 'compiler/driver/compiler_driver.cc')
| -rw-r--r-- | compiler/driver/compiler_driver.cc | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/compiler/driver/compiler_driver.cc b/compiler/driver/compiler_driver.cc index ba77499c0c..83d7a3d4cc 100644 --- a/compiler/driver/compiler_driver.cc +++ b/compiler/driver/compiler_driver.cc @@ -71,7 +71,7 @@ #include "thread_pool.h" #include "trampolines/trampoline_compiler.h" #include "transaction.h" -#include "utils/atomic_method_ref_map-inl.h" +#include "utils/atomic_dex_ref_map-inl.h" #include "utils/dex_cache_arrays_layout-inl.h" #include "utils/swap_space.h" #include "vdex_file.h" @@ -321,7 +321,7 @@ CompilerDriver::CompilerDriver( } CompilerDriver::~CompilerDriver() { - compiled_methods_.Visit([this](const MethodReference& ref ATTRIBUTE_UNUSED, + compiled_methods_.Visit([this](const DexFileReference& ref ATTRIBUTE_UNUSED, CompiledMethod* method) { if (method != nullptr) { CompiledMethod::ReleaseSwapAllocatedCompiledMethod(this, method); @@ -900,7 +900,7 @@ void CompilerDriver::PreCompile(jobject class_loader, for (const DexFile* dex_file : dex_files) { // Can be already inserted if the caller is CompileOne. This happens for gtests. if (!compiled_methods_.HaveDexFile(dex_file)) { - compiled_methods_.AddDexFile(dex_file); + compiled_methods_.AddDexFile(dex_file, dex_file->NumMethodIds()); } } // Resolve eagerly to prepare for compilation. @@ -2848,9 +2848,10 @@ void CompilerDriver::AddCompiledMethod(const MethodReference& method_ref, size_t non_relative_linker_patch_count) { DCHECK(GetCompiledMethod(method_ref) == nullptr) << method_ref.dex_file->PrettyMethod(method_ref.dex_method_index); - MethodTable::InsertResult result = compiled_methods_.Insert(method_ref, - /*expected*/ nullptr, - compiled_method); + MethodTable::InsertResult result = compiled_methods_.Insert( + DexFileReference(method_ref.dex_file, method_ref.dex_method_index), + /*expected*/ nullptr, + compiled_method); CHECK(result == MethodTable::kInsertResultSuccess); non_relative_linker_patch_count_.FetchAndAddRelaxed(non_relative_linker_patch_count); DCHECK(GetCompiledMethod(method_ref) != nullptr) @@ -2898,7 +2899,7 @@ void CompilerDriver::RecordClassStatus(ClassReference ref, mirror::Class::Status CompiledMethod* CompilerDriver::GetCompiledMethod(MethodReference ref) const { CompiledMethod* compiled_method = nullptr; - compiled_methods_.Get(ref, &compiled_method); + compiled_methods_.Get(DexFileReference(ref.dex_file, ref.dex_method_index), &compiled_method); return compiled_method; } |