Commit Graph

2715 Commits

Author SHA1 Message Date
Joel Dice
49d19456d0 fix infinite wait in Unsafe.park
There were a couple of problems with the Avian_sun_misc_Unsafe_park
implementation in classpath-openjdk.cpp.  First, the wait time should
be interpreted as milliseconds if absolute, but as nanoseconds
otherwise, whereas we were treating it as milliseconds in both cases.
Second, there was no mechanism to exit the while loop after the
specified time; the only way we could exit was via an unpark or
interrupt.
2012-01-14 20:27:40 -07:00
Joel Dice
929315e1f2 avoid crash when parsing certain abstract classes which declare no methods 2012-01-13 16:51:39 -07:00
Joel Dice
0aa5755187 call C library free directly instead of System::free where possible
There was a subtle race condition in the VM shutdown process such that
a System::Thread would be disposed after the System instance it was
created under has been disposed, in which case doing a virtual call to
System::free with that instance would potentially cause a crash.  The
solution is to just call the C library version of free directly, since
that's all System::free does.
2012-01-12 11:00:58 -07:00
Joel Dice
7022b23b26 add AbstractCollection.toString implementation 2012-01-12 10:45:05 -07:00
Joel Dice
9ba7c504da Merge remote branch 'origin/SWT3.7_UrlUpdates' into oss-master 2011-12-29 11:00:59 -07:00
Seth Goings
51ae790e54 Added UrlTest.java to tests dir 2011-12-29 10:36:33 -07:00
Ben Limmer
d76191d2bb Adding unit tests for File.isAbsolute() method. 2011-12-29 10:17:01 -07:00
Seth Goings
a0c12ad259 Added another floatToIntBits test 2011-12-29 09:51:44 -07:00
Seth Goings
f5a168f584 Fixed tests for floatToIntBits. Probably want to add more comprehensive tests tomorrow (or today... as of 2 minutes) 2011-12-28 23:58:33 -07:00
Ben Limmer
b3850ac76d Initial attempt at resolving SWT3.7 missing operatons in Avian. Everything seems to be working except floatToIntBits, hence the test case failing. 2011-12-28 15:52:53 -07:00
Joel Dice
1c85ea8a6e fix GCC 4.6 LTO build
On Ubuntu 11.10, the optimized build was breaking, apparently because
it was eliminating most of the symbols defined in assembly code
(e.g. vmJump) as unreachable when linking libjvm.so, which left
avian-dynamic unlinkable due to an unresolved symbol.

The solution in this commit is to export makeSystem and makeFinder
from libjvm.so rather than build redundant versions of finder.cpp and
posix.cpp/windows.cpp into avian-dynamic like we've been doing.  This
avoids the whole problem of vmJump reachability and reduces the size
of avian-dynamic at the same time.

This commit also turns off LTO for the avian-dynamic link since we get
odd undefined symbol errors about libc-defined symbols otherwise.
This may merit future investigation, but avian-dynamic is so small and
simple that there's no need to optimize it anyway.
2011-11-19 19:26:25 -07:00
Joel Dice
b29db7fece fix OpenJDK 7 build error
OpenJDK 7's javac doesn't seem to like that we're accessing
Enum.ordinal in compareTo when it's private.
2011-11-19 19:22:34 -07:00
Joel Dice
e4c1f923b5 fix GC safety bug in resolveObjectArrayClass
The call to getClassRuntimeData may trigger a GC, so we must mark the
local variables to be visited.
2011-11-18 08:38:19 -07:00
Joel Dice
3e5a7d9a41 reset immortal fixed objects when heap is disposed
This should ensure that the bootimage is ready to reuse by another
instance of the VM later on.
2011-11-11 17:37:40 -07:00
Joel Dice
7d185dd27d revert heap.cpp part of last commit
That change seems to be causing crashes under certain circumstances,
so I'm reverting it for now while I debug.
2011-11-10 15:27:34 -07:00
Joel Dice
4d0b127989 support multiple sequential VM instances with bootimage build
Until now, the bootimage build hasn't supported using the Java
invocation API to create a VM, destroy it, and create another in the
same process.  Ideally, we would be able to create multiple VMs
simultaneously without any interference between them.  In fact, Avian
is designed to support this for the most part, but there are a few
places we use global, mutable state which prevent this from working.
Most notably, the bootimage is modified in-place at runtime, so the
best we can do without extensive changes is to clean up the bootimage
when the VM is destroyed so it's ready for later instances.  Hence
this commit.

