diff options
author | buzbee <buzbee@google.com> | 2010-12-15 16:32:35 -0800 |
---|---|---|
committer | buzbee <buzbee@google.com> | 2010-12-17 12:13:59 -0800 |
commit | 2e152baec01433de9c63633ebc6f4adf1cea3a87 (patch) | |
tree | ab5329129870bdd66296d776374d9e4bed05e8e6 /vm/compiler/Frontend.c | |
parent | 08c2f9fc9cd7c1cb36c31d6f15b4d13a7cc15432 (diff) | |
download | android_dalvik-2e152baec01433de9c63633ebc6f4adf1cea3a87.tar.gz android_dalvik-2e152baec01433de9c63633ebc6f4adf1cea3a87.tar.bz2 android_dalvik-2e152baec01433de9c63633ebc6f4adf1cea3a87.zip |
[JIT] Trace profiling support
In preparation for method compilation, this CL causes all traces to
include two entry points: profiling and non-profiling. For now, the
profiling entry will only be used if dalvik is run with -Xjitprofile,
and largely works like it did before. The difference is that profiling
support no longer requires the "assert" build - it's always there now.
This will enable us to do a form of sampling profiling of
traces in order to identify hot methods or hot trace groups,
while keeping the overhead low by only switching profiling on periodically.
To turn the periodic profiling on and off, we simply unchain all existing
translations and set the appropriate global profile state. The underlying
translation lookup and chaining utilties will examine the profile state to
determine which entry point to use (i.e. - profiling or non-profiling) while
the traces naturally rechain during further execution.
Change-Id: I9ee33e69e33869b9fab3a57e88f9bc524175172b
Diffstat (limited to 'vm/compiler/Frontend.c')
-rw-r--r-- | vm/compiler/Frontend.c | 20 |
1 files changed, 2 insertions, 18 deletions
diff --git a/vm/compiler/Frontend.c b/vm/compiler/Frontend.c index 95ef026c0..915e5f3fe 100644 --- a/vm/compiler/Frontend.c +++ b/vm/compiler/Frontend.c @@ -458,9 +458,6 @@ bool dvmCompileTrace(JitTraceDescription *desc, int numMaxInsts, /* Initialize the printMe flag */ cUnit.printMe = gDvmJit.printMe; - /* Initialize the profile flag */ - cUnit.executionCount = gDvmJit.profile; - /* Setup the method */ cUnit.method = desc->method; @@ -634,6 +631,7 @@ bool dvmCompileTrace(JitTraceDescription *desc, int numMaxInsts, for (blockId = 0; blockId < blockList->numUsed; blockId++) { curBB = (BasicBlock *) dvmGrowableListGetElement(blockList, blockId); MIR *lastInsn = curBB->lastMIRInsn; + BasicBlock *backwardCell; /* Skip empty blocks */ if (lastInsn == NULL) { continue; @@ -708,25 +706,11 @@ bool dvmCompileTrace(JitTraceDescription *desc, int numMaxInsts, exitBB->needFallThroughBranch = true; loopBranch->taken = exitBB; -#if defined(WITH_SELF_VERIFICATION) - BasicBlock *backwardCell = + backwardCell = dvmCompilerNewBB(kChainingCellBackwardBranch, numBlocks++); dvmInsertGrowableList(blockList, (intptr_t) backwardCell); backwardCell->startOffset = entryCodeBB->startOffset; loopBranch->fallThrough = backwardCell; -#elif defined(WITH_JIT_TUNING) - if (gDvmJit.profile) { - BasicBlock *backwardCell = - dvmCompilerNewBB(kChainingCellBackwardBranch, numBlocks++); - dvmInsertGrowableList(blockList, (intptr_t) backwardCell); - backwardCell->startOffset = entryCodeBB->startOffset; - loopBranch->fallThrough = backwardCell; - } else { - loopBranch->fallThrough = entryCodeBB; - } -#else - loopBranch->fallThrough = entryCodeBB; -#endif /* Create the chaining cell as the fallthrough of the exit block */ exitChainingCell = dvmCompilerNewBB(kChainingCellNormal, |