Commit Graph

2190 Commits

Author SHA1 Message Date
937b7a7d34 Merge remote branch 'origin/arm' 2010-11-16 09:56:35 -07:00
64601e6f3e name VM-internal classes for heapdump=true builds
This makes heap dumps more useful since these classes are now refered
to by name instead of number.

This commit also adds a couple of utilities for parsing heap dumps:
PrintDump and DumpStats.
2010-11-16 09:31:49 -07:00
bc326fb5e9 fix ARM bootimage=true build 2010-11-16 02:38:36 +00:00
3fb834d008 fix pre-GCC-4.4 ARM build 2010-11-15 23:56:34 +00:00
8e23893af0 fix PowerPC builds on OS X 10.5+
The primary change is to ensure we output a Mach-O file of appropriate
endianness when cross-compiling for an opposite-endian architecture.
Earlier versions of XCode's linker accepted files of either
endianness, reguardless of architecture, but later versions don't,
hence the change.
2010-11-14 18:45:37 -07:00
6bf74bf380 optimize loads of constant values by using PC-relative addressing on ARM
Previously, loading an arbitrary 32-bit constant required up to four
instructions (128 bytes), since we did so one byte at a time via
immediate-mode operations.

The preferred way to load constants on ARM is via PC-relative
addressing, but this is challenging because immediate memory offsets
are limited to 4096 bytes in either direction.  We frequently need to
compile methods which are larger than 4096, or even 8192, bytes, so we
must intersperse code and data if we want to use PC-relative loads
everywhere.

This commit enables pervasive PC-relative loads by handling the
following cases:

 1. Method is shorter than 4096 bytes: append data table to end

 2. Method is longer than 4096 bytes, but no basic block is longer
 than 4096 bytes: insert data tables as necessary after blocks, taking
 care to minimize the total number of tables

 3. Method is longer than 4096 bytes, and some blocks are longer than
 4096 bytes: split large basic blocks and insert data tables as above
2010-11-13 19:42:29 -07:00
f21d2b68b8 fix another ARM immediate offset bug
Some memory operations can only handle 8-bit immediate values, so we
need to use a temporary register for those which don't fit.
2010-11-09 17:31:52 -07:00
6f555d4202 minor code cleanup in compile.cpp 2010-11-09 17:31:42 -07:00
f64d6c857b clean up OS resources immediately upon thread exit
Previously, we waited until the next GC to do this, but that can be
too long for workloads which create a lot of short-lived threads but
don't do much allocation.
2010-11-09 15:46:16 -07:00
44f55673d6 fix handle leaks in Windows Process implementation 2010-11-09 14:56:26 -07:00
2d60398e63 fix bug which caused Runtime.exec to block until process exits 2010-11-09 12:38:23 -07:00
7978102cb6 use register for indexing if constant offset is too large (or too small)
Immediate indexes on ARM must be no more than 12 bits, so we must use
a temporary register for values which don't fit.
2010-11-09 11:36:38 -07:00
70fcbc2788 freeze index site in BoundsCheckEvent::compile
This ensures we don't use it as a temporary register when generating
the comparison.
2010-11-09 11:34:56 -07:00
110f41b7a0 ARM makefile tweaks 2010-11-09 11:28:58 -07:00
ababc5748d fix regression in last commit
My last commit unintentionally changed the return type of Runtime.exec
to Runtime.MyProcess instead of Process.
2010-11-09 11:21:55 -07:00
3d18f88ad9 fix Runtime.exec bugs
The first bug affected POSIX systems: if the app never called
Process.waitFor, we'd never call waitpid on the child and thus leak a
zombie process.  This patch ensures that we always call waitpid by
spawning a thread to handle it.

