Add the signal catcher (for SIGQUIT and SIGUSR1).
Also fix some of the thread implementation.
Change-Id: If2d1b59a149ba1ac192ad9bc74319c8dff228549
diff --git a/src/runtime.cc b/src/runtime.cc
index 80914db..2443cc6 100644
--- a/src/runtime.cc
+++ b/src/runtime.cc
@@ -12,6 +12,7 @@
#include "heap.h"
#include "jni_internal.h"
#include "scoped_ptr.h"
+#include "signal_catcher.h"
#include "thread.h"
namespace art {
@@ -22,6 +23,7 @@
// TODO: use smart pointers instead. (we'll need the pimpl idiom.)
delete class_linker_;
Heap::Destroy();
+ delete signal_catcher_;
delete thread_list_;
delete java_vm_;
Thread::Shutdown();
@@ -321,6 +323,8 @@
LoadJniLibrary(instance_->GetJavaVM(), "javacore");
self->SetState(old_state);
+ instance_->signal_catcher_ = new SignalCatcher;
+
return instance_;
}
@@ -360,6 +364,18 @@
return true;
}
+void Runtime::DumpStatistics(std::ostream& os) {
+ // TODO: dump other runtime statistics?
+ os << "Loaded classes: " << class_linker_->NumLoadedClasses() << "\n";
+ os << "Intern table size: " << class_linker_->GetInternTable().Size() << "\n";
+ // LOGV("VM stats: meth=%d ifld=%d sfld=%d linear=%d",
+ // gDvm.numDeclaredMethods,
+ // gDvm.numDeclaredInstFields,
+ // gDvm.numDeclaredStaticFields,
+ // gDvm.pBootLoaderAlloc->curOffset);
+ // LOGI("GC precise methods: %d", dvmPointerSetGetCount(gDvm.preciseMethods));
+}
+
void Runtime::BlockSignals() {
sigset_t sigset;
if (sigemptyset(&sigset) == -1) {