Commit Graph

2283 Commits

Author SHA1 Message Date
Joel Dice
44f55673d6 fix handle leaks in Windows Process implementation 2010-11-09 14:56:26 -07:00
Joel Dice
2d60398e63 fix bug which caused Runtime.exec to block until process exits 2010-11-09 12:38:23 -07:00
Joel Dice
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
Joel Dice
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
Joel Dice
110f41b7a0 ARM makefile tweaks 2010-11-09 11:28:58 -07:00
Joel Dice
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
Joel Dice
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
Joel Dice
51ba49def6 enable ARM cross builds 2010-11-08 20:48:08 -07:00
Joel Dice
632e50efe6 fix non-continuations ARM build 2010-11-09 02:13:23 +00:00
Joel Dice
8ca5e9780e fix OS X build 2010-11-07 21:23:25 -07:00
Joel Dice
0f0427f23b implement continuations support for ARM 2010-11-08 04:18:10 +00:00
Joel Dice
36a8ba28e5 disable debug logging in compile.cpp 2010-11-08 04:15:31 +00:00
Joel Dice
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
Joel Dice
cfc09f8fdb Merge commit 'origin/master' into arm 2010-11-07 21:10:41 +00:00
Joel Dice
580e7e1b3f remove @Overload annotation since Java 1.5.0_19 chokes on it 2010-11-07 12:57:42 -07:00
Joel Dice
75de0a621b fix windows.cpp MySystem::now 2010-11-07 12:35:31 -07:00
Joel Dice
6cf3666ed9 fix timezone lookup for Windows openjdk-src build 2010-11-07 12:24:40 -07:00
Joel Dice
33b945c10b fix Windows openjdk (non-openjdk-src) build 2010-11-07 10:08:04 -07:00
Joel Dice
e1b808024a initial support for Windows OpenJDK build
All the tests are passing for openjdk-src builds, but the non-src
openjdk build is crashing and there's trouble loading time zone info
from the embedded java.home directory.
2010-11-06 22:21:19 -06:00
Joel Dice
df299f3564 fix build against latest JRE 1.6.0_22
This commit accomodates a new field in java.lang.Thread and implements
JVM_FindClassFromBootLoader.
2010-11-05 15:34:28 -06:00
Joel Dice
d0a6096eb0 add support for accessing embedded JARs as if they were directories
This allows OpenJDK to access time zone data which is normally found
under java.home, but which we must embed in the executable itself to
create a self-contained build.  The VM intercepts various file
operations, looking for paths which start with a prefix specified by
the avian.embed.prefix property and redirecting those operations to an
embedded JAR.

For example, if avian.embed.prefix is "/avian-embedded", and code
calls File.exists() with a path of
"/avian-embedded/javahomeJar/foo.txt", the VM looks for a function
named javahomeJar via dlsym, calls the function to find the memory
region containing the embeded JAR, and finally consults the JAR to see
if the file "foo.txt" exists.
2010-11-05 13:18:28 -06:00
Joel Dice
4cb796d2fb only return null from JVM_GetClassLoader when called from Unsafe.getUnsafe
sun.misc.Unsafe.getUnsafe expects a null result if the class loader is
the boot classloader and will throw a SecurityException otherwise
(whereas it should really be checking both for null and comparing
against the system classloader).  However, just returning null
whenever the loader is the boot loader can cause trouble for embedded
apps which put everything in the boot loader, including application
resources.

Therefore, we only return null if it's the boot loader and we're being
called from Unsafe.getUnsafe.
2010-11-04 11:43:50 -06:00
Joel Dice
cabad6926f enable standalone OpenJDK builds
As described in readme.txt, a standalone OpenJDK build embeds all
libraries, classes, and other files needed at runtime in the resulting
binary, eliminating dependencies on external resources.
2010-11-04 11:02:09 -06:00
Joel Dice
cb69ac23bd Merge remote branch 'origin/master' into openjdk
Conflicts:
	classpath/java/lang/String.java
	src/posix.cpp
