Commit Graph

17 Commits

Author SHA1 Message Date
Joshua Warner
fe1f069309 abort on startup if Thread field offset constants don't match the real runtime values 2012-06-20 13:16:08 -06:00
Joel Dice
886dd184aa fix incorrect stack unwinding for asynchronous stack traces
Our Thread.getStackTrace implementation is tricky because it might be
invoked on a thread executing arbitrary native or Java code, and there
are numerous edge cases to consider.  Unsurprisingly, there were a few
lingering, non-fatal bugs revealed by Valgrind recently, one involving
the brief interval just before and after returning from invokeNative,
and the other involving an off-by-one error in x86.cpp's nextFrame
implementation.  This commit fixes both.
2012-06-18 14:27:18 +00:00
Joel Dice
0addd8c814 update copyright years 2012-05-11 17:43:27 -06:00
Joel Dice
222b357089 specify 4-byte alignment of functions defined in ARM assembly code
Apple's assembler, at least, won't automatically align these properly
for us, so we need to explicitly specify the required alignment.
2012-01-19 16:42:35 -07:00
Joel Dice
e3662f13a9 update copyright years and increment version number 2011-07-13 08:25:21 -06:00
Joel Dice
cd3d1800c4 fix return of double values from Java to native code on ARM 2011-02-22 19:46:15 -07:00
Joel Dice
98e74f66e9 fix compile-arm.S's vmJumpAndInvoke 2011-02-20 20:30:56 +00:00
Joel Dice
6296350d76 fix ARM tails=true and continuations=true builds 2011-01-29 18:09:47 -07:00
Joel Dice
fb5c0bfebd fix ARM stack unwinding 2011-01-29 11:10:54 -07:00
Joel Dice
17449eaf1b progress towards fixing the ARM build 2011-01-28 17:16:08 -07:00
Joel Dice
43cbfd3f3a support stack unwinding without using a frame pointer
Previously, we unwound the stack by following the chain of frame
pointers for normal returns, stack trace creation, and exception
unwinding.  On x86, this required reserving EBP/RBP for frame pointer
duties, making it unavailable for general computation and requiring
that it be explicitly saved and restored on entry and exit,
respectively.

On PowerPC, we use an ABI that makes the stack pointer double as a
frame pointer, so it doesn't cost us anything.  We've been using the
same convention on ARM, but it doesn't match the native calling
convention, which makes it unusable when we want to call native code
from Java and pass arguments on the stack.

So far, the ARM calling convention mismatch hasn't been an issue
because we've never passed more arguments from Java to native code
than would fit in registers.  However, we must now pass an extra
argument (the thread pointer) to e.g. divideLong so it can throw an
exception on divide by zero, which means the last argument must be
passed on the stack.  This will clobber the linkage area we've been
using to hold the frame pointer, so we need to stop using it.

One solution would be to use the same convention on ARM as we do on
x86, but this would introduce the same overhead of making a register
unavailable for general use and extra code at method entry and exit.

Instead, this commit removes the need for a frame pointer.  Unwinding
involves consulting a map of instruction offsets to frame sizes which
is generated at compile time.  This is necessary because stack trace
creation can happen at any time due to Thread.getStackTrace being
called by another thread, and the frame size varies during the
execution of a method.

So far, only x86(_64) is working, and continuations and tail call
optimization are probably broken.  More to come.
2011-01-16 19:05:05 -07:00
Joel Dice
6c53068f4f clear Thread::stack before vmInvoke_safeStack in compile-arm.S 2010-12-15 10:41:18 -07:00
Joel Dice
632e50efe6 fix non-continuations ARM build 2010-11-09 02:13:23 +00:00
Joel Dice
0f0427f23b implement continuations support for ARM 2010-11-08 04:18:10 +00:00
jet
f740570ff6 Further debugging of ARM "Hello World!" JIT functionality. 2010-08-27 18:52:33 -06:00
jet
5c00cfac6f Incomplete debugging of "Hello World!" on ARM. 2010-08-24 17:59:01 -06:00
jet
d9aac52b3d First version; interpreted mode works and JIT mode compiles. 2010-07-12 14:18:36 -06:00