diff options
| author | 2016-04-27 21:03:42 +0000 | |
|---|---|---|
| committer | 2016-04-28 15:18:10 -0700 | |
| commit | d23d7d145c86975acbcc75505b8a323337066ac0 (patch) | |
| tree | a62d4397dd54fa1ee65ce870e3c0b0b965f43868 /runtime/runtime.cc | |
| parent | 85e47976a483844177eb486d6e501fa070fbe6e2 (diff) | |
Revert "Write conflict tables in image"
Some strange issues on angler.
This reverts commit cda9386add68d94697449c6cb08b356747e55c21.
(cherry picked from commit 8e2478d23e89a7022c93ddc608dcbba7b29b91e6)
Change-Id: Iffd25c5fb732ff72b58c787c107dc33c56f8c8d4
Diffstat (limited to 'runtime/runtime.cc')
| -rw-r--r-- | runtime/runtime.cc | 31 |
1 files changed, 10 insertions, 21 deletions
diff --git a/runtime/runtime.cc b/runtime/runtime.cc index 95995fb7b4..a4d31ef123 100644 --- a/runtime/runtime.cc +++ b/runtime/runtime.cc @@ -1613,19 +1613,18 @@ void Runtime::VisitImageRoots(RootVisitor* visitor) { } } +static ImtConflictTable::Entry empty_entry = { nullptr, nullptr }; + ArtMethod* Runtime::CreateImtConflictMethod(LinearAlloc* linear_alloc) { - ClassLinker* const class_linker = GetClassLinker(); - ArtMethod* method = class_linker->CreateRuntimeMethod(linear_alloc); + auto* method = Runtime::Current()->GetClassLinker()->CreateRuntimeMethod(linear_alloc); // When compiling, the code pointer will get set later when the image is loaded. - const size_t pointer_size = GetInstructionSetPointerSize(instruction_set_); if (IsAotCompiler()) { + size_t pointer_size = GetInstructionSetPointerSize(instruction_set_); method->SetEntryPointFromQuickCompiledCodePtrSize(nullptr, pointer_size); } else { method->SetEntryPointFromQuickCompiledCode(GetQuickImtConflictStub()); + method->SetImtConflictTable(reinterpret_cast<ImtConflictTable*>(&empty_entry)); } - // Create empty conflict table. - method->SetImtConflictTable(class_linker->CreateImtConflictTable(/*count*/0u, linear_alloc), - pointer_size); return method; } @@ -1633,6 +1632,9 @@ void Runtime::SetImtConflictMethod(ArtMethod* method) { CHECK(method != nullptr); CHECK(method->IsRuntimeMethod()); imt_conflict_method_ = method; + if (!IsAotCompiler()) { + method->SetImtConflictTable(reinterpret_cast<ImtConflictTable*>(&empty_entry)); + } } ArtMethod* Runtime::CreateResolutionMethod() { @@ -1942,21 +1944,8 @@ void Runtime::SetImtUnimplementedMethod(ArtMethod* method) { CHECK(method != nullptr); CHECK(method->IsRuntimeMethod()); imt_unimplemented_method_ = method; -} - -void Runtime::FixupConflictTables() { - // We can only do this after the class linker is created. - const size_t pointer_size = GetClassLinker()->GetImagePointerSize(); - // Ones in image wont have correct tables. TODO: Fix. - if (imt_unimplemented_method_->GetImtConflictTable(pointer_size) == nullptr || (true)) { - imt_unimplemented_method_->SetImtConflictTable( - ClassLinker::CreateImtConflictTable(/*count*/0u, GetLinearAlloc(), pointer_size), - pointer_size); - } - if (imt_conflict_method_->GetImtConflictTable(pointer_size) == nullptr || (true)) { - imt_conflict_method_->SetImtConflictTable( - ClassLinker::CreateImtConflictTable(/*count*/0u, GetLinearAlloc(), pointer_size), - pointer_size); + if (!IsAotCompiler()) { + method->SetImtConflictTable(reinterpret_cast<ImtConflictTable*>(&empty_entry)); } } |