Commit Graph

2585 Commits

Author SHA1 Message Date
Joel Dice
d4c39e07a2 update readme.txt to reflect that 64-bit Windows does not use an underscore prefix for symbols 2011-02-01 08:48:30 -07:00
Joel Dice
a0a8c554d5 add a couple of test cases to NullPointer.java 2011-02-01 08:40:56 -07:00
Joel Dice
8ed2bb9dbb remove FrameEvent code from x86.cpp
That code was unused and will be unecessary until we add proper
support for unwinding through tail calls in nextFrame, at which point
it may be reinstated in some form.
2011-02-01 08:38:59 -07:00
Joel Dice
635f5ba7e6 avoid garbage collection from e.g. divideLong thunk
It is dangerous to initiate a GC from a thunk like divideLong (which
was possible when allocating a new ArithmeticException to signal
divide-by-zero) since we don't currently generate a GC root frame map
for the return address of the thunk call.  Instead, we use the backup
heap area if there is room, or else throw a pre-allocated exception
instead.
2011-01-31 21:18:55 -07:00
Joel Dice
2a5e556e09 Merge branch 'master' into r0.5 2011-01-31 15:54:46 -07:00
Joel Dice
9ed1ffff35 implement syncInstructionCache for ARM
Like, PowerPC, ARM has an instruction cache which must be manually
flushed if/when we compile a new method.  This commit updates
syncInstructionCache to use GCC's builtin __clear_cache routine.
2011-01-31 15:39:59 -07:00
Joel Dice
69af8a13aa add Thread.getStackTrace test 2011-01-31 09:55:58 -07:00
Joel Dice
69501a05b8 remove UNUSED modifier from parameter which is now used 2011-01-30 19:29:53 -07:00
Joel Dice
309c1cac6d fix PowerPC tails and continuations builds 2011-01-30 19:11:23 -07:00
Joel Dice
8a46ee92b4 use thunks for integer division on PowerPC
PowerPC doesn't generate traps for divides-by-zero, so we defer to
thunks which do explicit checks.
2011-01-30 14:28:02 -07:00
Joel Dice
fff51bad06 more progress on PowerPC build
Also, hide frame mapping for stack unwinding (which is still
incomplete) in x86.cpp, since no other platform needs it.
2011-01-30 14:14:57 -07:00
Joel Dice
1187613ad0 partial fix for PowerPC build 2011-01-29 20:04:29 -07:00
Joel Dice
8064b702c0 use parentheses around VA_LIST value in x86.h 2011-01-29 20:03:28 -07:00
Joel Dice
6296350d76 fix ARM tails=true and continuations=true builds 2011-01-29 18:09:47 -07:00
Joel Dice
03f18ea00c change reinterpret_casts to static_casts in x86.cpp where appropriate 2011-01-29 18:07:52 -07:00
Joel Dice
1186413be2 debug logging tweaks in compile.cpp 2011-01-29 11:11:27 -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
cac232a84e add comments to x86.cpp 2011-01-28 17:15:57 -07:00
Joel Dice
08a6025138 only enable frame pointer on x86(_64) 2011-01-28 17:05:42 -07:00
Joel Dice
35ae3dc391 fix mode=debug build 2011-01-28 08:43:11 -07:00
Joel Dice
740fa7ad9d fix unused parameter warnings 2011-01-27 21:10:06 -07:00
Joel Dice
f980ceb13e enable use-frame-pointer=true build
Also, include Continuations, Coroutines, and DynamicWind tests in test
suite for continuations=true build.
2011-01-27 21:06:01 -07:00
Joel Dice
b47dfdf5bd remove debug logging 2011-01-27 21:05:22 -07:00
Joel Dice
e4e0015005 fix GC safety issue in bootimage.cpp 2011-01-27 21:03:39 -07:00
Joel Dice
b7157c802a fix continuations=true build 2011-01-27 11:54:41 -07:00
Joel Dice
5cedcf7833 remove unnecessary exception checks from bootimage.cpp 2011-01-27 11:53:53 -07:00
Joel Dice
e16d5f83af Merge remote branch 'origin/master' into r0.5 2011-01-25 17:30:21 -07:00
Joel Dice
c1a0d8b6fc more work on frame-pointer-less unwinding
This fixes the tails=true build (at least for x86_64) and eliminates
the need for a frame table in the tails=false build.  In the
tails=true build, we still need a frame table on x86(_64) to help
determine whether we've caught a thread executing code to do a tail
call or pop arguments off the stack.  However, I've not yet written
the code to actually use this table, and it is only needed to handle
asynchronous unwinds via Thread.getStackTrace.
2011-01-25 17:22:43 -07:00
Joel Dice
966650f105 make StackOverflow test useful in tails=true build 2011-01-25 17:13:59 -07:00
Joel Dice
220f7760b7 fix MSVC build regressions 2011-01-21 16:14:21 -07:00
Joel Dice
0cc6156932 remove redundant code from DefineClass and Zip tests 2011-01-21 16:11:36 -07:00
Joel Dice
3aff7dc861 add TreeSet(Collection) constructor 2011-01-20 09:39:16 -07:00
Joel Dice
0ca7ed8c67 add Package.getName 2011-01-20 09:35:34 -07:00
Joel Dice
3a2a46499e add Reader.mark/markSupported/reset 2011-01-20 09:34:46 -07:00
Joel Dice
b57e734ceb implement Character.forDigit 2011-01-20 09:33:50 -07:00
Joel Dice
2dcc1d525a add note about slower floating point code for 32-bit x86 bootimage build 2011-01-20 08:50:53 -07:00
Joel Dice
51c56c1b3c add PrintStream.print[ln] overloads for primitives and char arrays 2011-01-20 08:26:56 -07:00
Joel Dice
9c36105b8f fix misleading pathnames in bootimage build instructions 2011-01-19 16:00:18 -07:00
Joel Dice
c02bfc57a5 resolve primitive array classes when generating boot image
This is necessary to accomodate classes loaded at runtime which refer
to primitive array types.  Otherwise, they won't be included unless
classes in the bootimage refer to them.
2011-01-18 08:35:52 -07:00
Joel Dice
475b286c7f preserve ClassLoader.loadClass from obfuscation/shrinking
This method is called by name in the VM.
2011-01-17 20:23:01 -07:00
Joel Dice
b4941cddbe close FileInputStream before deleting file in FileOutput test
Otherwise, Windows won't let us delete it.
2011-01-17 10:33:43 -07:00
Joel Dice
4a9ff55060 File.length should return 0 for non-existent files 2011-01-17 09:48:34 -07:00
Joel Dice
c855224d14 fix VM abort when ClassLoader.defineClass is used in bootimage build
When loading a class which extends another class that contained a
field of primitive array type using defineClass in a bootimage=true
build, the VM was unable to find the primitive array class, and
makeArrayClass refused to create one since it should already have
existed.

