aboutsummaryrefslogtreecommitdiff
path: root/vm/compiler/codegen/x86/CodegenDriver.c
Commit message (Collapse)AuthorAgeFilesLines
* Move the compiler into C++.Carl Shapiro2011-04-191-313/+0
| | | | Change-Id: Idffbdb02c29e2be03a75f5a0a664603f2299504a
* Interpreter restructuring: eliminate InterpStatebuzbee2011-02-191-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The key datastructure for the interpreter is InterpState. This change eliminates it, merging its data with the Thread structure. Here's why: In principio creavit Fadden Thread et InterpState. And it was good. Thread holds thread-private state, while InterpState captures data associated with a Dalvik interpreter activation. Because JNI calls can result in nested interpreter invocations, we can have more than one InterpState for each actual thread. InterpState was relatively small, and it all worked well. It was used enough that in the Arm version a register (rGLUE) was dedicated to it. Then, along came the JIT guys, who saw InterpState as a convenient place to dump all sorts of useful data that they wanted quick access to through that dedicated register. InterpState grew and grew. In terms of space, this wasn't a big problem - but it did mean that the initialization cost of each interpreter activation grew as well. For applications that do a lot of callbacks from native code into Dalvik, this is measurable. It's also mostly useless cost because much of the JIT-related InterpState initialization was setting up useful constants - things that don't need to be saved and restored all the time. The biggest problem, though, deals with thread control. When something interesting is happening that needs all threads to be stopped (such as GC and debugger attach), we have access to all of the Thread structures, but we don't have access to all of the InterpState structures (which may be buried/nested on the native stack). As a result, polling for thread suspension is done via a one-indirection pointer chase. InterpState itself can't hold the stop bits because we can't always find it, so instead it holds a pointer to the global or thread-specific stop control. Yuck. With this change, we eliminate InterpState and merge all needed data into Thread. Further, we replace the decidated rGLUE register with a pointer to the Thread structure (rSELF). The small subset of state data that needs to be saved and restored across nested interpreter activations is collected into a record that is saved to the interpreter frame, and restored on exit. Further, these small records are linked together to allow tracebacks to show nested activations. Old InterpState variables that simply contain useful constants are initialized once at thread creation time. This CL is large enough by itself that the new ability to streamline suspend checks is not done here - that will happen in a future CL. Here we just focus on consolidation. Change-Id: Ide6b2fb85716fea454ac113f5611263a96687356
* [JIT] Fix for 3385583: Performance varianceBill Buzbee2011-02-031-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | 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
* Stamp out some x86/host mode warningsbuzbee2010-12-141-2/+7
| | | | | | | Nuked a void* cast warnings and moved cacheflush into a target-specific utility wrapper. Change-Id: I36c841288b9ec7e03c0cb29b2e89db344f36fad1
* Experimental x86 Jit trace selectionbuzbee2010-12-131-0/+53
| | | | | | | | | | | | Experimental support for trace selection for x86 host mode operation. Not enabled by default. Turned on by setting WITH_HOST_DALVIK true and WITH_JIT true. When enabled, profiles during x86 fast interpreter operation, selects hot traces and "compiles" traces consisting of jumps back to the interpreter. First in a series of experimental x86 support checkins. Change-Id: I0e423ec58a7bf01f226cb486f55de2841fab1002
* Another clarifying rename and a bit more automation.Dan Bornstein2010-12-031-6/+6
| | | | | | | | kNumDalvikInstructions is now kNumPackedOpcodes, there is a new kMaxOpcodeValue, and both are generated by opcode-gen. Change-Id: Ic46f1f52d2d21382452c8e777024f4a985ad31d3 Bonus: Reworded the switch and array data comment for clarity.
* Say kNumDalvikInstructions when appropriate.Dan Bornstein2010-11-191-6/+6
| | | | | | | In particular, use it instead of just saying 256, and similarly for 255. The number of opcodes will be changing soon. Change-Id: Icc77120c2673968dddd6b4003f717245d46e4159
* Add source code skeletons for x86 work. No actual JIT'ng yet.buzbee2010-09-201-0/+250
Change-Id: Ic94a916e777e9bc5163cf205899daf9c18dcafe1