Commit Graph

2169 Commits

Author SHA1 Message Date
Joel Dice
29309fb414 update Thread field offsets to reflect recent additions
Every time we add or remove fields to Thread, we need to update the
assembly code to reflect the new offsets.
2010-02-02 12:26:09 -07:00
Joel Dice
e92674cb73 fix race condition in monitorWait
We don't want to check Thread::waiting until we have re-acquired the
monitor, since another thread might notify us between releasing
Thread::lock and acquiring the monitor.
2010-02-02 12:24:05 -07:00
Joel Dice
3bc37d6e2a fix encoding of single byte register-to-memory moves on x86_64
We need to prefix instructions of the form "mov R,M" with a REX byte
when R is %spl, %bpl, %sil, or %dil.  Such moves are unencodable on
32-bit x86, and, because of the order in which we pick registers,
pretty rare on 64-bit systems, which is why this took so long to
notice.
2010-02-02 11:37:08 -07:00
Joel Dice
5d781a0584 declare Long.MAX_VALUE and Long.MIN_VALUE as longs, not Longs 2010-02-02 09:33:10 -07:00
Joel Dice
8120bee4dc reimplement Java object monitors to avoid running out of OS handles
Due to SWT's nasty habit of creating a new object monitor for every
task added to Display.asyncExec, we've found that, on Windows at
least, we tend to run out of OS handles due to the large number of
mutexes we create between garbage collections.

One way to address this might be to trigger a GC when either the
number of monitors created since the last GC exceeds a certain number
or when the total number of monitors in the VM reaches a certain
number.  Both of these risk hurting performance, especially if they
force major collections which would otherwise be infrequent.  Also,
it's hard to know what the values of such thresholds should be on a
given system.

Instead, we reimplement Java monitors using atomic compare-and-swap
(CAS) and thread-specific native locks for blocking in the case of
contention.  This way, we can create an arbitrary number of monitors
without creating any new native locks.  The total number of native
locks needed by the VM is bounded instead by the number of live
threads plus a small constant.

Note that if we ever add support for an architecture which does not
support CAS, we'll need to provide a fallback monitor implementation.
2010-02-01 18:40:47 -07:00
Joel Dice
45476eb591 fix handling of volatile longs and doubles on PowerPC
We were miscompiling methods which contained getfield, getstatic,
putfield, or putstatic instructions for volatile 64-bit primitives on
32-bit PowerPC due to not noticing that values in registers are clobbered
across function calls.

