Commit Graph

1813 Commits

Author SHA1 Message Date
Joel Dice
ed5be83467 add avian.commit system property 2009-07-22 10:38:32 -06:00
Joel Dice
3787985b25 implement basic finalization support
This implementation does not conform to the Java standard in that
finalize methods are called from whichever thread happens to be garbage
collecting, and that thread may hold locks, whereas the standard
guarantees that finalize will be run from a thread which holds no locks.
Also, an object will never be finalized more than once, even if its
finalize method "rescues" (i.e. makes reachable) the object such that it
might become unreachable a second time and thus a candidate for
finalization once more.  It's not clear to me from the standard if this
is OK or not.

Nonwithstanding the above, this implementation is useful for "normal"
finalize methods which simply release resources associated with an
object.
2009-07-21 18:57:55 -06:00
Joel Dice
afdab27e02 backport GC safety fixes from gnu branch 2009-07-20 14:32:25 -06:00
Joel Dice
514d0bf7e5 fix deadlocks and other misbehaviors in class initialization code 2009-07-20 14:12:38 -06:00
Joel Dice
9975a556fa implement VMRuntime.exit 2009-07-20 14:11:41 -06:00
Joel Dice
138f8444df Merge branch 'master' into gnu 2009-07-20 08:27:33 -06:00
Joel Dice
8662361f71 Merge branch 'master' of oss.readytalk.com:/var/local/git/avian 2009-07-20 08:27:17 -06:00
Joel Dice
d12b441aa1 restore state from subroutine after jsr to avoid later confusion determining basic block boundaries 2009-07-20 08:26:01 -06:00
Joel Dice
47ab980550 fix thread heap overflow corner case in allocate3
The previous code relied on the invalid assumption that the thread-local
heaps for all threads would have been cleared immediately following a
garbage collection.  However, the last thing the garbage collection
function does is run finalizers which may allocate new objects.  This
can lead allocate3 to call allocateSmall with a size which is too large
to accomodate, overflowing the heap.

The solution is to iterate until there really is enough room for the
original allocation request.
2009-07-17 19:37:46 -06:00
Joel Dice
3e4336eba4 rearrange finalization code in collect to avoid inifinite recursion when finalizer allocates memory 2009-07-17 09:29:24 -06:00
Joel Dice
9c9eb86b2f fix deadlock in allocate3 when another thread wants to enter the exclusive state 2009-07-16 11:51:35 -06:00
Joel Dice
5f6f8039e6 various bugfixes in subroutine stack mapping code 2009-07-13 17:49:15 -06:00
Joel Dice
e72ff8db0b Merge branch 'master' into gnu
Conflicts:

	src/compile.cpp
