summaryrefslogtreecommitdiff
path: root/runtime/runtime.cc
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/runtime.cc')
-rw-r--r--runtime/runtime.cc42
1 files changed, 18 insertions, 24 deletions
diff --git a/runtime/runtime.cc b/runtime/runtime.cc
index 9ca00b1195..23a7db614c 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"
@@ -73,6 +75,7 @@
#include "mirror/art_method-inl.h"
#include "mirror/class-inl.h"
#include "mirror/class_loader.h"
+#include "mirror/field.h"
#include "mirror/stack_trace_element.h"
#include "mirror/throwable.h"
#include "monitor.h"
@@ -163,7 +166,6 @@ Runtime::Runtime()
method_trace_(false),
method_trace_file_size_(0),
instrumentation_(),
- use_compile_time_class_path_(false),
main_thread_group_(nullptr),
system_thread_group_(nullptr),
system_class_loader_(nullptr),
@@ -405,9 +407,9 @@ bool Runtime::Create(const RuntimeOptions& options, bool ignore_unrecognized) {
return true;
}
-static jobject CreateSystemClassLoader() {
- if (Runtime::Current()->UseCompileTimeClassPath()) {
- return NULL;
+static jobject CreateSystemClassLoader(Runtime* runtime) {
+ if (runtime->IsAotCompiler() && !runtime->GetCompilerCallbacks()->IsBootImage()) {
+ return nullptr;
}
ScopedObjectAccess soa(Thread::Current());
@@ -505,7 +507,7 @@ bool Runtime::Start() {
Thread::FinishStartup();
- system_class_loader_ = CreateSystemClassLoader();
+ system_class_loader_ = CreateSystemClassLoader(this);
if (is_zygote_) {
if (!InitZygote()) {
@@ -1011,8 +1013,8 @@ bool Runtime::Init(const RuntimeOptions& raw_options, bool ignore_unrecognized)
-1,
static_cast<int>(method_trace_file_size_),
0,
- false,
- false,
+ Trace::TraceOutputMode::kFile,
+ Trace::TraceMode::kMethodTracing,
0);
}
@@ -1290,6 +1292,7 @@ void Runtime::VisitConstantRoots(RootCallback* callback, void* arg) {
mirror::StackTraceElement::VisitRoots(callback, arg);
mirror::String::VisitRoots(callback, arg);
mirror::Throwable::VisitRoots(callback, arg);
+ mirror::Field::VisitRoots(callback, arg);
// Visit all the primitive array types classes.
mirror::PrimitiveArray<uint8_t>::VisitRoots(callback, arg); // BooleanArray
mirror::PrimitiveArray<int8_t>::VisitRoots(callback, arg); // ByteArray
@@ -1483,23 +1486,6 @@ void Runtime::SetCalleeSaveMethod(mirror::ArtMethod* method, CalleeSaveType type
callee_save_methods_[type] = GcRoot<mirror::ArtMethod>(method);
}
-const std::vector<const DexFile*>& Runtime::GetCompileTimeClassPath(jobject class_loader) {
- if (class_loader == NULL) {
- return GetClassLinker()->GetBootClassPath();
- }
- CHECK(UseCompileTimeClassPath());
- CompileTimeClassPaths::const_iterator it = compile_time_class_paths_.find(class_loader);
- CHECK(it != compile_time_class_paths_.end());
- return it->second;
-}
-
-void Runtime::SetCompileTimeClassPath(jobject class_loader,
- std::vector<const DexFile*>& class_path) {
- CHECK(!IsStarted());
- use_compile_time_class_path_ = true;
- compile_time_class_paths_.Put(class_loader, class_path);
-}
-
void Runtime::StartProfiler(const char* profile_output_filename) {
profile_output_filename_ = profile_output_filename;
profiler_started_ =
@@ -1671,4 +1657,12 @@ void Runtime::CreateJit() {
}
}
+bool Runtime::CanRelocate() const {
+ return !IsAotCompiler() || compiler_callbacks_->IsRelocationPossible();
+}
+
+bool Runtime::IsCompilingBootImage() const {
+ return IsCompiler() && compiler_callbacks_->IsBootImage();
+}
+
} // namespace art