Commit Graph

2181 Commits

Author SHA1 Message Date
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
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
Joel Dice
efd3ccb04f set java.home to path of JRE, not JDK 2010-09-20 18:38:38 -06:00
Joel Dice
17f495eb27 rework OpenJDK build to derive classpath and library path from environment
We now consult the JAVA_HOME environment variable to determine where
to find the system library JARs and SOs.  Ultimately, we'll want to
support self-contained build, but this allows Avian to behave like a
conventional libjvm.so.
2010-09-20 17:31:23 -06:00
Joel Dice
88942a9672 search for jar file in Zip.java instead of trying to load by hard-coded name 2010-09-20 17:30:39 -06:00
Joel Dice
0456a9fd49 define user.dir property in Java_java_lang_System_getProperty 2010-09-20 17:28:42 -06:00
Joel Dice
64e42da348 implement avian.Handler.ResourceInputStream.available 2010-09-17 16:11:04 -06:00
Joel Dice
93c9395f1d comment-out debug logging 2010-09-17 16:10:26 -06:00
Joel Dice
a0a23b4692 implement JVM_Yield 2010-09-17 16:10:01 -06:00
Joel Dice
7fffba29e6 Keep reading in BufferedInputStream.read until in.available() <= 0
This corresponds to the documented behavior of OpenJDK's version.
2010-09-17 16:08:42 -06:00
Joel Dice
20990950bb build everything (including classes) in options-specific directory
Previously, we only built platform specific code in an
options-specific directory (e.g. build/linux-x86_64-debug), but built
the Java classes in the shared, top-level build directory.  This
minimized duplication when building with different sets of options,
but now that we're supporting the option of selecting a third-party
class library, we need to put the classes in the options-specific
directory as well.
2010-09-17 16:03:37 -06:00
Joel Dice
d0d53e2e10 fix custom-classloader-related concurrency problems and other bugs
The main changes in this commit ensure that we don't hold the global
class lock when doing class resolution using application-defined
classloaders.  Such classloaders may do their own locking (in fact,
it's almost certain), making deadlock likely when mixed with VM-level
locking in various orders.

Other changes include a fix to avoid overflow when waiting for
extremely long intervals and a GC root stack mapping bug.
2010-09-16 20:49:02 -06:00
Joel Dice
f485016637 implement more JVM_* methods and avoid duplicate array class loading 2010-09-14 18:52:57 -06:00
Joel Dice
d819a75f36 more work towards OpenJDK classpath support
The biggest change in this commit is to split the system classloader
into two: one for boot classes (e.g. java.lang.*) and another for
application classes.  This is necessary to make OpenJDK's security
checks happy.

The rest of the changes include bugfixes and additional JVM method
implementations in classpath-openjdk.cpp.
2010-09-14 10:49:41 -06:00
Joel Dice
561ee6dff9 add debug logging to finder.cpp 2010-09-13 20:38:55 -06:00
Joel Dice
76132bec90 set wsaInitialized to true on success in Java_java_net_Socket_init 2010-09-13 19:50:24 -06:00
Joel Dice
66280458c8 implement more JVM_* methods 2010-09-10 17:47:23 -06:00
Joel Dice
ea2509666a reverse operands when calling builtin isAssignableFrom
Our builtin function reverses the meanings of the operands relative to
the JNI method.
2010-09-10 17:45:52 -06:00
Joel Dice
b62d07996f avoid including path name of libjvm.so in avian-dynamic 2010-09-10 17:44:53 -06:00
Joel Dice
64100d17c7 Merge branch 'master' of oss.readytalk.com:/var/local/git/avian into openjdk 2010-09-10 15:58:43 -06:00
Joel Dice
cddea7187d preliminary support for using OpenJDK's class library
Whereas the GNU Classpath port used the strategy of patching Classpath
with core classes from Avian so as to minimize changes to the VM, this
port uses the opposite strategy: abstract and isolate
classpath-specific features in the VM similar to how we abstract away
platform-specific features in system.h.  This allows us to use an
unmodified copy of OpenJDK's class library, including its core classes
and augmented by a few VM-specific classes in the "avian" package.
2010-09-10 15:05:29 -06:00
Joel Dice
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
Eric Scharff
a26eb1b2b9 Fix missing flush in PrintStream 2010-09-05 09:07:18 -06:00
Joel Dice
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
Joel Dice
17c1a552d5 break each Class, Field, and Method into separate classes
In order to facilitate making the VM compatible with multiple class
libraries, it's useful to separate the VM-specific representation of
these classes from the library implementations.  This commit
introduces VMClass, VMField, and VMMethod for that purpose.
2010-09-01 10:13:52 -06:00
Joel Dice
4273ff834c remove uncessary parentheses from Enum.java 2010-09-01 10:10:11 -06:00
Joel Dice
a4914daae4 remove unused functions from powerpc.cpp 2010-08-30 16:55:48 -06:00
Joel Dice
bcf7c0639c clarify GNU Classpath build instructions in readme.txt 2010-08-16 09:37:44 -06:00
Joel Dice
7eabe13921 verify file contents in FileOutput test 2010-08-16 09:30:39 -06:00
Joel Dice
be1ba2ccf8 fix gnu build 2010-08-16 09:24:27 -06:00
Zsombor Gegesy
4169425307 add error classes 2010-08-16 09:23:48 -06:00
Zsombor Gegesy
a50fda1a5e add ClassLoader.getResources calls 2010-08-16 09:23:48 -06:00
Zsombor Gegesy
03b66375f4 add Collections.enumeration(Collection<T> c) 2010-08-16 09:23:48 -06:00
Zsombor Gegesy
4dc05844df add java.util.Properties.propertyNames() method 2010-08-16 09:23:48 -06:00