Revert "Write conflict tables in image"

Some strange issues on angler.

This reverts commit cda9386add68d94697449c6cb08b356747e55c21.

(cherry picked from commit 8e2478d23e89a7022c93ddc608dcbba7b29b91e6)

Change-Id: Iffd25c5fb732ff72b58c787c107dc33c56f8c8d4
diff --git a/runtime/runtime.cc b/runtime/runtime.cc
index 95995fb..a4d31ef 100644
--- a/runtime/runtime.cc
+++ b/runtime/runtime.cc
@@ -1613,19 +1613,18 @@
   }
 }
 
+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 @@
   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 @@
   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));
   }
 }