Commit Graph

3330 Commits

Author SHA1 Message Date
2abc4e28a5 handle missing classpath or jar file name gracefully 2012-08-13 08:36:36 -06:00
fa5d76b43e fix 64-bit shifts on x86_32 2012-08-13 08:26:39 -06:00
a3a816c9a4 remove test of DataOutputStream from Integers.java
We haven't implemented that class yet, so the test only compiles with
the OpenJDK port.
2012-08-12 20:58:07 -06:00
69ffa28e1b fix shift instruction implementations on ARM
Unlike x86, ARM does not implicitly mask the shift value, so we must
do so explicitly.
2012-08-11 19:09:03 +00:00
2687333a37 Merge remote-tracking branch 'github/master' 2012-08-12 15:03:40 -06:00
20a290b992 use signbit instead of isinf to determine floating point sign
glibc's use of isinf's return value to indicate sign is a non-standard
extension which can't be relied upon on other platforms.
2012-08-12 14:52:48 -06:00
b98abe3f94 fix float to integer conversion
Java requires that NaNs be converted to zero and that numbers at or
beyond the limits of integer representation be clamped to the largest
or smallest value that can be represented, respectively.
2012-08-12 14:31:58 -06:00
47503854d5 Thread.sleep(0) should not sleep indefinitely
Our implementation uses Object.wait(long) to implement Thread.sleep,
which had the side effect of interpreting zero as infinity.  However,
for Thread.sleep, zero just means zero.  I assume that doesn't mean
"don't sleep at all", though, or else the app wouldn't have called
Thread.sleep in the first place, so this patch sleeps for one
millisecond when zero is passed -- just enough to yield the processor
for a bit.  Thread.yield might be a better choice in this case, but I
assume the app would have called that directly if that's what it
wanted.
2012-08-12 11:17:59 -06:00
f8e860999a fix incorrect reporting of fixie collection status in heap.cpp
This led to fixed-position objects being considered unreachable when
they were actually still reachable, causing global weak JNI references
to be cleared prematurely, most notably leading to crashes in AWT
buffered image code.

This commit also fixes a field offset calculation mismatch in
bootimage.cpp relative to machine.cpp.
2012-08-12 10:55:37 -06:00
b325221579 rename "resource" URL protocol to "avian_vm_resource"
This fixes a problem with JOSM, which attaches its own meaning to the
"resource" protocol.  The new name is less likely to cause such
conflicts.
2012-08-11 19:01:32 -06:00
e2ff771baa handle basic argument substitution in MessageFormat.format
Thanks to Remi for an initial version of this patch.
2012-08-11 08:58:40 -06:00
e2416ddb85 strip trailing separators when normalizing java.io.File.path
This addresses the case of e.g. new File("c:/foo/").exists() returning
false when the specified directory really does exist.
2012-08-11 08:21:14 -06:00
373a92d4d6 add Buffers test 2012-08-11 08:01:44 -06:00
242a6a0d0f fix field offset calculation mismatch between type-generator.cpp and machine.cpp 2012-08-11 06:58:07 -06:00
01be4b23bb implement JNI methods needed by AWT
These include PushLocalFrame, PopLocalFrame, NewDirectByteBuffer,
GetDirectBufferAddress, and GetDirectBufferCapacity.
2012-08-11 06:56:19 -06:00
2642a167e2 fix Class.getPackage for system classes in OpenJDK build 2012-08-11 06:46:24 -06:00
3af278b5e6 fix Clang warnings in windows.cpp 2012-08-07 17:18:04 -06:00
6aba7bef5a add java.lang.Deprecated 2012-08-06 16:55:49 -06:00
53b15d1bca look for initIDs in SunFontManager instead of FontManager
OpenJDK 7 has refactored this code relative to OpenJDK 6, and now
FontManager is an interface, with SunFontManager providing a (partial)
implementation.
2012-08-05 19:31:20 -06:00
5a7c78e71a ignore case when looking for Main-Class manifest attribute
Per the spec, attribute names should be case-insensitive:

http://docs.oracle.com/javase/6/docs/technotes/guides/jar/jar.html
2012-08-05 19:18:51 -06:00
021590af05 fix JNI test for openjdk-src build 2012-08-04 18:50:43 -06:00
96d5dae06c specify UTF-8 explicitly in Strings.testDecode
This fixes a test failure with the OpenJDK port.
2012-08-04 18:41:44 -06:00
c63668c1ce fix ArrayIndexOutOfBoundsException when decoding a UTF-8 stream 2012-08-04 16:11:27 -06:00
852d77d0b5 implement Arrays.toString(byte[]) 2012-08-04 16:08:32 -06:00
248ff91d74 terminate zero-length char array with null char in stringUTFChars 2012-08-04 12:36:18 -06:00
ebd7f69c41 fix a couple of QNX/ARM issues
On QNX, we need to use msync to sync the instruction cache.  Also,
even though the compiler doesn't define __SOFTFP__, QNX uses the
softfp ABI on ARM.
2012-08-03 20:02:33 -06:00
59d7f5a47a fix java.library.path on the ARM platform
On the ARM platform, Avian compiled to use OpenJDK gets this error on
startup:
java/lang/UnsatisfiedLinkError: no zip in java.library.path
  at java/lang/ClassLoader.loadLibrary (line 1860)
  at java/lang/Runtime.loadLibrary0 (line 845)
  at java/lang/System.loadLibrary (line 1084)
  at java/lang/System.initializeSystemClass (line 1145)

