summaryrefslogtreecommitdiff
path: root/dex2oat/driver/compiler_driver_test.cc
diff options
context:
space:
mode:
author Vladimir Marko <vmarko@google.com> 2022-10-06 13:46:55 +0200
committer VladimĂ­r Marko <vmarko@google.com> 2022-10-06 15:02:53 +0000
commit8c5e881904c30de5dbc03536ea67bbe2d48088fd (patch)
treeb0bbf7c5120d7894d21131478640e6f7b8761975 /dex2oat/driver/compiler_driver_test.cc
parente1b8877890147b8572809266653677084e1a5112 (diff)
Remove `CompiledCode::CodePointer()`.
And clean up some related test helpers in preparation for moving `CompiledMethod` to dex2oat/. Test: m test-art-host-gtest Test: run-gtests.sh Change-Id: I13b42bfb4f6ee3a7f7f22bbc8d22203c5d56e00b
Diffstat (limited to 'dex2oat/driver/compiler_driver_test.cc')
-rw-r--r--dex2oat/driver/compiler_driver_test.cc18
1 files changed, 12 insertions, 6 deletions
diff --git a/dex2oat/driver/compiler_driver_test.cc b/dex2oat/driver/compiler_driver_test.cc
index 65aa88869f..7e3f40ce05 100644
--- a/dex2oat/driver/compiler_driver_test.cc
+++ b/dex2oat/driver/compiler_driver_test.cc
@@ -25,6 +25,7 @@
#include "base/casts.h"
#include "class_linker-inl.h"
#include "common_compiler_driver_test.h"
+#include "compiled_method-inl.h"
#include "compiler_callbacks.h"
#include "dex/dex_file.h"
#include "dex/dex_file_types.h"
@@ -80,14 +81,19 @@ class CompilerDriverTest : public CommonCompilerDriverTest {
void MakeExecutable(ArtMethod* method) REQUIRES_SHARED(Locks::mutator_lock_) {
CHECK(method != nullptr);
- const CompiledMethod* compiled_method = nullptr;
+ const void* method_code = nullptr;
if (!method->IsAbstract()) {
- const DexFile& dex_file = *method->GetDexFile();
- compiled_method =
- compiler_driver_->GetCompiledMethod(MethodReference(&dex_file,
- method->GetDexMethodIndex()));
+ MethodReference method_ref(method->GetDexFile(), method->GetDexMethodIndex());
+ const CompiledMethod* compiled_method = compiler_driver_->GetCompiledMethod(method_ref);
+ // If the code size is 0 it means the method was skipped due to profile guided compilation.
+ if (compiled_method != nullptr && compiled_method->GetQuickCode().size() != 0u) {
+ method_code = CommonCompilerTest::MakeExecutable(compiled_method->GetQuickCode(),
+ compiled_method->GetVmapTable(),
+ compiled_method->GetInstructionSet());
+ LOG(INFO) << "MakeExecutable " << method->PrettyMethod() << " code=" << method_code;
+ }
}
- CommonCompilerTest::MakeExecutable(method, compiled_method);
+ runtime_->GetInstrumentation()->InitializeMethodsCode(method, /*aot_code=*/ method_code);
}
void MakeDexFileExecutable(jobject class_loader, const DexFile& dex_file) {