Ultimately, we can move towards a fully reentrant VM by making the
bootimage immutable, but this will require some care to avoid
performance regressions.  Another challenge is our Posix signal
handlers, which currently rely on a global handle to the VM, since you
can't, to my knowledge, pass a context pointer when registering a
signal handler.  Thread local variables won't necessarily help, since
a thread might attatch to more than one VM at a time.
2011-11-10 13:33:36 -07:00
Ben Limmer
21610c1c9b Merge branch 'master' of ssh://git.ecovate.com/avian 2011-11-09 13:26:51 -07:00
Ben Limmer
89cdd9d0d2 Fixed bug where calling Process.destroy() on a PID that no longer exist kills all processes in Pgroup. 2011-11-09 13:26:36 -07:00
Ben Limmer
f1b0d995a8 Fixed bug where calling Process.destroy() on a PID that no longer exist kills all processes in Pgroup. 2011-11-09 13:18:04 -07:00
Joel Dice
6e86ac39db fix native call marshalling on Apple/ARM
When the fourth argument is a 64-bit value on the Apple ARM ABI, it is
passed half by register and half on the stack, unlike on Linux where
it is passed entirely on the stack.  The logic to handle this in arm.h
was flawed, and this commit fixes it.
2011-11-07 17:14:41 -07:00
Joel Dice
a2c6cc8882 implement ConcurrentLinkedQueue.clear 2011-11-07 15:52:42 -07:00
Joel Dice
bcb62af2a1 fix java-lang.cpp iOS build 2011-11-04 09:37:24 -06:00
Joel Dice
21cc4c6a87 implement AbstractList.indexOf 2011-11-04 08:27:11 -06:00
Joel Dice
4026ad208c update makefile to point to iPhoneOS5.0.sdk 2011-11-04 08:25:26 -06:00
Joel Dice
6153a5c83b Merge remote-tracking branch 'git/master' 2011-11-04 08:11:14 -06:00
JET
2b2a2e9446 Completion of previous fix. 2011-11-03 19:30:44 -06:00
JET
216b9a05ea RandomAccessFile now correctly reports lengths for growing files. 2011-11-03 13:39:24 -06:00
Joshua Warner
90dc552463 implement Process.destroy 2011-11-03 12:30:51 -06:00
Joshua Warner
76f57fc931 Merge branch 'master' of ssh://git.ecovate.com/avian 2011-11-03 09:43:34 -06:00
JET
3b1c769d2b Fixed RandomAccessFile to update position after reads. 2011-10-24 09:01:17 -06:00
JET
39bee886e3 ByteBuffer and InputStream now better match the standard. 2011-10-20 13:45:47 -06:00
Joel Dice
8501ce8711 avoid using runtime-generated thunks for bootimage native methods 2011-10-03 08:05:49 -06:00
Joel Dice
5c39819cf0 fix uninitialized value warnings in bootimage.cpp 2011-10-03 08:05:25 -06:00
Joel Dice
248ff26581 fix thinko in machine.cpp 2011-10-03 08:04:58 -06:00
Joel Dice
db9f9a300d Revert "remove distinction between thunks and bootThunks in compile.cpp"
This reverts commit 88d614eb25.

It turns out we still need separate sets of thunks for AOT-compiled
and JIT-compiled code to ensure we can always generate efficient jumps
and calls to thunks on architectures such as ARM and PowerPC, whose
relative jumps and calls have limited ranges.
2011-10-01 18:11:02 -06:00
Joel Dice
043e466921 change bool field types to uint8_t in Fixie class
The bool type is 32 bits on Darwin/PowerPC, unlike other platforms.
To make bootimage creation consistent, we now use an explicit 8-bit
type.
2011-09-30 18:46:54 -06:00
Joel Dice
d89a96ae6d use absolute path for test-executable in makefile
This is necessary to avoid crashes on OS X due to
CFBundleGetMainBundle and friends not behaving well otherwise.
2011-09-30 18:46:54 -06:00
Joel Dice
ad22de6d73 fix uninitialized variable in bootimage.cpp 2011-09-30 18:46:53 -06:00
Joel Dice
ed6945dec7 fix offset calculations in arm.cpp and powerpc.cpp 2011-09-30 18:46:53 -06:00
Joel Dice
5f05110f33 fix type of TargetPointerMask 2011-09-30 17:00:45 -06:00
Joel Dice
df4626c260 fix Windows cross build 2011-09-30 15:21:12 -06:00
Joshua Warner
21c1ea53ae Merge branch 'master' of ssh://git.ecovate.com/avian 2011-09-30 14:56:01 -06:00
Joel Dice
b063f10ad5 fix Windows build 2011-09-30 14:44:25 -06:00
Joel Dice
88d614eb25 remove distinction between thunks and bootThunks in compile.cpp
Now that the AOT-compiled code image is position-independent, there is
no further need for this distinction.  In fact, it was harmful,
because we were still using runtime-generated thunks when we should
have been using the ones in the code image.  This resulted in
EXC_BAD_ACCESS errors on non-jailbroken iOS devices.
2011-09-30 13:17:28 -06:00
Joel Dice
b862f5f90a add bare-bones UUID implementation 2011-09-29 18:27:34 -06:00
Joel Dice
296cb74847 add bare-bones ConcurrentLinkedQueue implementation 2011-09-29 18:26:50 -06:00
Joel Dice
a8bb0d074b implement first() and last() in TreeSet 2011-09-29 18:25:41 -06:00
Joel Dice
84bcbbcaa3 implement asReadOnlyBuffer and getShort(int) in ByteBuffer 2011-09-29 18:25:03 -06:00
Joel Dice
61457dca70 add workaround for buffer overflow on iOS Simulator
It seems that the Apple iOS Simulator's stat implementation writes
beyond the end of the struct stat we pass it, which can clobber
unrelated parts of the stack.  Perhaps this is due to some kind of
header/library mismatch, but I've been unable to track it down so far.
The workaround is to give it 8 words more than it should need, where 8
is a number I just made up and seems to work.
2011-09-29 18:23:15 -06:00
Joel Dice
4e4d109787 fix regression in static field offset calculation
One of the changes in commit 5b4f179 broke this calculation.
2011-09-28 11:12:21 -06:00