OSDN Git Service

Support traceview-style profiling in all builds
authorbuzbee <buzbee@google.com>
Wed, 19 Jan 2011 23:31:15 +0000 (15:31 -0800)
committerbuzbee <buzbee@google.com>
Thu, 20 Jan 2011 00:39:41 +0000 (16:39 -0800)
commit18fba346582c08d81aa96d9508c0e935bad5f36f
treef69072fa267c06e5a3036c76fc37ba1df9c88f67
parent9238eb89ea5f0564047a2a2f040a2229d42f6f63
Support traceview-style profiling in all builds

This change builds on an earlier bccheng change that allowed JIT'd code
to avoid reverting to the debug portable interpeter when doing traceview-style
method profiling.  That CL introduced a new traceview build (libdvm_traceview)
because the performance delta was too great to enable the capability for
all builds.

In this CL, we remove the libdvm_traceview build and provide full-speed
method tracing in all builds.  This is done by introducing "_PROF"
versions of invoke and return templates used by the JIT.  Normally, these
templates are not used, and performace in unaffected.  However, when method
profiling is enabled, all existing translation are purged and new translations
are created using the _PROF templates.  These templates introduce a
smallish performance penalty above and beyond the actual tracing cost, but
again are only used when tracing has been enabled.

Strictly speaking, there is a slight burden that is placed on invokes and
returns in the non-tracing case - on the order of an additional 3 or 4
cycles per invoke/return.  Those operations are already heavyweight enough
that I was unable to measure the added cost in benchmarks.

Change-Id: Ic09baf4249f1e716e136a65458f4e06cea35fc18
40 files changed:
vm/Android.mk
vm/Globals.h
vm/Init.c
vm/Profile.c
vm/Profile.h
vm/compiler/Compiler.c
vm/compiler/Compiler.h
vm/compiler/Frontend.c
vm/compiler/InlineTransformation.c
vm/compiler/codegen/arm/Assemble.c
vm/compiler/codegen/arm/CodegenDriver.c
vm/compiler/template/armv5te-vfp/TemplateOpList.h
vm/compiler/template/armv5te/TEMPLATE_INVOKE_METHOD_CHAIN.S
vm/compiler/template/armv5te/TEMPLATE_INVOKE_METHOD_CHAIN_PROF.S [new file with mode: 0644]
vm/compiler/template/armv5te/TEMPLATE_INVOKE_METHOD_NATIVE.S
vm/compiler/template/armv5te/TEMPLATE_INVOKE_METHOD_NATIVE_PROF.S [new file with mode: 0644]
vm/compiler/template/armv5te/TEMPLATE_INVOKE_METHOD_NO_OPT.S
vm/compiler/template/armv5te/TEMPLATE_INVOKE_METHOD_NO_OPT_PROF.S [new file with mode: 0644]
vm/compiler/template/armv5te/TEMPLATE_INVOKE_METHOD_PREDICTED_CHAIN.S
vm/compiler/template/armv5te/TEMPLATE_INVOKE_METHOD_PREDICTED_CHAIN_PROF.S [new file with mode: 0644]
vm/compiler/template/armv5te/TEMPLATE_RETURN.S
vm/compiler/template/armv5te/TEMPLATE_RETURN_PROF.S [new file with mode: 0644]
vm/compiler/template/armv5te/TemplateOpList.h
vm/compiler/template/armv5te/footer.S
vm/compiler/template/armv7-a-neon/TemplateOpList.h
vm/compiler/template/armv7-a/TemplateOpList.h
vm/compiler/template/config-armv5te-vfp
vm/compiler/template/config-armv7-a
vm/compiler/template/config-armv7-a-neon
vm/compiler/template/out/CompilerTemplateAsm-armv5te-vfp.S
vm/compiler/template/out/CompilerTemplateAsm-armv5te.S
vm/compiler/template/out/CompilerTemplateAsm-armv7-a-neon.S
vm/compiler/template/out/CompilerTemplateAsm-armv7-a.S
vm/interp/InterpDefs.h
vm/mterp/Mterp.c
vm/mterp/armv5te/footer.S
vm/mterp/out/InterpAsm-armv5te-vfp.S
vm/mterp/out/InterpAsm-armv5te.S
vm/mterp/out/InterpAsm-armv7-a-neon.S
vm/mterp/out/InterpAsm-armv7-a.S