Merge "Improve heap lock annotations." into dalvik-dev
diff --git a/src/compiler.cc b/src/compiler.cc
index 97a35f0..7bec994 100644
--- a/src/compiler.cc
+++ b/src/compiler.cc
@@ -837,7 +837,9 @@
   if (has_clinit_trampoline) {
     return;
   }
-  stats_->DirectCallsToBoot(type);
+  if (sharp_type != kInterface) {  // Interfaces always go via a trampoline.
+    stats_->DirectCallsToBoot(type);
+  }
   stats_->DirectMethodsToBoot(type);
   bool compiling_boot = Runtime::Current()->GetHeap()->GetSpaces().size() == 1;
   if (compiling_boot) {
diff --git a/src/oatdump.cc b/src/oatdump.cc
index 88dbaae..b40eb1c 100644
--- a/src/oatdump.cc
+++ b/src/oatdump.cc
@@ -500,11 +500,11 @@
       for (size_t i = start; i < end; i += 2) {
         if (offset == raw_table[i]) {
           if (suspend_point_mapping) {
-            os << "\t\t\tsuspend point dex PC: ";
+            os << "\t\t\tsuspend point dex PC: 0x";
           } else {
-            os << "\t\t\tcatch entry dex PC: ";
+            os << "\t\t\tcatch entry dex PC: 0x";
           }
-          os << raw_table[i + 1] << "\n";
+          os << std::hex << raw_table[i + 1] << "\n";
           return;
         }
       }
@@ -546,7 +546,7 @@
       size_t i = 0;
       while (i < code_item->insns_size_in_code_units_) {
         const Instruction* instruction = Instruction::At(&code_item->insns_[i]);
-        os << StringPrintf("\t\t\t0x%04x: %s\n", i, instruction->DumpString(&dex_file).c_str());
+        os << StringPrintf("\t\t\t0x%04zx: %s\n", i, instruction->DumpString(&dex_file).c_str());
         i += instruction->SizeInCodeUnits();
       }
     }
diff --git a/src/runtime.cc b/src/runtime.cc
index dc37ff2..62447df 100644
--- a/src/runtime.cc
+++ b/src/runtime.cc
@@ -175,12 +175,23 @@
       //       which may block indefinitely if there's a misbehaving thread holding it exclusively.
       //       The code below should be made robust to this.
       ScopedObjectAccess soa(self);
+      os << "Aborting thread:\n";
       self->Dump(os);
       if (self->IsExceptionPending()) {
         os << "Pending " << PrettyTypeOf(self->GetException()) << " on thread:\n"
            << self->GetException()->Dump();
       }
     }
+    DumpAllThreads(os, self);
+  }
+
+  void DumpAllThreads(std::ostream& os, Thread* self) NO_THREAD_SAFETY_ANALYSIS {
+    bool tll_already_held = Locks::thread_list_lock_->IsExclusiveHeld(self);
+    bool ml_already_held = Locks::mutator_lock_->IsSharedHeld(self);
+    if (tll_already_held && ml_already_held) {
+      os << "All threads:\n";
+      Runtime::Current()->GetThreadList()->DumpLocked(os);
+    }
   }
 };