const char* oat_cache_filename,
std::string* error_msg) {
Locks::mutator_lock_->AssertNotHeld(Thread::Current()); // Avoid starving GC.
- std::string dex2oat(GetAndroidRoot());
- dex2oat += (kIsDebugBuild ? "/bin/dex2oatd" : "/bin/dex2oat");
+ std::string dex2oat(Runtime::Current()->GetCompilerExecutable());
gc::Heap* heap = Runtime::Current()->GetHeap();
std::string boot_image_option("--boot-image=");
std::vector<std::string> arg_vector;
- std::string dex2oat(GetAndroidRoot());
- dex2oat += (kIsDebugBuild ? "/bin/dex2oatd" : "/bin/dex2oat");
+ std::string dex2oat(Runtime::Current()->GetCompilerExecutable());
arg_vector.push_back(dex2oat);
std::string image_option_string("--image=");
*/
#include "parsed_options.h"
+#include "utils.h"
#ifdef HAVE_ANDROID_OS
#include "cutils/properties.h"
#endif
return false;
}
}
+ } else if (StartsWith(option, "-Xcompiler:")) {
+ if (!ParseStringAfterChar(option, ':', &compiler_executable_)) {
+ return false;
+ }
} else if (option == "-Xcompiler-option") {
i++;
if (i == options.size()) {
UsageMessage(stream, " -Xprofile-duration:integervalue\n");
UsageMessage(stream, " -Xprofile-interval:integervalue\n");
UsageMessage(stream, " -Xprofile-backoff:doublevalue\n");
+ UsageMessage(stream, " -Xcompiler:filename\n");
UsageMessage(stream, " -Xcompiler-option dex2oat-option\n");
UsageMessage(stream, " -Ximage-compiler-option dex2oat-option\n");
UsageMessage(stream, "\n");
void (*hook_exit_)(jint status);
void (*hook_abort_)();
std::vector<std::string> properties_;
+ std::string compiler_executable_;
std::vector<std::string> compiler_options_;
std::vector<std::string> image_compiler_options_;
bool profile_;
return env->NewGlobalRef(system_class_loader.get());
}
+std::string Runtime::GetCompilerExecutable() const {
+ if (!compiler_executable_.empty()) {
+ return compiler_executable_;
+ }
+ std::string compiler_executable(GetAndroidRoot());
+ compiler_executable += (kIsDebugBuild ? "/bin/dex2oatd" : "/bin/dex2oat");
+ return compiler_executable;
+}
+
bool Runtime::Start() {
VLOG(startup) << "Runtime::Start entering";
default_stack_size_ = options->stack_size_;
stack_trace_file_ = options->stack_trace_file_;
+ compiler_executable_ = options->compiler_executable_;
compiler_options_ = options->compiler_options_;
image_compiler_options_ = options->image_compiler_options_;
return is_explicit_gc_disabled_;
}
+ std::string GetCompilerExecutable() const;
+
const std::vector<std::string>& GetCompilerOptions() const {
return compiler_options_;
}
bool is_concurrent_gc_enabled_;
bool is_explicit_gc_disabled_;
+ std::string compiler_executable_;
std::vector<std::string> compiler_options_;
std::vector<std::string> image_compiler_options_;