Commit Graph

2461 Commits

Author SHA1 Message Date
Seth Goings
c75b06ddc1 Added support for non POSIX line endings. Will now accept: \r and \r\n as line endings (per Sun's JavaDoc) 2011-08-31 20:46:15 -06:00
Matt Klich
5542ad4ed4 Merge branch 'B14038_Lion_appshare' 2011-06-02 16:40:23 -06:00
Matt Klich
698138f649 OSX Lion build changes
Added JavaVM to include path. Also allow dynamically building with
different SDK versions through the OSX_SDK_VERSION and OSX_SDK_SYSROOT
environment variables (these default to the previosly hardcoded value of
10.4 and 10.4u respectively).
2011-06-02 15:15:08 -06:00
Matt Klich
c7c0a45a61 Revert "OSX Lion build changes"
This commit introduced conditional includes which is not the preferred
method. Will do it in the makefile instead.

This reverts commit 7148556979.
2011-06-01 13:56:03 -06:00
Joel Dice
4514833700 Changes to add end function to Inflater and Deflater per the java spec 2011-05-31 14:46:15 -06:00
Matt Klich
7148556979 OSX Lion build changes 2011-05-26 11:57:30 -06:00
Mike Keesey
8e736327d4 Updated powerpc build to disable stack overflow checks for now due to a problem we found with large enums. 2011-04-22 20:22:47 -06:00
Joel Dice
d3581be38e don't abort when parsing malformed UTF8 strings
Previously, we would abort the process if we encountered a truncated
multibyte character in parseUtf8NonAscii (called by the JNI method
NewStringUTF).  Now we simply terminate the string at that point.
2011-04-07 14:39:27 -06:00
Matt Klich
723dfcdf8e Merge commit 'rt-6.2.12' 2011-03-14 10:40:09 -06:00
Joel Dice
7a91074a32 fix OS X cross-arch build regression 2011-03-01 12:20:49 -07:00
Joel Dice
6d3975adb7 fix OS X PowerPC continuations=true build regression 2011-03-01 12:06:35 -07:00
Joel Dice
bb4be4de7e fix Linux/PowerPC continuations=true build 2011-03-01 11:24:44 -07:00
Joel Dice
30feba8b56 fix PowerPC tails=true stack undwinding 2011-03-01 11:01:13 -07:00
Joel Dice
8f519531d4 UseFramePointer should always be true on PowerPC
The Apple and SYSV ABIs specify that the stack/frame pointer is always
saved at the tip of the stack.
2011-03-01 10:59:00 -07:00
Joel Dice
a0962d7ab2 look for __powerpc__ as well as __POWERPC__ in jni-util.h
The former is used on GNU/Linux.
2011-02-28 16:50:17 -07:00
Joel Dice
7ad59731c0 reserve register 2 for system use on Linux/PowerPC
The SYSV ABI specifies that it be reserved.  In practice, it is used
for thread-local storage.
2011-02-28 16:48:58 -07:00
Joel Dice
25f1a9f1e8 fix Thread::exit/Thread::dispose race condition
There was a race between these two functions such that one thread A
would run dispose on thread B just before thread B finishes exit, with
the result that Thread::lock and/or Thread::systemThread would be
disposed twice, resulting in a crash.
2011-02-28 10:14:01 -07:00
Joel Dice
255fc9f9d3 handle long conditional immediate branches properly on PowerPC
Due to encoding limitations, the immediate operand of conditional
branches can be no more than 32KB forward or backward.  Since the
JIT-compiled form of some methods can be larger than 32KB, and we also
do conditional jumps to code outside the current method in some cases,
we must work around this limitation.

The strategy of this commit is to provide inline, intermediate jump
tables where necessary.  A given conditional branch whose target is
too far for a direct jump will instead point to an unconditional
branch in the nearest jump table which points to the actual target.

Unconditional immediate branches are also limited on PowerPC, but this
limit is 32MB, which is not an impediment in practice.  If it does
become a problem, we'll need to encode such branches using multiple
instructions.
2011-02-27 23:03:13 -07:00
Joel Dice
5f50226ae0 enable Linux/PowerPC cross build 2011-02-27 22:54:59 -07:00
Joel Dice
039916b519 fix incorrect offset in compile-powerpc.S 2011-02-26 17:08:08 -07:00
Joel Dice
9e1ee7e974 enable Linux PowerPC build 2011-02-26 12:45:22 -07:00
Joel Dice
944e223335 use wait/notifyAll too avoid starvation in Trace test
Thread.yield is not enough to ensure that the tracing thread does not
starve the test thread on some QEMU VMs, so we use wait/notifyAll to
make sure both threads have opportunities to run and the test actually
finishes.
2011-02-26 12:40:54 -07:00
Joel Dice
a4c4d54cdd restore MyThread::ip in MyThread::CallTrace destructor
This is necessary to ensure we can unwind the stack properly on ARM
after returning from a recursive invocation of vmInvoke.
2011-02-25 11:04:23 -07:00
Joel Dice
42fd021acf various fixes for running Tomcat on the OpenJDK build 2011-02-25 08:17:15 -07:00
Joel Dice
f1255c8fd8 use pthread_sigmask instead of sigprocmask to unblock signals
Apparently, the behavior of the latter is undefined in multithreaded
processes.
2011-02-25 08:13:25 -07: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
6025ba736e fix return of double values from Java to native code on PowerPC 2011-02-22 19:16:54 -07:00
Joel Dice
8b9cdc13ba fix return of double values from Java to native code on x86_32 2011-02-22 19:13:38 -07:00
Joel Dice
783c6092af remove dead break statement from translateInvokeResult 2011-02-22 19:12:41 -07:00
Joel Dice
45674efcea implement JVM_SetSockOpt and Unsafe.getLongVolatile 2011-02-22 18:37:42 -07:00
Joel Dice
bead78d982 wrap primitive return values using correct types in Method.invoke
The VM uses Integer and Long instances internally to wrap the results
of dynamic method invocations, but Method.invoke should use the
correct, specific type for the primitive (e.g. Character for char).
2011-02-22 17:54:56 -07:00
Joel Dice
422263f499 fix Mac OS PowerPC cross build
While we can use Linux's jni.h to cross compile the i386 Mac OS build,
that doesn't work for the PowerPC one.  Now we use the proper
/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Headers/jni.h
from the sysroot instead.
2011-02-22 16:04:29 -07:00
Joel Dice
6014cb93b1 fix Mac OS PowerPC cross build
While we can use Linux's jni.h to cross compile the i386 Mac OS build,
that doesn't work for the PowerPC one.  Now we use the proper
/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Headers/jni.h
from the sysroot instead.
2011-02-22 15:45:46 -07:00
Joel Dice
d520514a87 add support for Class-Path manifest attribute
This attribute, found in some JAR manifests, indicates additional JARs
and/or directories to append to the classpath.  Tomcat in particular
uses it.
2011-02-21 16:05:28 -07:00
Joel Dice
addaf09aa3 use run function to call boot in JNI_CreateJavaVM
boot may throw an exception, which we can't allow to propagate beyond
the JNI_CreateJavaVM call.
2011-02-21 16:00:20 -07:00
Joel Dice
e20daca297 use link register to determine return address when appropriate in getStackTrace
On PowerPC and ARM, we can't rely on the return address having already
been saved on the stack on entry to a thunk, so we must look for it in
the link register instead.
2011-02-21 15:25:52 -07:00
Joel Dice
20f4510122 fix ARM stack unwinding (part 2)
My previous attempt at this was incomplete; it did not address
Java->native->Java->native call sequences, nor did it address
continuations.  This commit takes care of both.
2011-02-20 13:49:40 -07:00
Joel Dice
98e74f66e9 fix compile-arm.S's vmJumpAndInvoke 2011-02-20 20:30:56 +00:00
Joel Dice
ab3929d411 fix PowerPC and ARM bootimage builds
This requires reducing HeapCapacity and CodeCapacity back to 128MB and
30MB respectively.  I had set them to larger values to test
non-ProGuard'ed OpenJDK bootimage builds, which naturally needed a lot
more space.  However, such builds aren't really useful in the real
world, and the compiler currently can't handle jumps or calls spanning
more than the maximum size of an immediate branch offset on ARM or
PowerPC, so I'm lowering them back down to more realistic values.
2011-02-20 05:59:36 +00:00
Joel Dice
45a2469672 abort if allocation fails in heap.cpp's allocate 2011-02-20 05:59:13 +00:00
Joel Dice
8a88c6ee3c fix ARM stack unwinding
We can't rely on the C++ compiler to save the return address in a
known location on entry to each function we might call from Java
(although GCC 4.5 seems to do so consistently, which is why I hadn't
realized the unwinding code was relying on that assumption), so we
must store it explicitly in MyThread::ip in each thunk.  For PowerPC
and x86, we continue saving it on the stack as always, since the
calling convention guarantees its location relative to the stack
pointer.
2011-02-19 20:52:14 -07:00
Joel Dice
b2268143f5 preserve statck alignment in arm.S's vmRun 2011-02-20 02:48:56 +00:00
Joel Dice
5524b9a5a3 fix OS X 10.4 build
pthread_mach_thread_np is not declared in pthread.h on OS X unless
_XOPEN_SOURCE and _POSIX_C_SOURCE are undefined.
2011-02-19 14:36:48 -07:00
Joel Dice
00307b9b30 fix Mac OS MySystem::visit and MySystem::Thread::interrupt implementations
On Mac OS, signals sent using pthread_kill are never delivered if the
target thread is blocked (e.g. acquiring a lock or waiting on a
condition), so we can't rely on it and must use the Mach-specific
thread execution API instead to implement Thread.getStackTrace.

For Thread.interrupt, we must not only use pthread_kill but also
pthread_cond_signal to ensure the thread is woken up.
2011-02-19 14:20:02 -07:00
Joel Dice
2ce549d3f8 fix GC safety bug in jvmGetClassInterfaces 2011-02-19 14:07:45 -07:00
Joel Dice
19c443254d Merge remote branch 'oss/r0.5' into dev 2011-02-17 17:41:21 -07:00
Joel Dice
1ca8a20731 enable i686-apple-darwin8 cross compile 2011-02-17 17:39:41 -07:00
Joel Dice
c761ac6717 fix Subroutine test for use with OpenJDK build 2011-02-17 14:28:51 -07:00
Joel Dice
2216b22ccb add lib/currency.data to javahome-files on Windows
This file is needed by OpenJDK for both Windows and Posix systems.
2011-02-17 14:11:37 -07:00
Joel Dice
59183c7821 fix subroutine stack mapping bug leading to crashes during GC
The stack mapping code was broken for cases of stack slots being
reused to hold primitives or addresses within subroutines after
previously being used to hold object references.  We now bitwise "and"
the stack map upon return from the subroutine with the map as it
existed prior to calling the subroutine, which has the effect of
clearing map locations previously marked as GC roots where
appropriate.
2011-02-16 14:29:57 -07:00