OSDN Git Service

Interpreter/Debugger fix #4479968
authorbuzbee <buzbee@google.com>
Wed, 25 May 2011 21:21:14 +0000 (14:21 -0700)
committerbuzbee <buzbee@google.com>
Wed, 25 May 2011 21:21:14 +0000 (14:21 -0700)
commitcf4a20cf0cbc53f03a5b16c7152bbb29907f7108
tree6fbd3def6f4ba9cb914d9c0e28108a162bf51050
parent9522632b57b4df3249e4ee5fee3c1cfec8440e57
Interpreter/Debugger fix #4479968

This one was tricky to track down.  The underlying problem arose
with the consolidation of InterpState with Thread.  Rather than
having a state structure for each instance of the interpreter, we
moved to a model that had a single thread-local struct shared by all
interpreter instances running on that thread.  A portion of interpreter
state can't be shared - and thus was saved and restored on nested
invocations of the interpreter.

The bug here was that the storage for method return values was not
included in the state that needed save/retore.  In normal operation,
it doesn't need to be saved - that storage isn't live across an
invoke that could trigger a nested interpreter activation.  However,
when debugging, the debugger itself may hijack threads and create
new interpreter instances for its own purposed - and there is a small
window in which live retval can be trashed.

The fix is simply to move retval into the InterpSave struct.

Change-Id: Ib621824b799c5caa16fdfa8f5689a181159059df
19 files changed:
vm/Thread.h
vm/compiler/codegen/CodegenFactory.cpp
vm/compiler/codegen/arm/CodegenDriver.cpp
vm/compiler/codegen/arm/Thumb/Gen.cpp
vm/interp/Interp.cpp
vm/interp/InterpState.h
vm/interp/Jit.cpp
vm/mterp/common/asm-constants.h
vm/mterp/cstubs/stubdefs.cpp
vm/mterp/out/InterpC-allstubs.cpp
vm/mterp/out/InterpC-armv5te-vfp.cpp
vm/mterp/out/InterpC-armv5te.cpp
vm/mterp/out/InterpC-armv7-a-neon.cpp
vm/mterp/out/InterpC-armv7-a.cpp
vm/mterp/out/InterpC-portable.cpp
vm/mterp/out/InterpC-x86-atom.cpp
vm/mterp/out/InterpC-x86.cpp
vm/mterp/portable/enddefs.cpp
vm/mterp/portable/entry.cpp