Print callee information in the JIT profile outout
For example:
TRACEPROFILE 0x48bbb2d4 11057 0.55% [0x45d(+1), 14011] ...
-> Ljava/util/HashMap$HashIterator;hasNext;()Z
It means the trace ends with a call to hasNext(), and inlining
probably won't help the overall performance more than 0.55%.
Change-Id: I9bf2a79c48d6cb569a9fe2e329022edf968664bb
diff --git a/vm/compiler/codegen/arm/Assemble.c b/vm/compiler/codegen/arm/Assemble.c
index 58150d8..226a942 100644
--- a/vm/compiler/codegen/arm/Assemble.c
+++ b/vm/compiler/codegen/arm/Assemble.c
@@ -1847,6 +1847,7 @@
u2* pCellOffset;
JitTraceDescription *desc;
const Method* method;
+ int idx;
traceBase = getTraceBase(p);
@@ -1900,6 +1901,24 @@
method->clazz->descriptor, method->name, methodDesc);
free(methodDesc);
+ /* Find the last fragment (ie runEnd is set) */
+ for (idx = 0;
+ desc->trace[idx].frag.isCode && !desc->trace[idx].frag.runEnd;
+ idx++) {
+ }
+
+ /*
+ * runEnd must comes with a JitCodeDesc frag. If isCode is false it must
+ * be a meta info field (only used by callsite info for now).
+ */
+ if (!desc->trace[idx].frag.isCode) {
+ const Method *method = desc->trace[idx+1].meta;
+ char *methodDesc = dexProtoCopyMethodDescriptor(&method->prototype);
+ /* Print the callee info in the trace */
+ LOGD(" -> %s%s;%s", method->clazz->descriptor, method->name,
+ methodDesc);
+ }
+
return executionCount;
}