Fix a thread suspend timeout, and improve the diagnostics for thread suspend timeouts.
I still needed gdb to understand this, but when we dump _native_ stacks, the
additional diagnostics here will be more helpful. (They're somewhat helpful
anyway, in that they let you see the state all threads are in. Also, in a
started runtime rather than the compiler, threads will have informative managed
stacks.)
Also make the apparent duplication in the dex2oat timings clearer, and only
include time spent on resolving strings if we resolved any strings.
Change-Id: Icd469d9b085171ebb2dede2afb5140387cd3240c
diff --git a/src/compiler.cc b/src/compiler.cc
index 41d2f6a..4cc228c 100644
--- a/src/compiler.cc
+++ b/src/compiler.cc
@@ -306,6 +306,8 @@
}
~Workers() {
+ // Switch to kVmWait while we're blocked waiting for the other threads to finish.
+ ScopedThreadStateChange tsc(Thread::Current(), Thread::kVmWait);
STLDeleteElements(&threads_);
}
@@ -402,8 +404,8 @@
for (size_t string_idx = 0; string_idx < dex_cache->NumStrings(); string_idx++) {
class_linker->ResolveString(dex_file, string_idx, dex_cache);
}
+ timings.AddSplit("Resolve " + dex_file.GetLocation() + " Strings");
}
- timings.AddSplit("Resolve.Strings");
Context context;
context.class_linker = class_linker;
@@ -414,12 +416,12 @@
{
Workers workers(&context, 0, dex_cache->NumResolvedTypes(), ResolveType);
}
- timings.AddSplit("Resolve.Types");
+ timings.AddSplit("Resolve " + dex_file.GetLocation() + " Types");
{
Workers workers(&context, 0, dex_file.NumClassDefs(), ResolveClassFieldsAndMethods);
}
- timings.AddSplit("Resolve.MethodsAndFields");
+ timings.AddSplit("Resolve " + dex_file.GetLocation() + " MethodsAndFields");
}
void Compiler::Verify(const ClassLoader* class_loader,