Global lock levels.
Introduce the notion of the mutators/GC being a shared-exclusive (aka
reader-writer) lock. Introduce globally ordered locks, analysable by
annotalysis, statically at compile time. Add locking attributes to
methods.
More subtly, remove the heap_lock_ and split between various locks that
are held for smaller periods (where work doesn't get blocked). Remove
buggy Dalvik style thread transitions. Make GC use CMS in all cases when
concurrent is enabled. Fix bug where suspend counts rather than debug
suspend counts were sent to JDWP. Move the PathClassLoader to
WellKnownClasses. In debugger refactor calls to send request and
possibly suspend. Break apart different VmWait thread states. Move
identity hash code to a shared method.
Change-Id: Icdbfc3ce3fcccd14341860ac7305d8e97b51f5c6
diff --git a/src/stack.cc b/src/stack.cc
index dd319bc..9795a77 100644
--- a/src/stack.cc
+++ b/src/stack.cc
@@ -24,37 +24,6 @@
namespace art {
-class StackGetter {
- public:
- StackGetter(const ScopedJniThreadState& ts, Thread* thread)
- : ts_(ts), thread_(thread), trace_(NULL) {
- }
-
- static void Callback(void* arg) {
- reinterpret_cast<StackGetter*>(arg)->Callback();
- }
-
- jobject GetTrace() {
- return trace_;
- }
-
- private:
- void Callback() {
- trace_ = thread_->CreateInternalStackTrace(ts_);
- }
-
- const ScopedJniThreadState& ts_;
- Thread* const thread_;
- jobject trace_;
-};
-
-jobject GetThreadStack(const ScopedJniThreadState& ts, Thread* thread) {
- ThreadList* thread_list = Runtime::Current()->GetThreadList();
- StackGetter stack_getter(ts, thread);
- thread_list->RunWhileSuspended(thread, StackGetter::Callback, &stack_getter);
- return stack_getter.GetTrace();
-}
-
void ManagedStack::PushManagedStackFragment(ManagedStack* fragment) {
// Copy this top fragment into given fragment.
memcpy(fragment, this, sizeof(ManagedStack));
@@ -201,7 +170,7 @@
return visitor.frames;
}
-void StackVisitor::SanityCheckFrame() {
+void StackVisitor::SanityCheckFrame() const {
#ifndef NDEBUG
Method* method = GetMethod();
CHECK(method->GetClass() == Method::GetMethodClass() ||