The second bug affected Windows systems: we weren't closing the
child's ends of the stdin, stdout, and stderr pipes after process
creation, which lead to us blocking forever while reading from the
child's stdout or stderr.
2010-11-09 10:22:23 -07:00
51ba49def6 enable ARM cross builds 2010-11-08 20:48:08 -07:00
632e50efe6 fix non-continuations ARM build 2010-11-09 02:13:23 +00:00
0f0427f23b implement continuations support for ARM 2010-11-08 04:18:10 +00:00
36a8ba28e5 disable debug logging in compile.cpp 2010-11-08 04:15:31 +00:00
5d5dbd860b fix ARM tails=true build
This requires adding LinkRegister to the list of reserved registers,
since it must be preserved in the thunk code generated by
compileDirectInvoke.  An alternative would be to explicitly preserve
it in that special case, but that would complicate the code quite a
bit.
2010-11-08 00:41:44 +00:00
cfc09f8fdb Merge commit 'origin/master' into arm 2010-11-07 21:10:41 +00:00
5ade8d1cf6 use GetSystemTimeAsFileTime instead of _ftime on Windows
It seems that _ftime has devolved to only giving 1-second resolution
on Windows 7.  GetSystemTimeAsFileTime does better, so that's what
we'll use.
2010-10-28 20:30:49 -06:00
5cbfee467c fix Runtime.exec on Posix
Due to a silly cut-and-paste error, we were incorrectly passing the
stdout and stderr file descriptors back from native code to Java,
which prevented reading the output of the child process.
2010-10-22 14:39:38 -06:00
cf14a2c222 add exception for Object.clone() to vm.pro
Proguard gets confused about clone() and array classes (see
http://sourceforge.net/tracker/index.php?func=detail&aid=2851344&group_id=54750&atid=474704).
2010-10-15 23:06:03 +00:00
081d2d68ce handle and ignore SIGPIPE on Posix systems
We must handle this signal or we'll get the default behavior of
exiting the process whenever we get an unexpected network
disconnection.
2010-10-14 23:43:35 +00:00
b3accf1b30 ServerSocketChannel throws IOException, not Exception 2010-10-13 13:38:31 -06:00
ca251dfa17 print error message on failed dlopen if Verbose is true in posix.cpp 2010-10-13 13:37:09 -06:00
74a87a7f4f use _waccess on windows to implement File.can{Read|Write} 2010-09-12 14:46:14 -06:00
d5b35bea6e remove redundant import from FileOutput.java 2010-09-12 14:41:01 -06:00
345c7d38a9 Merge http://github.com/gzsombor/avian into gzsombor 2010-09-12 14:33:02 -06:00
522f8ca1a5 javadoc grammar correction in Continuations.java 2010-09-12 14:29:27 -06:00
6752505cb8 add File.canRead()/File.canWrite() implementation 2010-09-11 21:23:46 +02:00
7376425b24 dummy SecurityManager and related classes added 2010-09-11 21:23:46 +02:00
6985e81503 add Properties.load(Reader) implementation 2010-09-11 21:23:46 +02:00
5dadac2cb8 API additions for compatibility with harmony's java.util package 2010-09-11 21:23:46 +02:00
fc2c6d5100 implement toLowerCase(Locale) in the default case 2010-09-11 21:23:46 +02:00
250a77dc13 handle empty strings properly in Pattern.split
We were incorrectly returning an empty array when the input was empty,
whereas we ought to return an array containing a single empty string.
When the pattern to match was empty, we went into a loop to create an
infinite list of empty strings, only to crash once we've run out of
memory.  This commit addresses both problems.
2010-09-06 11:16:27 -06:00
a26eb1b2b9 Fix missing flush in PrintStream 2010-09-05 09:07:18 -06:00
d9e79db062 Merge branch 'master' into arm 2010-09-03 23:26:08 +01:00
jet
a1f5456451 All tests passing for ARM port in JIT mode. 2010-09-03 12:52:11 -06:00
dd0a696932 handle logical AND with a constant in a single instruction where possible 2010-09-03 18:32:22 +01:00
e7a48c0fa2 save return address in powerpc.cpp's MyAssembler::saveFrame
We've been getting away with not doing this so far since our Java
calling convention matches the native calling convention concerning
where the return address is saved, so when our thunk calls native code
it gets saved for us automatically.  However, there was still the
danger that a thread would interrupt another thread after the stack
pointer was saved to the thread field but before the native code was
called and try to get a stack trace, at which point it would try to
find the return address relative to that stack pointer and find
garbage instead.  This commit ensures that we save the return address
before saving the stack pointer to avoid such a situation.
2010-09-02 17:28:20 -06:00
bd01784249 save return address in arm.cpp's MyAssembler::saveFrame
This is necessary to allow safe stack unwinding (e.g. for exception
handling and garbage collection) from native code.
2010-09-03 00:18:19 +01:00
jet
a20d7e028b Longs.java test now progresses further before failure. 2010-09-02 16:09:01 -06:00
jet
b26dd4abf1 All but 6 tests are now passing in JIT mode on ARM. 2010-08-31 18:35:55 -06:00
a4914daae4 remove unused functions from powerpc.cpp 2010-08-30 16:55:48 -06:00
jet
b6a839950f Nine tests (including float and integer calculations) are now passing. 2010-08-30 16:13:10 -06:00
56b59cef5c use r6 instead of r0 in popFrameAndUpdateStackAndReturn
This avoids clobbering the return value.
2010-08-30 16:16:02 +01:00
jet
f740570ff6 Further debugging of ARM "Hello World!" JIT functionality. 2010-08-27 18:52:33 -06:00