2010-11-03 11:54:41 -06:00
Joel Dice
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
Joel Dice
21deedc500 update openjdk.pro 2010-10-24 14:50:33 -06:00
Joel Dice
cdcc9caeb2 initial work towards ProGuard-enabled OpenJDK builds 2010-10-24 11:52:14 -06:00
Joel Dice
25ca40931d keep track of original class in resolveField so we can throw an exception with a useful message 2010-10-24 11:49:59 -06:00
Joel Dice
6f839323a7 use user-specified boot classpath exclusively when present 2010-10-24 11:49:12 -06:00
Joel Dice
ec6080fea6 update readme.txt to point to new classpath.jar path 2010-10-24 11:45:41 -06:00
Joel Dice
9c603c6525 fix member offset calculation inconsistencies in type-generator.cpp 2010-10-23 20:41:45 -06:00
Joel Dice
6df0b2cfd9 look for 32-bit JRE libraries under lib/i386 2010-10-23 20:40:48 -06:00
Joel Dice
05ff032f69 pass -march=i586 to gcc when targetting 32-bit x86
Recent versions of GCC will only give us
__sync_bool_compare_and_swap_8 if we target i586 and above,
apparently.
2010-10-23 20:38:42 -06:00
Joel Dice
1ed03b9096 fix build breakage due to makefile syntax confusion
Consider the following makefile construct:

target: dep0
target: dep1 dep2
  command -o $(@) $(^)

With some versions of make, $(^) will expand to "dep1 dep2", but on
others it will expand to "dep0 dep1 dep2".  The commit ensures that we
no longer rely on the former behavior (nor the latter, for that matter).
2010-10-22 18:20:19 -06:00
Joel Dice
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
Joel Dice
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
Joel Dice
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
Joel Dice
b3accf1b30 ServerSocketChannel throws IOException, not Exception 2010-10-13 13:38:31 -06:00
Joel Dice
ca251dfa17 print error message on failed dlopen if Verbose is true in posix.cpp 2010-10-13 13:37:09 -06:00
Joel Dice
1f67aea456 fix process=interpret build 2010-09-27 17:12:08 -06:00
Joel Dice
c1c9d2111b remove GNU Classpath and Apache Harmony compatibility code
Rather than try to support mixing Avian's core classes with those of
an external class library -- which necessitates adding a lot of stub
methods which throw UnsupportedOperationExceptions, among other
comprimises -- we're looking to support such external class libraries
in their unmodified forms.  The latter strategy has already proven
successful with OpenJDK's class library.  Thus, this commit removes
the stub methods, etc., which not only cleans up the code but avoids
misleading application developers as to what classes and methods
Avian's built-in class library supports.
2010-09-27 15:58:02 -06:00
Joel Dice
8c789fb92c return empty object array from MyProcessor::getStackTrace on failure 2010-09-27 09:39:44 -06:00
Joel Dice
1d4b54a9f6 fix failure to add abstract virtuals to class with no declared virtuals 2010-09-25 16:35:18 -06:00
Joel Dice
268d2de175 cache array class lookups in element class; misc. bugfixes 2010-09-25 15:54:01 -06:00
Joel Dice
a2cc95d196 remove trailing whitespace in compile.cpp 2010-09-25 15:52:43 -06:00
Joel Dice
c939d16687 formatting tweak in Classes.java 2010-09-25 15:51:30 -06:00
Joel Dice
e75b57a127 don't abort when compiling an array lookup with a constant negative index
Instead, just compile it as a direct call to the thunk which throws an
ArrayIndexOutOfBoundsException.
2010-09-25 15:48:15 -06:00
Joel Dice
ebc54c234f fix signedness error for wide iinc implementation 2010-09-23 08:50:09 -06:00
Joel Dice
b023d147df fix JVM_Available for when fd is a fifo or socket 2010-09-23 08:49:36 -06:00
Joel Dice
89f6adc93c fix various classloading deadlocks and races 2010-09-22 13:58:46 -06:00