From d23d7d145c86975acbcc75505b8a323337066ac0 Mon Sep 17 00:00:00 2001 From: Mathieu Chartier Date: Wed, 27 Apr 2016 21:03:42 +0000 Subject: Revert "Write conflict tables in image" Some strange issues on angler. This reverts commit cda9386add68d94697449c6cb08b356747e55c21. (cherry picked from commit 8e2478d23e89a7022c93ddc608dcbba7b29b91e6) Change-Id: Iffd25c5fb732ff72b58c787c107dc33c56f8c8d4 --- runtime/runtime.cc | 31 ++++++++++--------------------- 1 file changed, 10 insertions(+), 21 deletions(-) (limited to 'runtime/runtime.cc') 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(&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(&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(&empty_entry)); } } -- cgit v1.2.3-59-g8ed1b