2009-07-11 12:11:59 -06:00
Joel Dice
ab5ba9c954 Merge branch 'master' of oss.readytalk.com:/var/local/git/avian 2009-07-10 09:57:29 -06:00
Joel Dice
30c7107aa3 enable DebugAllocation in heap.cpp when NDEBUG is not defined 2009-07-10 08:42:56 -06:00
Joel Dice
22852dcffa fix GC safety bug when walking stack 2009-07-10 08:33:38 -06:00
Joel Dice
c22b4b4e79 various subroutine handling bugfixes 2009-07-08 08:18:40 -06:00
jent
8335dc4297 Now using the CoreServices instead of the Carbon framework....this
allows for cocoa and future compatability
2009-07-02 03:30:05 -06:00
jent
8c3d65a835 Hopefully including the top carbon header will fix the issues we had
when we tried to include just Gestalt.h
2009-07-02 03:13:39 -06:00
jent
2639d94ebc Commented out changes to avian till I can figure out why I can compile
using the deploy script, but no one else can
2009-07-02 02:24:25 -06:00
jent
3367ac88e3 Added in code to support os.version for Windows/Linux/OSX
The make file had to be modified to include the carbon framework in OSX
2009-07-01 09:13:01 -06:00
Joel Dice
dae7b68d5c avoid indexing past the end of the array in makeSimpleFrameMapTable 2009-06-30 17:35:28 -06:00
Joel Dice
562e1e10a8 fix regression in MyCompiler::startLogicalIp 2009-06-30 17:33:54 -06:00
Joel Dice
b308354a3a handle subroutines properly when generating frame maps (initial sketch) 2009-06-26 15:36:04 -06:00
Eric Scharff
f4347dee70 Implement dummy JNI GetVersion 2009-06-22 16:25:13 -06:00
Eric Scharff
c3c06e4e0e Fix mac build
Remove a compiler error by removing an unnecessary method
2009-06-19 13:43:57 -06:00
Joel Dice
7ed14948b9 re-initialize frame maps for exception handlers on every iteration of the frame map calculation loop
This fixes incorrect frame map calcuation which may lead to crashes
during garbage collection from an exception handler.
2009-06-16 13:41:31 -06:00
Joel Dice
a21f951e29 consider an instruction reachable if it has no predecessors (i.e. it's the first instruction 2009-06-12 09:45:29 -06:00
Joel Dice
31976f585a add DebugAllocation option to heap.cpp to help detect allocation and deallocation errors 2009-06-11 17:23:02 -06:00
Joel Dice
e1c7504eda attempt to flush the compile log (if any) before crashing in SegFaultHandler::handle 2009-06-11 17:14:54 -06:00
Joel Dice
525318dabb fix GC safety bug in builtin.cpp 2009-06-11 17:13:25 -06:00
Joel Dice
1d58541c87 generate full memory dump on unhandled exception in windows.cpp 2009-06-11 13:41:13 -06:00
Josh warner
f773c9e610 fixed xul deadlock bug on linux 2009-06-11 09:52:13 -06:00
Josh warner
6bca8fcefc added support for windows-x86_64 2009-06-11 09:48:27 -06:00
Josh warner
16fee943e6 added debugging method 'vmAddressFromLine' 2009-06-11 09:45:35 -06:00
Josh warner
9681a8a1ff added debugging method 'vmAddressFromLine' 2009-06-11 09:44:37 -06:00
Josh warner
862c37f9ad added support for windows-x86_64, changed exception handling to use vectored exception handling on 64 bit windows 2009-06-11 09:43:04 -06:00
Josh warner
73fa0e0b0d added support for windows-x86_64 2009-06-11 09:42:07 -06:00
Josh warner
53da167116 refactored code, added support for upper 8 registers on x86-64 and windows-x86_64 2009-06-11 09:40:50 -06:00
Josh warner
ad33a7800f changed dynamicCall definition for 64 bit windows 2009-06-11 09:39:46 -06:00
Josh warner
788e34936c fixed 64-bit windows printf formatters 2009-06-11 09:38:20 -06:00
Josh warner
a80d30b4ce added windows-x86_64 build target 2009-06-11 09:36:53 -06:00
Joel Dice
f239424930 implement NewDirectByteBuffer etc. properly when building against Classpath; call JNI_OnLoad if found in newly-loaded libraries 2009-06-10 18:15:00 -06:00
Joel Dice
b35a5a6db6 add new test to Subroutine to trigger latent bug compiling multiple jsr instructions to the same address 2009-06-10 18:11:27 -06:00
Joel Dice
70eedcdf97 replace slashes with dots in value returned by StackTraceElement.getClassName to make Classpath's java.util.logging.Logger happy 2009-06-06 21:08:36 -06:00
Joel Dice
61ba2d617e meant to include this in the last commit 2009-06-06 20:38:02 -06:00
Joel Dice
20ea82ec2e various tweaks for Classpath compatibility 2009-06-06 20:32:44 -06:00
Joel Dice
4fca1d64ba fix thinko in String.regionMatches; ignore case when checking charsetName in String ctor 2009-06-06 20:30:58 -06:00
Joel Dice
a201d28e5c handle null loader parameter properly in Class.forName 2009-06-06 20:29:15 -06:00
Joel Dice
c1ca653fef intern CONSTANT_Utf8 pool entries to save memory and reduce bootimage size 2009-06-06 18:26:23 -06:00