ART: Remove WriteElf from Compiler
As Portable is gone, we only have one elf_writer left. It also
allows to put the decision for 32b vs 64b ELF into a central
point.
Change-Id: Iae67d06df85268b3f0ee5725abc65edd23eb2499
diff --git a/compiler/driver/compiler_driver.cc b/compiler/driver/compiler_driver.cc
index c2b8375..f263f6d 100644
--- a/compiler/driver/compiler_driver.cc
+++ b/compiler/driver/compiler_driver.cc
@@ -40,6 +40,7 @@
#include "dex/verified_method.h"
#include "dex/quick/dex_file_method_inliner.h"
#include "driver/compiler_options.h"
+#include "elf_writer_quick.h"
#include "jni_internal.h"
#include "object_lock.h"
#include "profiler.h"
@@ -72,6 +73,9 @@
static constexpr bool kTimeCompileMethod = !kIsDebugBuild;
+// Whether to produce 64-bit ELF files for 64-bit targets. Leave this off for now.
+static constexpr bool kProduce64BitELFFiles = false;
+
static double Percentage(size_t x, size_t y) {
return 100.0 * (static_cast<double>(x)) / (static_cast<double>(x + y));
}
@@ -2368,7 +2372,11 @@
OatWriter* oat_writer,
art::File* file)
SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) {
- return compiler_->WriteElf(file, oat_writer, dex_files, android_root, is_host);
+ if (kProduce64BitELFFiles && Is64BitInstructionSet(GetInstructionSet())) {
+ return art::ElfWriterQuick64::Create(file, oat_writer, dex_files, android_root, is_host, *this);
+ } else {
+ return art::ElfWriterQuick32::Create(file, oat_writer, dex_files, android_root, is_host, *this);
+ }
}
bool CompilerDriver::SkipCompilation(const std::string& method_name) {