Using strace shows why:
[pid 22431]
stat64("/usr/lib/jvm/java-7-openjdk-armhf/jre/lib/i386/libzip.so",
0xbee377e0) = -1 ENOENT (No such file or directory)

The attached patch uses "arm" instead of "i386" in that path. This fixes the
problem.
2012-08-04 07:31:54 -06:00
5a09774353 tests don't compile when building with OpenJDK
I get this error when compiling with "make openjdk=...." on both x86_64 and
arm:

compiling test classes
test/Arrays.java:90: error: reference to equals is ambiguous, both method
equals(float[],float[]) in Arrays and method equals(Object[],Object[]) in
Arrays match
      expect(java.util.Arrays.equals(null, null));

test/Arrays.java:95: error: reference to hashCode is ambiguous, both method
hashCode(double[]) in Arrays and method hashCode(Object[]) in Arrays match
      java.util.Arrays.hashCode(null);

The attached patch fixes this.
2012-08-04 07:29:39 -06:00
2fb2fd9bb0 put test library in same directory as avian executable
This is a workaround for the fact that there's no precise equivalent
to LD_LIBRARY_PATH available on Windows.
2012-08-02 13:00:00 -06:00
296a1e5bab use so-prefix and so-suffix to generate test library name
This fixes the JNI test for Windows and OS X.
2012-08-02 12:47:48 -06:00
f03e5e8e55 clean up binary format code
Linux, FreeBSD, and QNX all use ELF, so no need to distinguish between
them when generating object files.  To avoid confusion, I've switch
from using operating system names to using binary format names where
applicable.
2012-08-02 12:39:24 -06:00
e641f23e6c fix "no newline at end of file" error on FreeBSD 2012-08-02 12:14:15 -06:00
3a1343fb06 add support for FreeBSD on x86_64 2012-08-02 10:49:32 -06:00
c1aa0b46b5 add support for FreeBSD 2012-08-02 10:41:41 -06:00
57e318bbec revert accidentally-committed build-cc/build-cxx change 2012-08-02 10:41:43 -06:00
fffde5f445 add Arrays test for equals and hashCode, handle corner cases with null 2012-07-24 11:31:47 -06:00
b034d11221 Ungenerify Arrays.{hashCode|equals}, make Arrays.equals consider nulls equal 2012-07-24 10:03:19 -06:00
e018851fd8 Merge branch 'master' of github.com:ReadyTalk/avian 2012-07-23 17:28:48 -06:00
62ff8440ed implement Arrays.equals and Arrays.hashCode 2012-07-23 07:28:05 -06:00
265ab63e19 fix crash when AOT compiling switch statement with only a default case
The existing code handled such odd switch statements correctly in the
JIT case, but did the wrong thing for the AOT case, leading to an
assertion failure later on.
2012-07-19 13:26:06 -06:00
56da23b964 fix unused variable warning for non-hardfloat ARM systems 2012-07-19 05:28:03 -06:00
7467ebde13 Revert "fix unused variable warning for non-hardfloat ARM systems"
This reverts commit 5270db52c7.
2012-07-19 05:27:15 -06:00
5270db52c7 fix unused variable warning for non-hardfloat ARM systems 2012-07-19 05:26:25 -06:00
4ffe2d58bf load arguments into the first 8 VFP registers, not the first 9 2012-08-01 19:59:34 +00:00
2be438b2bb fix bad offset for SSE argument marshalling in x86.S 2012-08-01 11:20:41 -06:00
2cb5a74991 fix mixed marshalling of mixed float/double argument lists on armhf
When we skip a single-precision register to ensure a double-precision
load is aligned, we need to remember that in case we see another
single-precision argument later on, which we must backfill into that
register we skipped according to the ABI.
2012-08-01 16:48:26 +00:00
67ec092e9a add JNI test to test suite 2012-08-01 16:04:12 +00:00
2ec1eee6f5 revert debug code accidentally included in last commit 2012-07-31 20:07:34 +00:00
b023f5a2aa fix allocate/free size mismatch in interpret.cpp
This was causing a crash every time the VM was run when build using
mode=debug and process=interpret.
2012-07-31 20:02:03 +00:00
a97c5728bb add support for the ARM hardware floating point ABI
This ABI's calling convention passes arguments and returns results
using VFP registers, so we need to tweak vmNativeCall to match it.

Thanks to Damjan Jovanovic for pointing this out and providing an
initial patch.
2012-07-31 16:36:59 +00:00