summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2012-01-12 14:49:18 -0800
committerElliott Hughes <enh@google.com>2012-01-12 14:49:18 -0800
commitb3e66dfcd069db8818cd902d787ff1d7bbca45f2 (patch)
treeb2fb80c539a6d7c51ae978376390a895f6f9ef7c
parent01646a0d8103e5e73ed53e4d36593a1cc3c26a03 (diff)
downloadart-b3e66dfcd069db8818cd902d787ff1d7bbca45f2.zip
art-b3e66dfcd069db8818cd902d787ff1d7bbca45f2.tar.gz
art-b3e66dfcd069db8818cd902d787ff1d7bbca45f2.tar.bz2
Minor fixes.
Fix a crash when shutting down if a daemon thread suspended while holding the heap lock. For some reason, presumably involving extra daemon threads, CTS hits this a lot. Silently ignore a couple of dalvikvm options for backwards compatibility. This makes CTS less noisy. Remove redundant parentheses that would make it easy for us to introduce a ==/= bug. Change-Id: Id44eab29ce393a85585459c280ad47c5a5c749b9
-rw-r--r--src/dalvik_system_DexFile.cc2
-rw-r--r--src/heap.cc5
-rw-r--r--src/runtime.cc2
3 files changed, 7 insertions, 2 deletions
diff --git a/src/dalvik_system_DexFile.cc b/src/dalvik_system_DexFile.cc
index de3e6d6..a14f124 100644
--- a/src/dalvik_system_DexFile.cc
+++ b/src/dalvik_system_DexFile.cc
@@ -144,7 +144,7 @@ static jint DexFile_openDexFile(JNIEnv* env, jclass, jstring javaSourceName, jst
static const DexFile* toDexFile(JNIEnv* env, int dex_file_address) {
const DexFile* dex_file = reinterpret_cast<const DexFile*>(static_cast<uintptr_t>(dex_file_address));
- if ((dex_file == NULL)) {
+ if (dex_file == NULL) {
jniThrowNullPointerException(env, "dex_file == null");
}
return dex_file;
diff --git a/src/heap.cc b/src/heap.cc
index fe5ca7a..1efc956 100644
--- a/src/heap.cc
+++ b/src/heap.cc
@@ -146,7 +146,10 @@ void Heap::Init(size_t initial_size, size_t maximum_size, size_t growth_size,
}
void Heap::Destroy() {
- ScopedHeapLock lock;
+ // We can't take the heap lock here because there might be a daemon thread suspended with the
+ // heap lock held. We know though that no non-daemon threads are executing, and we know that
+ // all daemon threads are suspended, and we also know that the threads list have been deleted, so
+ // those threads can't resume. We're the only running thread, and we can do whatever we like...
STLDeleteElements(&spaces_);
if (mark_bitmap_ != NULL) {
delete mark_bitmap_;
diff --git a/src/runtime.cc b/src/runtime.cc
index 4d95b4b..e9d5677 100644
--- a/src/runtime.cc
+++ b/src/runtime.cc
@@ -386,6 +386,8 @@ Runtime::ParsedOptions* Runtime::ParsedOptions::Create(const Options& options, b
parsed->hook_abort_ = reinterpret_cast<void(*)()>(options[i].second);
} else if (option == "host-prefix") {
parsed->host_prefix_ = reinterpret_cast<const char*>(options[i].second);
+ } else if (option == "-Xgenregmap" || option == "-Xgc:precise") {
+ // We silently ignore these for backwards compatibility.
} else {
if (!ignore_unrecognized) {
// TODO: print usage via vfprintf