The problem was that the bootimage=true build uses an empty
Machine::BootstrapClassMap, and resolveArrayClass expected to find the
primitive array classes there.  The fix is to check the
Machine::BootLoader map if we can't find it in
Machine::BootstrapClassMap.
2011-01-17 09:36:03 -07:00
Joel Dice
3fe9171766 Merge remote branch 'origin/master' into r0.5 2011-01-16 19:40:01 -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
d5ba7412cd update DefineClass to exercise Class.newInstance
This is an attempt to reproduce an issue reported on the discussion
group.  However, the current form of the test is passing, so further
work will be necessary to trigger the bug.
2011-01-15 10:33:56 -07:00
Joel Dice
b6978c6c68 always create file if necessary in Java_java_io_FileOutputStream_open
Previously, we would only create the file if it did not already exist
*and* we weren't appending.  Now we do so whether appending or not.
2011-01-14 11:26:00 -07:00
Joel Dice
d12d33d716 fix memory leak in Java_java_io_File_length 2011-01-14 08:13:49 -07:00
Joel Dice
ff18524906 add DefineClass to test suite
As reported on the discussion group, there is a problem with the
ClassLoader.defineClass implementation sunch that this test is not
currently passing, at least for the mode=debug and bootimage=true
builds.  I plan to address these failures soon, but I wanted to add a
test first to make sure I could reproduce them.
2011-01-13 08:59:55 -07:00