diff options
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)); } } |