diff options
author | Igor Murashkin <iam@google.com> | 2015-01-26 10:55:53 -0800 |
---|---|---|
committer | Igor Murashkin <iam@google.com> | 2015-02-04 13:29:19 -0800 |
commit | aaebaa0121be3b9d9f13630585304482cbcaeb4b (patch) | |
tree | 0f47257e497fdf920c8d703d2d00adab53934a76 /runtime/java_vm_ext.cc | |
parent | babecc483276b46d84cb83d4f01e577228827305 (diff) | |
download | art-aaebaa0121be3b9d9f13630585304482cbcaeb4b.zip art-aaebaa0121be3b9d9f13630585304482cbcaeb4b.tar.gz art-aaebaa0121be3b9d9f13630585304482cbcaeb4b.tar.bz2 |
art: Refactor RuntimeOptions/ParsedOptions
Refactor the RuntimeOptions to be a
type-safe map (VariantMap, see runtime_options.h) and the ParsedOptions
to delegate the parsing to CmdlineParser (see cmdline/cmdline_parser.h).
This is the start of a command line parsing refactor, and may include
more in the future (dex2oat, patchoat, etc).
For more details of the command line parsing generator usage see cmdline/README.md
Change-Id: Ic67c6bca5e1f33bf2ec60e2e3ff8c366bab91563
Diffstat (limited to 'runtime/java_vm_ext.cc')
-rw-r--r-- | runtime/java_vm_ext.cc | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/runtime/java_vm_ext.cc b/runtime/java_vm_ext.cc index 40417d8..ea7c192 100644 --- a/runtime/java_vm_ext.cc +++ b/runtime/java_vm_ext.cc @@ -32,6 +32,7 @@ #include "java_vm_ext.h" #include "parsed_options.h" #include "runtime-inl.h" +#include "runtime_options.h" #include "ScopedLocalRef.h" #include "scoped_thread_state_change.h" #include "thread-inl.h" @@ -357,14 +358,15 @@ const JNIInvokeInterface gJniInvokeInterface = { JII::AttachCurrentThreadAsDaemon }; -JavaVMExt::JavaVMExt(Runtime* runtime, ParsedOptions* options) +JavaVMExt::JavaVMExt(Runtime* runtime, const RuntimeArgumentMap& runtime_options) : runtime_(runtime), check_jni_abort_hook_(nullptr), check_jni_abort_hook_data_(nullptr), check_jni_(false), // Initialized properly in the constructor body below. - force_copy_(options->force_copy_), - tracing_enabled_(!options->jni_trace_.empty() || VLOG_IS_ON(third_party_jni)), - trace_(options->jni_trace_), + force_copy_(runtime_options.Exists(RuntimeArgumentMap::JniOptsForceCopy)), + tracing_enabled_(runtime_options.Exists(RuntimeArgumentMap::JniTrace) + || VLOG_IS_ON(third_party_jni)), + trace_(runtime_options.GetOrDefault(RuntimeArgumentMap::JniTrace)), globals_lock_("JNI global reference table lock"), globals_(gGlobalsInitial, gGlobalsMax, kGlobal), libraries_(new Libraries), @@ -374,9 +376,7 @@ JavaVMExt::JavaVMExt(Runtime* runtime, ParsedOptions* options) allow_new_weak_globals_(true), weak_globals_add_condition_("weak globals add condition", weak_globals_lock_) { functions = unchecked_functions_; - if (options->check_jni_) { - SetCheckJniEnabled(true); - } + SetCheckJniEnabled(runtime_options.Exists(RuntimeArgumentMap::CheckJni)); } JavaVMExt::~JavaVMExt() { |