Commit Graph

334 Commits

Author SHA1 Message Date
Joel Dice
03653d2dd8 fix stack unwinding and GC root scan for new calling convention 2009-04-26 15:55:35 -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
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
1ed7c0d94c adapt native method call code to new calling convention 2009-04-25 11:49:56 -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
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
d1018bf078 update copyright years 2009-03-15 12:02:36 -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
89a2739165 sync instruction cache after compiling a method 2009-03-09 08:26:23 -06:00
Joel Dice
8b0f7d790f don't assume sizeof(bool) == 8 2009-03-07 18:23:28 -07:00
Joel Dice
33ba8d084d avoid unecessary subtraction in tableswitch 2009-03-06 17:11:14 -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
6e6035505c zero heap space ahead of time when allocating raw storage and garbage collecting, not when allocating individual objects
This helps us support the Java Memory Model without adding a memory
barrier to every object allocation.  It's also potentially more
efficient, since we zero out each heap segment all at once instead of
bit-by-bit with each object allocation.
2009-03-03 20:05:48 -07:00
Joel Dice
8410e1d683 ensure reads and writes of volatile 64-bit fields are atomic 2009-03-03 18:02:11 -07:00
Joel Dice
2ca8132d97 implement support for volatile fields 2009-03-02 20:18:15 -07:00
Joel Dice
8c9d625f8f add memory barriers where appropriate in compile.cpp 2009-03-02 18:40:06 -07:00
Joel Dice
1192ef939e fix stack offset calculation for multianewarray on x86 2009-03-01 15:39:52 -07:00
Joel Dice
412348d938 fix stack offset calulation for multianewarray 2009-03-01 10:49:37 -07:00
Joel Dice
d6bd2e7308 make Compiler::store take both a source size and a destination size to avoid endianness issues; change order of Compiler::load parameters to match 2009-02-28 16:17:24 -07:00
Joel Dice
60c4bede39 fix undefined-order-of-operations bug in Frame::dupped 2009-02-28 14:41:05 -07:00
Joel Dice
3e6c30a4b5 always return an 8-byte value (or void) from native functions called from Java
This is important on the 32-bit OS X PowerPC ABI, since the location
of the low 32-bits of a return value change depending on whether the
entire value is 64-bits or not.
2009-02-28 14:20:43 -07:00
Joel Dice
f22ce3f996 fix parameter offset calculation in invokeNative2 2009-02-28 12:33:26 -07:00
Joel Dice
4999c08e32 fix stack offset calculation for powerpc
This may break x86, in which case we'll iterate until they both work.
2009-02-26 18:54:25 -07:00
Joel Dice
d7d3dd5055 various bugfixes, especially concerning frame allocation and offset calculation 2009-02-25 20:49:42 -07:00
Joel Dice
324caaf98b add size parameter to Assembler::returnLow since the register used depends on the return value size on PowerPC 2009-02-17 18:19:31 -07:00
Joel Dice
c88e3fa230 ensure stack alignment in compile-x86.S and update vmInvoke to accept frame size parameter 2009-02-16 19:49:28 -07:00
Joel Dice
4b2d74f656 fix merge conflict bug preventing the bootimage code from seeing, marking, and fixing jsr addresses 2009-02-14 14:23:23 -07:00
Joel Dice
f58f7b3bdf fix bugs pertaining to tracking reads and and value sites across subroutines (jsr and ret instructions) 2009-02-14 13:26:39 -07:00
Joel Dice
9b0d6854ec fix merge conflicts 2009-02-09 16:22:51 -07:00
Joel Dice
a1ec71423e Merge branch 'master' into powerpc
Conflicts:

	makefile
	src/assembler.h
	src/binaryToMacho.cpp
	src/compile.cpp
	src/compiler.cpp
	src/x86.cpp
2009-02-09 16:22:01 -07:00
Joel Dice
1c3504b62a fix various stack bugs 2009-01-29 18:36:19 -07:00
Joel Dice
54ad7c4e98 tolerate ConstantValue attributes on non-static fields, since the compiler ensures that they are initialized in any constructors for that class (i.e., the VM does not need to do anything special to initialize them) 2009-01-10 12:25:52 -07:00
Joel Dice
9495d03dc6 explicitly load jump target in tableswitch to avoid retaining stale memory sites 2009-01-04 15:56:47 -07:00
Joel Dice
c678fb30a4 snapshot 2008-12-24 13:35:43 -07:00
Joel Dice
c9bec0ce96 only steal sites recursively when all else fails in trySteal 2008-12-21 18:14:20 -07:00
Joel Dice
055ec4dd9f various fixes and cleanups concerning 64-bit values on 32-bit systems 2008-12-21 14:41:56 -07:00
Joel Dice
5e727c8c5d throw an error if a volatile field is encountered, since we don't yet support them properly 2008-12-18 16:32:18 -07:00
Joel Dice
4098368cb9 fix non-debug build of compile.cpp 2008-12-02 19:39:56 -07:00
Joel Dice
d4363d250a mark and fix up absolute addresses in boot image code 2008-12-02 09:45:20 -07:00
Joel Dice
25ade1484a lots of bugfixes and refactoring 2008-12-01 19:38:00 -07:00
Joel Dice
eaf30eb909 fix static class initialization when using a boot image 2008-11-29 21:58:09 -07:00