The solution is to create a separate Compiler::Operand instance for each
object monitor reference before and after the function call to avoid
confusing the compiler.  To avoid duplicate entries in the constant pool,
we add code look for and, if found, reuse any existing entry for the same
constant.
2010-01-27 17:46:04 -07:00
Joel Dice
2868413b51 preserve exception classes from obfuscation in vm.pro
We preserve from obfuscation by ProGuard any class of exception thrown
from either the VM or native class library code.
2010-01-27 13:44:02 -07:00
Joel Dice
bdeb61fc99 fix grammar in readme.txt 2010-01-15 08:25:06 -07:00
jet
b33219cc7d Merge branch 'wip' of oss.readytalk.com:/var/local/git/avian into wip 2010-01-11 10:39:37 -07:00
Joel Dice
2c4e229e6e convert forward slashes to back slashes in Windows paths 2010-01-11 08:31:01 -07:00
Joel Dice
b1a1391093 skip "." and ".." in File.list{Files} to match Sun 2010-01-09 19:18:39 -07:00
Joel Dice
585dba004b ignore redundant calls to File{In|Out}putStream.close
Previously, we threw an IOException, which did not match Sun's behavior.
2010-01-09 18:22:16 -07:00
Joel Dice
9a056da2f7 increase default buffer size in BufferedInputStream
The previous value of 32 bytes did not perform well.  This increases it to 4096 bytes, which matches BufferedOutputStream.
2010-01-09 18:20:15 -07:00
jet
ea4b4bfcbf Merge branch 'wip' of oss.readytalk.com:/var/local/git/avian into wip 2010-01-06 10:57:55 -07:00
Joel Dice
3686d2131d fix jsr/ret code generation bug
We were generating code to marshal values into place prior to a jump,
but placing it after the jump instruction, which made it useless.
2010-01-04 17:17:16 -07:00
Joel Dice
20f92bbd05 specify java.home system property in GNU Classpath build
Currently, we just set this to /tmp (or the equivalent) since Avian
doesn't really have a home.  This avoids a NullPointerException from
javax/xml/parsers/SAXParserFactory.
2010-01-04 17:14:00 -07:00
jet
8c8020811a Merge branch 'wip' of oss.readytalk.com:/var/local/git/avian into wip 2009-12-28 11:14:26 -07:00
Joel Dice
664cb3cd39 don't try to parse annotation tables more than once; use defining classloader when loading array classes during linking 2009-12-24 17:58:48 -07:00
Joel Dice
805d1d13d8 mark system classloader initialized when using GNU Classpath to avoid security exceptions; only look for field in interfaces after looking in class and superclasses 2009-12-24 17:57:07 -07:00
Joel Dice
40c65f66bf add (commented-out) debug logging to gnu.cpp 2009-12-24 17:54:02 -07:00
Joel Dice
7b2322e7f7 accept any source site in resolveTargetSites, whether it matches the next read or not 2009-12-24 17:47:58 -07:00
jet
77990b9489 Merge branch 'wip' of oss.readytalk.com:/var/local/git/avian into wip 2009-12-23 09:26:17 -07:00
Joel Dice
f588a62ae3 fix Classpath 0.98 compatibility issues 2009-12-22 21:34:04 -07:00
Joel Dice
30db38ebd6 replace calls to ExceptionOccurred with calls to ExceptionCheck
The latter is cheaper (avoids a state transition and possible memory
allocation) when we just want to know if an exception is thrown
without needing a handle to that exception.
2009-12-16 19:25:03 -07:00
Joel Dice
4c0ede8b9a reuse JNI references when possible
Before allocating a new reference in NewGlobalReference or when
creating a local reference, we look for a previously-allocated
reference pointing to the same object.  This is a linear search, but
usually the number of elements in the reference list is small, whereas
the memory, locking, and allocation overhead of creating duplicate
references can be large.
2009-12-16 19:16:51 -07:00
Joel Dice
70da0df46b add Class.getExceptionTypes method 2009-12-15 10:04:51 -07:00
Joel Dice
7cf25a0fc3 fix process=interpret build 2009-12-14 18:01:28 -07:00
Joel Dice
67cdac3a36 tweak MSVC compiler flags
We now use -O2 for the "fast" build and always pass -debug to the linker so we get a PDB file.
2009-12-14 08:43:07 -07:00
Joel Dice
d5f5c2351b use _ReadWriteBarrier intrinsic for MSVC build 2009-12-12 18:50:59 -07:00
Joel Dice
875a1a45a3 pass valid pReturnValue parameter to _wgetenv_s 2009-12-12 17:55:00 -07:00
Joel Dice
f0c14fa1f1 Merge branch 'master' of oss.readytalk.com:/var/local/git/avian 2009-12-06 13:35:07 -07:00
Joel Dice
2fa9dc9123 grammar tweak in readme.txt 2009-12-06 13:35:00 -07:00
Joel Dice
bec3766180 fix misuse of term "recursive" in Continations JavaDoc 2009-12-06 13:34:31 -07:00
Joel Dice
ccbb4796f2 fix typo in JavaDoc comment 2009-12-05 22:49:23 -07:00
Joel Dice
8c3e779d4c add instructions for building with GNU Classpath 2009-12-05 20:05:54 -07:00
Joel Dice
2b4361c060 fix GNU Classpath build 2009-12-05 19:40:46 -07:00
Joel Dice
0c85fc7527 throw OutOfMemoryError if malloc returns null pointer 2009-12-05 15:51:12 -07:00
Joel Dice
112e2a71d5 update copyright years 2009-12-05 15:50:23 -07:00
Joel Dice
b6ac05ba9d remove unecessary code from resolveSourceSites and resolveTargetSites 2009-12-05 15:49:53 -07:00
jent
4cf9e16897 Merge branch 'master' of oss.readytalk.com:/var/local/git/avian 2009-12-04 12:02:06 -07:00
jent
99a1c12682 Files to add Deflater and DeflaterOutputStream to java.util.zip for
avian
2009-12-04 12:01:31 -07:00
Joel Dice
0e4fabffb7 fix incorrect parameter to maybeRex call in sseMoveRR 2009-12-03 17:57:28 -07:00
Joel Dice
60333c88f5 fix continuations=true build for Windows x86_64 2009-12-03 12:46:29 -07:00
Joel Dice
329ee6bbe4 Merge branch 'master' of oss.readytalk.com:/var/local/git/avian 2009-12-03 10:47:51 -07:00
Joel Dice
028fd42f5e detect and prohibit unsupported bootimage cross-builds in makefile 2009-12-03 10:47:50 -07:00
Joel Dice
8cf67a76ad add note to bootimage flag documentation in readme.txt 2009-12-03 10:47:08 -07:00
Joel Dice
7cdf63c045 fix continuations=true build for Darwin 2009-12-02 23:15:27 -07:00
Joel Dice
f0e66eea37 remove extra semicolon 2009-12-02 23:09:05 -07:00
Joel Dice
7a3bf85caf fix bootimage=true build for Windows 2009-12-02 20:08:07 -07:00
Joel Dice
b218117881 fix continuations=true build for Cygwin 2009-12-02 19:37:22 -07:00