Fix divide by zero in compiler stats

Also remove ext.jar from compilation since its part of the bootclasspath

Change-Id: I208746479d44664c8c868952d477a312fea6547a
diff --git a/src/compiler.cc b/src/compiler.cc
index 2f9b3ed..8a996b5 100644
--- a/src/compiler.cc
+++ b/src/compiler.cc
@@ -63,14 +63,25 @@
   if (dex_file_count_ > 0) {
     uint64_t duration_ns = NanoTime() - start_ns_;
     uint64_t duration_ms = NsToMs(duration_ns);
-    LOG(INFO) << "Compiled files:" << dex_file_count_
-              << " classes:" << class_count_
-              << " methods:(abstract:" << abstract_method_count_
-              << " native:" << native_method_count_
-              << " regular:" << regular_method_count_ << ")"
-              << " instructions:" << instruction_count_
-              << " (took " << duration_ms << "ms, "
-              << (duration_ns/instruction_count_) << " ns/instruction)";
+    std::string stats(StringPrintf("Compiled files:%d"
+                                   " classes:%d"
+                                   " methods:(abstract:%d"
+                                   " native:%d"
+                                   " regular:%d)"
+                                   " instructions:%d"
+                                   " (took %llums",
+                                   dex_file_count_,
+                                   class_count_,
+                                   abstract_method_count_,
+                                   native_method_count_,
+                                   regular_method_count_,
+                                   instruction_count_,
+                                   duration_ms));
+    if (instruction_count_ != 0) {
+        stats += StringPrintf(", %llu ns/instruction", duration_ns/instruction_count_);
+    }
+    stats += ")";
+    LOG(INFO) << stats;
   }
 }