corda/test
Joel Dice afabe8e07e rework VM exception handling; throw OOMEs when appropriate
This rather large commit modifies the VM to use non-local returns to
throw exceptions instead of simply setting Thread::exception and
returning frame-by-frame as it used to.  This has several benefits:

 * Functions no longer need to check Thread::exception after each call
   which might throw an exception (which would be especially tedious
   and error-prone now that any function which allocates objects
   directly or indirectly might throw an OutOfMemoryError)

 * There's no need to audit the code for calls to functions which
   previously did not throw exceptions but later do

 * Performance should be improved slightly due to both the reduced
   need for conditionals and because undwinding now occurs in a single
   jump instead of a series of returns

The main disadvantages are:

 * Slightly higher overhead for entering and leaving the VM via the
   JNI and JDK methods

 * Non-local returns can make the code harder to read

 * We must be careful to register destructors for stack-allocated
   resources with the Thread so they can be called prior to a
   non-local return

The non-local return implementation is similar to setjmp/longjmp,
except it uses continuation-passing style to avoid the need for
cooperation from the C/C++ compiler.  Native C++ exceptions would have
also been an option, but that would introduce a dependence on
libstdc++, which we're trying to avoid for portability reasons.

Finally, this commit ensures that the VM throws an OutOfMemoryError
instead of aborting when it reaches its memory ceiling.  Currently, we
treat the ceiling as a soft limit and temporarily exceed it as
necessary to allow garbage collection and certain internal allocations
to succeed, but refuse to allocate any Java objects until the heap
size drops back below the ceiling.
2010-12-27 15:55:23 -07:00
..
extra add QueryDump heap dump analysis tool 2010-11-22 10:04:28 -07:00
AllFloats.java refactor code responsible for moving data in the compiler 2009-11-27 21:15:12 -07:00
Annotations.java support runtime-visible annotations and java.lang.reflect.Proxy 2009-09-18 18:01:54 -06:00
Arrays.java fix Array.makeObjectArray regression 2010-12-01 15:44:09 -07:00
BitsetTest.java java.util.BitSet implementation 2008-07-13 18:16:55 -06:00
DivideByZero.java throw ArithmeticException on divide-by-zero 2010-12-19 17:47:21 -07:00
Enums.java Implemented proper enum toString() behavior and an enum test. it should 2007-09-26 12:59:18 -06:00
Exceptions.java implement primitive testing framework and provide for GC stress testing 2007-07-15 19:03:02 -06:00
FileOutput.java remove redundant import from FileOutput.java 2010-09-12 14:41:01 -06:00
Finalizers.java run java finalizers in a separate thread to guarantee no application locks are held when doing so 2009-08-24 17:51:31 -06:00
Floats.java various bugfixes for handling 64-bit floating point values on 32-bit systems 2009-11-30 15:10:34 +00:00
GC.java fix custom-classloader-related concurrency problems and other bugs 2010-09-16 20:49:02 -06:00
Hello.java revert accidentally-committed change to Hello.java 2008-10-21 17:42:05 -06:00
Integers.java fix signedness error for wide iinc implementation 2010-09-23 08:50:09 -06:00
List.java add AbstractList and AbstractSequentialList classes to java.util and listIterator methods to java.util.List 2009-08-04 17:24:29 -06:00
Logging.java Add a default logging handler, in case the user doesn't provide any. 2007-09-27 12:42:06 -06:00
Longs.java fix 64-bit constant comparisons on 32-bit platforms 2010-12-20 18:08:52 -07:00
Misc.java fix corner cases which led to crashes in JIT compiler 2010-11-26 12:36:43 -07:00
NullPointer.java intercept SIGSEGV and throw NullPointerExceptions 2007-12-31 15:40:56 -07:00
OutOfMemory.java rework VM exception handling; throw OOMEs when appropriate 2010-12-27 15:55:23 -07:00
Proxies.java support runtime-visible annotations and java.lang.reflect.Proxy 2009-09-18 18:01:54 -06:00
References.java fix handling of reachable, moved weak references in postVisit 2009-09-01 17:23:30 -06:00
Reflection.java quick sketch of java/io/* 2007-07-24 18:34:45 -06:00
Simple.java fix Exceptions test for amd64 2008-11-02 15:25:51 -07:00
StackOverflow.java check for stack overflow on entry to all non-leaf methods 2010-12-19 15:23:19 -07:00
Strings.java handle empty strings properly in Pattern.split 2010-09-06 11:16:27 -06:00
Subroutine.java fix corner cases which led to crashes in JIT compiler 2010-11-26 12:36:43 -07:00
Switch.java implement tableswitch and lookupswitch instructions plus run loop bugfixes and tweaks 2007-08-12 20:52:12 -06:00
test.sh fix OS X openjdk and openjdk-src builds 2010-11-15 20:28:53 -07:00
Threads.java implement primitive testing framework and provide for GC stress testing 2007-07-15 19:03:02 -06:00
Tree.java remove unused inner class in Tree.java 2009-07-28 16:58:33 -06:00
Zip.java close ZipFile when done with it in Zip test 2010-12-10 01:20:44 -07:00