ART: Some runtime cleanup
Use an enum for the compiler-callback mode.
Refactor and remove some unnecessary includes in runtime.h.
Change-Id: If2245fa470171311b8e05b677cf6bb28f209585a
diff --git a/runtime/runtime.cc b/runtime/runtime.cc
index ffe3dc6..c462153 100644
--- a/runtime/runtime.cc
+++ b/runtime/runtime.cc
@@ -50,9 +50,11 @@
#include "arch/x86_64/registers_x86_64.h"
#include "asm_support.h"
#include "atomic.h"
+#include "base/arena_allocator.h"
#include "base/dumpable.h"
#include "base/unix_file/fd_file.h"
#include "class_linker.h"
+#include "compiler_callbacks.h"
#include "debugger.h"
#include "elf_file.h"
#include "entrypoints/runtime_asm_entrypoints.h"
@@ -1653,4 +1655,12 @@
}
}
+bool Runtime::CanRelocate() const {
+ return !IsAotCompiler() || compiler_callbacks_->IsRelocationPossible();
+}
+
+bool Runtime::IsCompilingBootImage() const {
+ return IsCompiler() && compiler_callbacks_->IsBootImage();
+}
+
} // namespace art