Joel Dice
77f1bddce2
Revert "add avian.commit system property"
...
This reverts commit ed5be83467
.
2009-07-22 10:45:38 -06:00
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
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
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
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
20ea82ec2e
various tweaks for Classpath compatibility
2009-06-06 20:32:44 -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
Joel Dice
9cf0a42210
respect string offset in stringCharAt
2009-06-06 16:36:07 -06:00
Joel Dice
ac34bc072c
remove obsolete todo comments
2009-06-06 14:58:06 -06:00
Joel Dice
6efeee49f8
include native Classpath code in libavian.a and the avian executable
2009-06-06 14:18:33 -06:00
Joel Dice
0857f53651
more progress on GNU Classpath compatibility
2009-06-04 17:21:42 -06:00
Joel Dice
4a87d82d8e
fix GC safety bug in MyProcessor::initVtable
2009-06-04 17:20:55 -06:00
Joel Dice
db09adc0d4
allow copies between object arrays of different types in System.arraycopy
2009-06-04 17:19:48 -06:00
Joel Dice
98be5c509e
more progress towards GNU Classpath compatibility
2009-06-03 16:17:55 -06:00
Joel Dice
0f6dbe35a7
add build option for using GNU Classpath
2009-06-02 18:55:49 -06:00
Joel Dice
ba5105c374
throw NoSuchMethodError in resolveMethod if method not found
2009-06-02 18:55:12 -06:00
Joel Dice
a4d4db8eb4
fix cygwin/msys bootimage build
2009-06-01 12:12:29 -06:00
Joel Dice
11e61543a3
fix bootimage build
2009-05-31 21:16:58 -06:00
Joel Dice
049f96bd1c
Merge branch 'master' into fun
2009-05-31 17:25:34 -06:00
Joel Dice
c434f211e2
fix return type for Avian_java_lang_Object_hashCode
2009-05-31 17:19:18 -06:00
Joel Dice
ace985b390
fix native method lookup for fast calling convention on Windows
2009-05-31 14:41:07 -06:00
Joel Dice
b1d92fc6c2
fix compilation of synchronized methods which return values
2009-05-31 14:15:45 -06:00
Joel Dice
02fba10614
set DebugCompile to false
2009-05-28 19:56:15 -06:00
Joel Dice
f30e31e5f6
compile-x86.S bugfixes and cleanups
2009-05-28 19:54:32 -06:00
Joel Dice
14613193fa
include return address size in frameSize passed to vmInvoke; fix printf warnings
2009-05-28 19:50:44 -06:00
Joel Dice
2478d4fc7f
conditionally include continuation code in compile-x86.S
2009-05-28 19:13:15 -06:00
Joel Dice
b4dea1f71c
fix printf warnings in compiler.cpp
2009-05-28 19:12:26 -06:00
Joel Dice
d99f8df6e6
several bugfixes for powerpc continuations
2009-05-28 18:56:05 -06:00
Joel Dice
ec60b844d4
fix powerpc tail calls
2009-05-27 18:15:39 -06:00
Joel Dice
49a2c1846d
powerpc bugfixes
2009-05-26 19:30:11 -06:00
Joel Dice
2608a2ee43
progress towards powerpc continuation and tail call support
2009-05-26 19:02:39 -06:00
Joel Dice
31eb75a736
support tail calls and continuations as build options
2009-05-25 23:27:10 -06:00
Joel Dice
deefc47b1a
correct comment in vmInvoke
2009-05-25 21:39:17 -06:00
Joel Dice
31d9700c9b
move SystemClassLoader and Runtime.dumpHeap to avian package
2009-05-25 21:36:29 -06:00
Joel Dice
9682d63b84
fix marshalling of 64-bit arguments in interpret.cpp
2009-05-25 21:20:29 -06:00
Joel Dice
43f5c3f382
fix process=interpret build
2009-05-25 21:05:49 -06:00
Joel Dice
758325ae27
convert methods in builtin.cpp to use fast native calling convention
2009-05-25 20:02:25 -06:00
Joel Dice
ea5fea4802
fix printf format for 64-bit build
2009-05-25 14:59:36 -06:00
Joel Dice
9837528a3e
set Thread::continuation before calling jumpAndInvoke in Rewind case of callContinuation
2009-05-24 22:49:39 -06:00
Joel Dice
0a4e77ffa7
fix thinko in callContinuation
2009-05-24 22:36:16 -06:00
Joel Dice
92aea95b36
continuation bugfixes
2009-05-24 22:27:50 -06:00
Joel Dice
c2bd828cc1
call the right continuation in callContinuation
2009-05-24 18:58:45 -06:00
Joel Dice
dc523fe6eb
load eax and edx in 32-bit vmJump
2009-05-24 18:57:59 -06:00
Joel Dice
af59c85deb
various bugfixes
2009-05-24 18:22:36 -06:00
Joel Dice
e80401ed10
vmJumpAndInvoke bugfixes
2009-05-24 11:18:17 -06:00
Joel Dice
9dbea21ec4
add continuation support to 32-bit section of compile-x86.S
2009-05-24 00:32:49 -06:00
Joel Dice
18ec68c7b7
fix word order when pushing 64-bit values as arguments to helper thunks in appendCombine
2009-05-24 00:31:53 -06:00
Joel Dice
364f31b785
finish initial sketch of dynamicWind implementation
2009-05-23 19:49:14 -06:00
Joel Dice
4305fdc7f3
begin dynamicWind implementation
2009-05-23 16:15:06 -06:00
Joel Dice
79558e7e34
fix GCC 4.4 warnings
2009-05-22 18:21:11 -06:00
Joel Dice
e165d5f3fd
avoid uninitialized variable warnings in MyProcessor::callWithCurrentContinuation
2009-05-19 18:28:43 -06:00
Joel Dice
ecfecf2006
translate local indexes before passing to Frame.stored{Int,Long,Object}
2009-05-18 09:16:17 -06:00
Joel Dice
398dec58bb
GC bugfixes
2009-05-17 17:43:48 -06:00
Joel Dice
195d95d809
continuation bugfixes
2009-05-16 18:39:08 -06:00
Joel Dice
8cb59c9d4c
various bugfixes to get Continuations test working
2009-05-16 02:03:03 -06:00
Joel Dice
57cec2d068
various bugfixes
2009-05-14 20:08:01 -06:00
Joel Dice
3d1ef68001
various bugfixes
2009-05-12 12:16:55 -06:00
Joel Dice
66c4867f18
more work on continuation support
2009-05-05 18:29:05 -06:00
Joel Dice
eb3bd25aa1
code cleanup and build fixes
2009-05-04 19:04:17 -06:00
Joel Dice
0cd4eb2655
early sketch of continuation support
2009-05-03 14:57:11 -06:00
Joel Dice
90dcf084a2
protect object from GC in compileVirtualMethod2; condense frame GC root maps to minimum size needed
2009-04-27 14:46:43 +00:00
Joel Dice
fd99691b00
fix CallEvent::popIndex calculation
2009-04-26 21:59:22 -06:00
Joel Dice
50529969f9
fix code to visit GC roots on stack to be compatible with tail calls; avoid generating unreachable jumps
2009-04-26 19:53:42 -06:00
Joel Dice
299699f1ff
fix stack unwinding for new calling convention (2nd try)
2009-04-26 16:06:15 -06:00
Joel Dice
03653d2dd8
fix stack unwinding and GC root scan for new calling convention
2009-04-26 15:55:35 -06:00
Joel Dice
f80fb9b536
refine code for picking target sites to avoid unecessary moves
2009-04-26 12:19:16 -06:00
Joel Dice
64b529c915
avoid generating unreachable code after tail calls
2009-04-25 20:54:36 -06:00
Joel Dice
bf8fdb6316
visit MyProcessor::virtualThunks during GC
2009-04-25 20:24:04 -06:00
Joel Dice
630fde86f7
freeze registers in CallEvent::compile to ensure they are not used as temporaries by the assmebler
2009-04-25 20:07:47 -06:00
Joel Dice
0245a94ab8
generate code in ReturnEvent if and only if the event is preceded by at least one non-tail-call
2009-04-25 19:51:33 -06:00
Joel Dice
89221bfcfa
fix handling of virtual calls to native methods
2009-04-25 17:52:08 -06:00
Joel Dice
141862470b
fix stack pointer adjustment in invokeNative2; pad frame size using Architecture::frameFootprint in MyProcessor::invoke to conform to new calling convention
2009-04-25 17:33:42 -06:00
Joel Dice
5354e36530
fix unsafe stack pointer adjustment in vmInvoke
2009-04-25 17:31:24 -06:00
Joel Dice
1ed7c0d94c
adapt native method call code to new calling convention
2009-04-25 11:49:56 -06:00
Joel Dice
de84afe2fe
adjust stack if necessary after non-tail-call in case where callee pops arguments
2009-04-25 11:47:41 -06:00
Joel Dice
3113ae74eb
various bugfixes
2009-04-22 01:39:25 +00:00
Joel Dice
717f359666
implement "callee pops arguments" calling convention and refactor tail call code accordingly
2009-04-19 16:36:11 -06:00
Joel Dice
dba72409aa
move use of SingleRead::successor; fix build errors
...
We now use SingleRead::successor in pickTarget, where we use it to
determine the prefered target site for the successor without requiring
the target to conform to that preference. The previous code made the
preference a hard requirement, which is not desirable or even possible
in general.
2009-04-07 18:55:43 -06:00
Joel Dice
35d1c6e068
add SingleRead::successor; fix build errors
...
The SingleRead::successor field is used (when non-null) to further
constrain the SiteMask in SingleRead::intersect based on reads of
successor values (as in the cases of moves and condensed-addressing
combine and translate instructions).
2009-04-06 18:34:12 -06:00
Joel Dice
fea92ed995
more work on tail recursion
...
We now create a unique thunk for each vtable position so as to avoid
relying on using the return address to determine what method is to be
compiled and invoked, since we will not have the correct return address
in the case of a tail call. This required refactoring how executable
memory is allocated in order to keep AOT compilation working. Also, we
must always use the same register to hold the class pointer when
compiling virtual calls, and ensure that the pointer stays there until
the call instruction is executed so we know where to find it in the
thunk.
2009-04-05 15:42:10 -06:00
Joel Dice
5e740170f2
initial sketch of tail call optimization (non-virtual calls only, so far)
2009-03-31 14:15:08 -06:00
Joel Dice
b871f430d0
avoid reading below the stack pointer in vmInvoke, since it upsets valgrind
2009-03-19 08:44:08 -06:00
Joel Dice
538e23c642
fix order-of-operations bugs in compile.cpp which led to creation of incorrect stack maps
2009-03-18 16:24:13 -06:00
Joel Dice
c9400316fd
try harder to find a suitable stack frame site in pickTarget when there are no free registers left
2009-03-16 20:03:59 -06:00
Joel Dice
f5c79355f2
set StealRegisterReserveCount to 2 to avoid running out of registers in when shuffling values around on the stack
2009-03-16 18:00:51 -06:00
Joel Dice
d1018bf078
update copyright years
2009-03-15 12:02:36 -06:00
Joel Dice
0ce644cca2
put new thread into active state in AttachCurrentThread
2009-03-14 18:07:38 -06:00
Joel Dice
073b829c79
avoid running out of eligable source registers for writing a single byte to memory on x86
2009-03-14 16:47:26 -06:00
Joel Dice
12640219e6
handle b == dst case in andC
2009-03-14 14:34:44 -06:00
Joel Dice
8d9409112c
reuse source site as destination site if appropriate in getTarget
2009-03-14 14:17:32 -06:00
Joel Dice
54b691f4de
handle b == t case in multiplyR and remainderR
2009-03-14 14:14:49 -06:00
Joel Dice
ee2d105f6c
freeze move operand sites prior to calling the assembler so the assembler won't steal them
2009-03-13 20:55:41 -06:00
J. Treadwell
21fa23d84b
fixed multiplyC bug (all multiplies now delegated to multiplyR)
2009-03-13 18:37:40 -06:00
Joel Dice
4c27755a53
fix endianness issue storing and loading longs
2009-03-11 21:07:30 -06:00
Joel Dice
49cd2dd9bf
fix powerpc bootimage build (second try)
2009-03-10 19:08:16 -06:00
Joel Dice
6c271ac994
fix powerpc bootimage build
2009-03-09 18:52:09 -06:00
Joel Dice
c11203b401
pass srcSelectSize instead of srcSize to Architecture::plan in appendMove
2009-03-09 12:31:41 -06:00
Joel Dice
8ac6fb9d75
fix x86_64 build
2009-03-09 15:29:37 +00:00
Joel Dice
89a2739165
sync instruction cache after compiling a method
2009-03-09 08:26:23 -06:00
Joel Dice
4347228585
fix thinko in addC for zero constant case
2009-03-08 20:55:54 -06:00
Joel Dice
68ed5e6cb5
fix addC for case where bit 15 of constant is set
2009-03-08 20:09:06 -06:00
Joel Dice
8b0f7d790f
don't assume sizeof(bool) == 8
2009-03-07 18:23:28 -07:00
Joel Dice
e1395f300a
fix warnings for optimized build
2009-03-07 17:52:18 -07:00
Joel Dice
14c6deb710
do two passes in MyCompiler::initLocalsFromLogicalIp in order to properly link multiword values together
2009-03-07 17:39:55 -07:00
Joel Dice
661b49ea92
Merge branch 'master' into powerpc
2009-03-07 16:41:17 -07:00
Joel Dice
abe6ada0c2
Merge branch 'master' of oss.readytalk.com:/var/local/git/avian
2009-03-07 16:40:56 -07:00
Joel Dice
ea4764c924
Merge branch 'master' into powerpc
2009-03-07 16:40:23 -07:00
Joel Dice
7add34944b
protect source site from being used as a temporary for move operations
2009-03-07 16:32:05 -07:00
Joel Dice
376941ab35
fix single-precision float marshalling in dynamicCall
2009-03-07 14:32:08 -07:00
Joel Dice
0aaee96479
allocate executable memory area all at once to ensure it is contiguous, since immediate relative jumps on PowerPC can only cross 2^26 bytes of memory
2009-03-07 12:03:27 -07:00
Joel Dice
fd7bef7db3
only accept sites conforming to specified SiteMask in getTarget
2009-03-06 17:37:54 -07:00
Joel Dice
9b9ae62541
defer to moveCR when adding or subtracting zero
2009-03-06 17:11:51 -07:00
Joel Dice
33ba8d084d
avoid unecessary subtraction in tableswitch
2009-03-06 17:11:14 -07:00
Joel Dice
b5f76d96dc
handle exception case in makeCodeImage
2009-03-06 17:10:31 -07:00
Joel Dice
e61d05f00b
undo temporary big endian offset correction before leaving maybeMove
2009-03-06 12:14:37 -07:00
Joel Dice
7388da6282
fix endianness issues when loading values smaller than BytesPerWord from the stack
2009-03-06 10:56:11 -07:00
Joel Dice
ca0d4b44c1
defer moveZCR to moveCR
2009-03-06 10:54:43 -07:00