Remove ClassLinker::SetEntryPointsToCompiledCode().
This function was used only for tests and it was essentially
just calling ArtMethod::SetEntryPointFromQuickCompiledCode()
in a very obscure way and required the memory before the
code pointer to contain a non-zero code size.
This is a follow-up to
https://android-review.googlesource.com/445648
that removed a problematic use of the function, calling it
with a pointer to an entrypoint instead of a pointer to
compiled managed code, i.e. without the pre-header that
should contain the non-zero code size.
Test: m test-art-host-gtest
Change-Id: I483450832443ea0589eb41c74491384bcd5d6ab8
diff --git a/compiler/common_compiler_test.cc b/compiler/common_compiler_test.cc
index a9a718f..0d38620 100644
--- a/compiler/common_compiler_test.cc
+++ b/compiler/common_compiler_test.cc
@@ -95,7 +95,7 @@
const void* method_code = CompiledMethod::CodePointer(code_ptr,
compiled_method->GetInstructionSet());
LOG(INFO) << "MakeExecutable " << method->PrettyMethod() << " code=" << method_code;
- class_linker_->SetEntryPointsToCompiledCode(method, method_code);
+ method->SetEntryPointFromQuickCompiledCode(method_code);
} else {
// No code? You must mean to go into the interpreter.
// Or the generic JNI...
diff --git a/runtime/class_linker.cc b/runtime/class_linker.cc
index 25000e5..dd2d6ba 100644
--- a/runtime/class_linker.cc
+++ b/runtime/class_linker.cc
@@ -8574,15 +8574,6 @@
return GetQuickGenericJniStub();
}
-void ClassLinker::SetEntryPointsToCompiledCode(ArtMethod* method, const void* code) const {
- CHECK(code != nullptr);
- const uint8_t* base = reinterpret_cast<const uint8_t*>(code); // Base of data points at code.
- base -= sizeof(void*); // Move backward so that code_offset != 0.
- const uint32_t code_offset = sizeof(void*);
- OatFile::OatMethod oat_method(base, code_offset);
- oat_method.LinkMethod(method);
-}
-
void ClassLinker::SetEntryPointsToInterpreter(ArtMethod* method) const {
if (!method->IsNative()) {
method->SetEntryPointFromQuickCompiledCode(GetQuickToInterpreterBridge());
diff --git a/runtime/class_linker.h b/runtime/class_linker.h
index 62fb45b..5fdcbb6 100644
--- a/runtime/class_linker.h
+++ b/runtime/class_linker.h
@@ -511,10 +511,6 @@
return intern_table_;
}
- // Set the entrypoints up for method to the given code.
- void SetEntryPointsToCompiledCode(ArtMethod* method, const void* method_code) const
- REQUIRES_SHARED(Locks::mutator_lock_);
-
// Set the entrypoints up for method to the enter the interpreter.
void SetEntryPointsToInterpreter(ArtMethod* method) const
REQUIRES_SHARED(Locks::mutator_lock_);