OSDN Git Service

[JIT] Fix for 3385583: Performance variance
authorBill Buzbee <buzbee@google.com>
Thu, 3 Feb 2011 15:38:22 +0000 (07:38 -0800)
committerBill Buzbee <buzbee@google.com>
Thu, 3 Feb 2011 19:26:34 +0000 (11:26 -0800)
commit1b3da59fff0c63770e10684e243a36f3d0218637
tree491847a477ea60ee154f47b0a9d374bb477428b7
parent96915c3de9081d179599087c76ade237c929ceb9
[JIT] Fix for 3385583: Performance variance

Closes a window in which the "interpret-only" templace could get chained
to an existing trace while the intended translation was under construction.
Note that this CL also introduces some small, but fundamental changes in trace
formation:

1.  Previouosly, when an exception or other trace terminating event
occurred during trace formation, the entire trace was abandoned.  With this
change, we instead end the trace at the last successful instruction.

2.  We previously allowed multiple attempts (perhaps by multiple threads)
to form a trace compilation request for a dalvik PC.  This was done in an
attempt to allow recovery from compiler failures.  Now we enforce a new rule:
only the thread that wins the race to allocate an entry in the JitTable will
form the trace request.

3.  In a (probably misguided) attempt avoid unnecessary contention, we
previously allowed work order enqueue requests to be dropped if a requester
did not aquire TableLock on first attempt (assuming that if the trace were
hot, it would be requested again).  Now we block on enqueue.

Change-Id: I40ea4f1b012250219ca37d5c40c5f22cae2092f1
23 files changed:
vm/compiler/Compiler.c
vm/compiler/Compiler.h
vm/compiler/codegen/arm/Assemble.c
vm/compiler/codegen/arm/CodegenDriver.c
vm/compiler/codegen/x86/CodegenDriver.c
vm/interp/Jit.c
vm/interp/Jit.h
vm/mterp/c/OP_NEW_INSTANCE.c
vm/mterp/c/OP_NEW_INSTANCE_JUMBO.c
vm/mterp/c/gotoTargets.c
vm/mterp/c/opcommon.c
vm/mterp/cstubs/stubdefs.c
vm/mterp/out/InterpC-allstubs.c
vm/mterp/out/InterpC-armv5te-vfp.c
vm/mterp/out/InterpC-armv5te.c
vm/mterp/out/InterpC-armv7-a-neon.c
vm/mterp/out/InterpC-armv7-a.c
vm/mterp/out/InterpC-portdbg.c
vm/mterp/out/InterpC-portstd.c
vm/mterp/out/InterpC-x86-atom.c
vm/mterp/out/InterpC-x86.c
vm/mterp/portable/portdbg.c
vm/mterp/portable/portstd.c