9f601a917c8878204482c37aec7005054b6776fa |
|
12-Feb-2011 |
buzbee <buzbee@google.com> |
Interpreter restructuring: eliminate InterpState 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
|
7365493ad8d360c1dcf9cd8b6eee62747af01cae |
|
09-Jun-2010 |
Carl Shapiro <cshapiro@google.com> |
Remove repeated newlines at the end of files. Change-Id: I1e3d103a7b932ef21acedb6438c0f26b315df28f
|
72e93344b4d1ffc71e9c832ec23de0657e5b04a5 |
|
13-Nov-2009 |
Jean-Baptiste Queru <jbq@google.com> |
eclair snapshot
|
b51ea11c70602918c42764bfafe92a997d3b1803 |
|
09-May-2009 |
Andy McFadden <fadden@android.com> |
Defer reporting of certain verifier failures. The verifier currently reports all failures immediately. Certain failures, such as the failure to resolve a method, or the determination that access to a field is not allowed, are supposed to deferred until the first time that executing code does something that could cause the resolution. With this change, several kinds of verification failures are deferred. This is done by making a writable copy of the bytecode and replacing the failing instruction with an "always throw" opcode. Gory details: - Added throw-verification-error instruction. Implemented in "portable" and ARM interpreters. x86 uses portable form through stub. - Added a function that creates a copy of a DexCode area and makes the bytecodes writable. - Added code that replaces a single instruction with an "always throw". - Replaced runtime check for abstract/interface in new-instance with a check at verification time. - Added a test to exercise the deferred error mechanism. - Minor cleanups (replaced tab, bad valgrind command, ...).
|
3a1aedbc9777eab6275a360b93b81b079464238e |
|
07-May-2009 |
Andy McFadden <fadden@android.com> |
Added throw-verification-error instruction. This is for the deferred verifier error reporting. It replaces OP_UNUSED_ED. The instructions aren't actually used yet, which is good since the x86 version hasn't been written yet. The mterp regen also pushed out some recent-ish changes that hadn't propagated to the armv4t sources.
|