Commit Graph

1415 Commits

Author SHA1 Message Date
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
Joel Dice
762df17aa7 use Architecture::plan in BranchEvent ctor to determine acceptable types for address 2009-03-05 20:27:59 -07:00
Joel Dice
a0e503ad0a optimize moveRR and fix andC 2009-03-05 20:21:15 -07:00
Joel Dice
75e28e81c9 fix operand ordering in remainderR 2009-03-05 19:35:49 -07:00
Joel Dice
ec610a5521 handle shift counts greater than 31 properly 2009-03-05 19:05:39 -07:00
Joel Dice
16e81bcc07 fix orC 2009-03-05 18:33:00 -07:00
Joel Dice
7d48547f0e fix compareUnsignedCR, which relied on sign extension in cmplwi, which actually does zero extension; fix use of li argument to instruction format I 2009-03-05 18:02:03 -07:00
Joel Dice
3e495b8ca5 use mulhwu and eliminate temporary in 64-bit multiplyRR 2009-03-04 19:50:03 -07:00
Joel Dice
77195713b8 fix xorR regression introduced in last commit 2009-03-04 19:22:47 -07:00
Joel Dice
cca3e72318 fix 64-bit xorC 2009-03-04 19:20:15 -07:00
Joel Dice
acfa1ee2ff fix 64-bit negateRR 2009-03-04 18:59:04 -07:00
Joel Dice
d48e5377fe add missing instruction to multiplyR 2009-03-04 18:43:53 -07:00
Joel Dice
a8da9ecb05 fix use of displacement parameter in instruction format B; use correct opcode in slw instruction 2009-03-04 18:20:54 -07:00
Joel Dice
296c93a04c fix backwards logic in longCompare; correct unsupported use of JumpIfLessOrEqualC in shiftRightR; add multiply, divide, and remainder operations to table 2009-03-04 17:54:47 -07:00
Joel Dice
8cc1f6def8 remove dead code from MyCompiler::call 2009-03-04 17:52:55 -07:00
JET
dbcd42e70c added 64-bit shifts and mul/div 2009-03-04 10:11:42 -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
5f0b40e531 restore call to Client::releaseTemporary in moveCM 2009-03-01 23:07:28 +00:00
Joel Dice
6eacf7b804 fix bounds checks in MyCompiler::initLocalsFromLogicalIp 2009-03-01 22:47:07 +00:00
Joel Dice
97961ecdde pick a temporary register which is valid as both a destination and a source for the required moves in maybeMove 2009-03-01 15:41:03 -07:00
Joel Dice
1192ef939e fix stack offset calculation for multianewarray on x86 2009-03-01 15:39:52 -07:00
Joel Dice
7a2bf9b855 fix x86.cpp build 2009-03-01 15:14:51 -07:00
Joel Dice
28d4409b0a implement negateRR 2009-03-01 12:57:07 -07:00
Joel Dice
36196910ed implement xorR and xorC 2009-03-01 12:40:49 -07:00
Joel Dice
97e698d806 fix MyCompiler::peak for big-endian architectures 2009-03-01 12:36:30 -07:00
Joel Dice
696282631a fix endianness issues with 64-bit locals 2009-03-01 12:28:17 -07:00
Joel Dice
412348d938 fix stack offset calulation for multianewarray 2009-03-01 10:49:37 -07:00
Joel Dice
117c89b9ee change == to <= in moveCR2 since we only need to ensure dstSize is no more than the word size 2009-02-28 19:10:31 -07:00
Joel Dice
93ebb571b3 only add site to result if result is live in CombineEvent::compile and TranslateEvent::compile 2009-02-28 19:08:14 -07:00
Joel Dice
5adcfa3341 fix 32-bit indexed loads 2009-02-28 17:31:09 -07:00
Joel Dice
750f4d51da fix extsb/extsh operand order in moveRR 2009-02-28 17:17:12 -07:00
Joel Dice
f01a78699f fix opcode for lbzx 2009-02-28 16:58:54 -07:00
Joel Dice
b0422b32e6 implement orR and orC; add shift operations to ternary operation table 2009-02-28 16:28:10 -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
10c75f4783 add longCompareC to ternary operation table 2009-02-28 15:04:04 -07:00
Joel Dice
5a8ffcd79b implement moveZRR and moveZMR 2009-02-28 15:00:12 -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
c5dd97ffea ensure that we release temporaries back to the compiler in powerpc.cpp; allow the first operand of a comparison to be a constant 2009-02-28 13:41:37 -07:00
Joel Dice
a2d2564d83 restore changes clobbered by commit 5a08062 2009-02-28 12:58:34 -07:00
Joel Dice
1249b11080 fix build breakage 2009-02-28 12:47:47 -07:00
Joel Dice
46a6744050 Merge commit 'origin/powerpc' into powerpc 2009-02-28 12:44:31 -07:00
Joel Dice
f8d7bea7e8 implement various compare and branch instructions 2009-02-28 12:36:02 -07:00
Joel Dice
f22ce3f996 fix parameter offset calculation in invokeNative2 2009-02-28 12:33:26 -07:00
JET
5a08062190 prelim 64-bit mult and shift support 2009-02-27 16:54:20 -07:00
Joel Dice
8ecd6a0394 fix and optimize andC 2009-02-26 18:56:57 -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
73aa499371 clean up offsetToFrameIndex code 2009-02-26 18:53:35 -07:00
Joel Dice
d7d3dd5055 various bugfixes, especially concerning frame allocation and offset calculation 2009-02-25 20:49:42 -07:00
Joel Dice
6957492c7a ignore base argument in powerpc version of vmJump and move thread argument into correct register 2009-02-25 20:47:38 -07:00
Joel Dice
b539d7b1e0 Merge commit 'origin/powerpc' into powerpc
Conflicts:
	src/powerpc.cpp
2009-02-25 18:31:21 -07:00
Joel Dice
08af5deb36 implement andC and moveAR; fix MyArchitecture::nextFrame 2009-02-25 18:16:38 -07:00
Joel Dice
09c96a3063 simplify longCompare in x86.cpp such that the move function pointer parameter is eliminated and moveCR is called directly 2009-02-25 18:13:18 -07:00
Joel Dice
2554673dda call c->arch->plan in CallEvent ctor to ensure the address operand is placed into the proper operand type for the call instruction 2009-02-25 18:11:41 -07:00
J. Treadwell
c148369d57 added multiply and divide instructions and intermediates 2009-02-25 09:37:44 -07:00
Joel Dice
0832c740fc implement a few conditional and branch instructions 2009-02-24 18:29:04 -07:00
Joel Dice
571615a79f fix stack space calculation in compile-powerpc.S 2009-02-24 18:28:05 -07:00
Joel Dice
299f8542b7 rename fooCRR and fooRRR to fooC and fooR, respectively; add entries to ternary operation table in populateTables 2009-02-24 09:13:11 -07:00
Joel Dice
b292cbb7f4 mask displacement in instruction format D; fix MyArchitecture::frameIp to look for return address at an 8-byte offset from the stack pointer 2009-02-24 08:04:55 -07:00
Joel Dice
eef5047a52 various bugfixes in powerpc.cpp 2009-02-23 21:25:15 -07:00
J. Treadwell
ee90d7bd2c merged ppc changes 2009-02-23 20:57:25 -07:00
JET
2d09f57cbd added instructions 2009-02-23 19:16:42 -07:00
Joel Dice
da8520754d progress towards compiling and running simple methods on powerpc 2009-02-23 19:11:32 -07:00
Joel Dice
79a1d0451f fix GCC 4.2 -Os uninitialized variable warning in windows.cpp 2009-02-22 17:44:11 -07:00
Joel Dice
8add9db0b2 fix GCC 4.x aliasing warnings in windows.cpp 2009-02-22 17:04:58 -07:00
Joel Dice
9a9b2c611a sketch of new powerpc.cpp implementation 2009-02-21 12:30:25 -07:00
Joel Dice
a9e85e5de8 fix compare instruction syntax in compile-powerpc.S 2009-02-18 17:46:07 -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
17b4c20435 fix windows build 2009-02-16 19:48:29 -07:00
Joel Dice
ba4e2a6582 rename compile.S to compile-x86.S and add compile-powerpc.S 2009-02-16 08:21:12 -07:00
Joel Dice
773e229112 fix powerpc native call bugs 2009-02-15 14:24:20 -07:00
Joel Dice
bec13838c1 Merge branch 'powerpc' of oss.readytalk.com:/var/local/git/avian 2009-02-15 12:34:01 -07:00
Joel Dice
cea5a9315d fix block delimiting code in compile.cpp to avoid cycles and nested blocks 2009-02-15 11:11:00 -07:00
Joel Dice
7803663fc9 fix block delimiting code in compiler.cpp to minimize the number of blocks needed
This exposed bugs in x86.cpp concerning alignment padding which are now
fixed.
2009-02-14 17:52:44 -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
93142bb952 support filtering based on class name, method name, and method spec in
bootimage.cpp

This is useful for debugging the compiler, since it allows you to
compile one method in particular if that's where a bug manifests itself.
2009-02-14 13:23:31 -07:00
U-JOELDICEXPVM\Joel Dice
ec5c64d472 fix Cygwin build 2009-02-13 17:03:46 -07:00
Joel Dice
e3257134c9 fix merge-related regression affecting bootimage build 2009-02-09 19:00:53 -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
a1fc8a4dac add site to result in MemoryEvent::compile regardless of whether the result is live, since the memory location may be used as the target of a move and we need to keep the reference count of the base and index registers nonzero 2009-02-08 19:08:56 -07:00
Joel Dice
29616c4abc freeze target site when using temporary in maybeMove 2009-02-08 18:58:33 -07:00
Joel Dice
4ca45ffa41 fix two bugs concerning tracking available registers and reserving them when necessary 2009-02-08 16:20:28 -07:00
Joel Dice
0fbe89c147 set Value::high when appropriate in MyCompiler::initLocalsFromLogicalIp 2009-02-08 15:13:49 -07:00
Joel Dice
175ec1ff48 remove debug logging 2009-02-08 13:22:28 -07:00
Joel Dice
5066bfdabf tweak register and frame site allocation code to avoid failure in corner cases 2009-02-08 13:21:35 -07:00
Joel Dice
55d2ee1823 avoid clobbering values in sign-extension case of MoveEvent.compile 2009-02-02 19:13:02 -07:00
Joel Dice
123e22322c turn off debug logging 2009-02-01 16:21:55 -07:00
Joel Dice
2e3fd111d4 fix regressions on x86_64 2009-02-01 16:19:11 -07:00
Joel Dice
8b1801c465 various bugfixes involving multiword values 2009-02-01 16:10:56 -07:00
Joel Dice
11408dc2cd fix popIndex calculation in CallEvent ctor 2009-01-31 12:35:45 -07:00
Joel Dice
8b6319fbc8 assume stack grows towards negative addresses when loading and storing multiword locals 2009-01-31 12:05:06 -07:00
Joel Dice
a11d018dc2 fix assertion in MyCompiler::peek 2009-01-29 18:43:46 -07:00
Joel Dice
8dca14af74 remove obsolete assertion from negateRR 2009-01-29 18:43:18 -07:00
Joel Dice
1c3504b62a fix various stack bugs 2009-01-29 18:36:19 -07:00
Joel Dice
565ece136b begin refactoring compiler.cpp to treat each word of a multiword value seperately 2009-01-25 15:03:38 -07:00
Joel Dice
034444db57 fix a couple of bugs handling multi-word values 2009-01-12 09:26:43 -07:00
Joel Dice
582e975a8a remove temporary debug code 2009-01-11 16:46:36 -07:00
Joel Dice
85ac9b9c71 revert overflow code in sitesToString since we now prune dead buddies from values 2009-01-11 16:46:22 -07:00
Joel Dice
05bd86e2ed use upper 32 bits of mask in pickRegisterTarget when picking register for high word; set Target::Impossible to 5 since 4 is a valid cost 2009-01-11 16:42:41 -07:00
Joel Dice
04bc58fd95 reorder code in MemorySite::release so we can use low->size before it is overwritten 2009-01-11 16:24:25 -07:00
Joel Dice
5a76277b84 remove dead buddies from values so they don't accumulate without bound; when resolving sites, avoid picking those which belong to other values; various bugfixes 2009-01-11 15:53:51 -07:00
Joel Dice
e3976e66d3 avoid using all registers when marshalling sites, since we need at least one register free for memory-to-memory moves; various bugfixes 2009-01-11 11:48:02 -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
8459489212 avoid overflow in sitesToString 2009-01-04 15:58:05 -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
c56f37197c marshal values at branches to avoid duplication of effort at junctions 2009-01-04 14:52:46 -07:00
Joel Dice
f4689093ee try harder to find an acceptable source site in resolveSourceJunctionSites 2009-01-04 13:35:09 -07:00
Joel Dice
ce1e161f52 allocate larger buffer for sitesToString 2009-01-04 12:38:31 -07:00
Joel Dice
095e6d7bc3 prefer unowned resources in resourceCost 2009-01-04 12:34:38 -07:00
Joel Dice
d76b4121ae fix 64-bit constant case in addCR and subtractCR 2009-01-04 12:32:11 -07:00
Joel Dice
ded2ffe437 more compile.cpp refactoring 2009-01-03 18:17:51 -07:00
Joel Dice
ae24a6c18e continue refactoring compiler.cpp to simplify register and frame resource allocation 2009-01-03 14:34:45 -07:00
Joel Dice
7b546936d6 snapshot 2009-01-02 17:44:47 -07:00
Joel Dice
c678fb30a4 snapshot 2008-12-24 13:35:43 -07:00
Joel Dice
f96ee3ea73 handle p->value->reads == 0 case in visit 2008-12-22 18:25:00 -07:00
Joel Dice
897586aa76 clobber overlapping locals in storeLocal; move fallback code in trySteal to increase its applicability 2008-12-22 17:55:29 -07:00
Joel Dice
ac37941fa5 fix build error in previous commit 2008-12-21 18:14:24 -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
c78e76c747 temporarily reacquire source in releaseRegister
This avoids a SEGV when freezing the register.
2008-12-21 14:48:26 -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
b23f7374e9 don't steal sites in pickJunctionSite 2008-12-20 17:45:52 -07:00
Joel Dice
b9b7ae4003 avoid clobbering first operand in CombineEvent.compile 2008-12-20 16:05:01 -07:00
Joel Dice
cf4e8e7ec2 various fixes for marshalling values among registers and frame sites 2008-12-20 14:55:45 -07:00
Joel Dice
75b3bf98ab pick only unfrozen frame sites in save 2008-12-20 11:13:58 -07:00
Joel Dice
bd89b8e00a check for null array in HashMapIterator::find 2008-12-18 20:23:08 -07:00
Joel Dice
2622773eb4 support bootimage build on OS X 2008-12-18 19:52:03 -07:00
Joel Dice
e55b59905e Merge branch 'master' of oss.readytalk.com:/var/local/git/avian 2008-12-18 16:32:23 -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
7ce35b212f fix GCC 4.0.1 uninitialized value warning 2008-12-18 10:10:19 -07:00
Joel Dice
a40ae85588 clear sites from dead value in removeBuddy 2008-12-15 18:21:01 -07:00
Joel Dice
8819d01522 only set Context::forfeitedSite if value is live 2008-12-15 17:42:32 -07:00
Joel Dice
39358e6652 update junction read based on liveness of local value on first visit to junction, not stub read value 2008-12-15 07:35:19 -07:00
Joel Dice
7f4bd51464 don't use trySteal when moving sites between buddies 2008-12-13 13:54:26 -07:00
Joel Dice
4717e94fa3 remove value buddies after setting sites to junction sites, not after populating junction sites
This mirrors how snapshots are captured and restored for branch events.
Also, switch back to resolving junction sites before capturing fork
snapshots so we capture the true state of each value immediately before
the branch.
2008-12-13 12:59:02 -07:00
Joel Dice
d50febe088 various control-flow related bugfixes 2008-12-11 18:09:36 -07:00
Joel Dice
8b2a6f85fc remove divideCR and remainderCR
This forces the compiler to explicitly move the constant operand into
a register, avoiding the possibility that AX or DX might be unavailable
when the assembler needs them.
2008-12-11 18:08:16 -07:00
Joel Dice
aa7b47eec4 fix merge confict fallout in heapdump.cpp 2008-12-04 14:35:25 -07:00
Joel Dice
7d68c9b0a5 Merge branch 'bootimage' of oss.readytalk.com:/var/local/git/avian
Conflicts:

	src/heapdump.cpp
2008-12-04 14:29:17 -07:00
Joel Dice
58a90f2b84 fix regressions for non-bootimage case 2008-12-03 19:09:57 -07:00
Joel Dice
93d4fbc43d fix platform=windows and process=interpret builds 2008-12-03 08:44:07 -07:00
Joel Dice
457c3d135e return Tenured from MyHeap::status if the object resides in the immortal heap 2008-12-02 19:41:22 -07:00
Joel Dice
4098368cb9 fix non-debug build of compile.cpp 2008-12-02 19:39:56 -07:00
Joel Dice
851efc8d10 handle case of unresolved promise in compareCR and compareCM 2008-12-02 19:39:09 -07:00
Joel Dice
bcfdc03631 fix build breakage in heapdump.cpp 2008-12-02 19:38:32 -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
Rich Scott
f13bf44e87 Check return value of fwrite() calls.
This is to satisfy GCC 4.3.2 (on Ubuntu 8.10), which requires it.
2008-12-01 16:53:34 -07:00
Joel Dice
eaf30eb909 fix static class initialization when using a boot image 2008-11-29 21:58:09 -07:00
Joel Dice
e44f326377 various bugfixes 2008-11-29 18:39:42 -07:00
Joel Dice
0ec5ad3701 update makefile to optionally build and use a boot image; various bugfixes 2008-11-29 16:08:14 -07:00
Joel Dice
0ef2ee1d02 refactor Segment::Map to support map data which is not allocated as part of the segment data 2008-11-29 13:37:03 -07:00
Joel Dice
702525fd32 support immortal heap area in heap.cpp 2008-11-28 19:31:06 -07:00
Joel Dice
b8056d905c fix bugs in allocating and populating method object pools 2008-11-28 18:23:01 -07:00
Joel Dice
80815d35f7 fix fixed object tracking in heap.cpp 2008-11-28 18:22:09 -07:00
Joel Dice
4d1af63ed2 initial work on booting from boot image 2008-11-28 15:02:45 -07:00
Joel Dice
d22a9ab270 visit constants in visitRoots so they are included in the final heap image 2008-11-28 11:33:11 -07:00
Joel Dice
02afbd1fa1 handle unresolved constants in moveCM 2008-11-27 21:58:32 -07:00
Joel Dice
6dc181fad5 move allocation zone from makeCodeImage to writeBootImage so it stays in scope until after updateConstants is called 2008-11-27 21:58:04 -07:00
Joel Dice
a8a030140c various bugfixes 2008-11-27 21:44:04 -07:00
Joel Dice
f698c24ea6 delay resolving method call offsets until all methods have been compiled when creating a boot image 2008-11-27 13:59:40 -07:00
Joel Dice
264779ed2a copy site if necessary to avoid chaining to another site in resolveJunctionSite 2008-11-25 19:23:47 -07:00
Joel Dice
f9145528c8 do constant-to-memory movq in one instruction on amd64 when possible 2008-11-25 19:22:21 -07:00
Joel Dice
61ecb56e21 Merge branch 'master' of oss:/var/local/git/avian into powerpc 2008-11-25 16:19:21 -07:00
Joel Dice
fdb9c05ac6 avoid uninitialized value warnings from valgrind when DebugFrameMaps is true 2008-11-25 16:01:30 -07:00
Joel Dice
58a9718d82 clean stack sites more aggressively after function calls to avoid GC bugs 2008-11-25 16:00:40 -07:00
Joel Dice
eea2225176 save locals to memory before executing any instruction which might trigger an exception if that instruction lies within an exception handler 2008-11-25 10:34:48 -07:00
Joel Dice
035aa0ecd4 Merge branch 'master' of oss.readytalk.com:/var/local/git/avian into bootimage
Conflicts:

	src/compile.cpp
	src/machine.h
	src/util.h
2008-11-23 17:02:34 -07:00
Joel Dice
20cf42c5e4 more work on boot image creation 2008-11-23 16:58:01 -07:00
Joel Dice
207f093464 never trigger a GC due to an immortal allocation 2008-11-23 11:48:39 -07:00
Joel Dice
fb9b2bf173 avoid creating garbage when iterating over hashmaps 2008-11-22 16:38:41 -07:00
Joel Dice
4392b04fd0 avoid creating unecessary garbage in treeInsertNode and friends 2008-11-22 16:25:35 -07:00
Joel Dice
6162dfafbb increase heap pool size and fixed footprint threshold constants based on performance profiling and experimentation (second try) 2008-11-22 14:48:10 -07:00
Joel Dice
8a7852172e increase heap pool size and fixed footprint threshold constants based on performance profiling and experimentation 2008-11-22 14:47:18 -07:00
Joel Dice
2e2925c321 fix backwards logic in treeMapInsert which prevented correct balancing 2008-11-22 14:14:52 -07:00
Joel Dice
6500f1eff6 initial work to support boot image creation and use 2008-11-21 16:20:35 -07:00
Joel Dice
e98da8440e minor tweak to find function in heapdump.cpp to return 0 where we were returning false (which amounts to the same thing but is less confusing) 2008-11-19 18:09:02 -07:00
Joel Dice
3d9e508e3e fix regression in last commit 2008-11-17 08:44:35 -07:00
Joel Dice
9aee242408 Merge branch 'powerpc' of oss:/var/local/git/avian into powerpc
Conflicts:

	src/compiler.cpp
2008-11-17 08:22:07 -07:00
Joel Dice
7ea5a4a64f avoid inifinite recursion in trySteal 2008-11-17 08:20:48 -07:00
Joel Dice
92a8a4d83b clean up subroutine code in wake of merge from master branch 2008-11-15 18:03:43 -07:00
Joel Dice
9b6d4fdeab Merge branch 'master' of oss.readytalk.com:/var/local/git/avian into powerpc
Conflicts:

	src/compile.cpp
2008-11-15 17:49:08 -07:00
Joel Dice
dc2700d913 ensure that the saved exception in a finally block is visited during GC when the jsr instruction is used 2008-11-15 17:28:45 -07:00
Joel Dice
fb770d10fb implement jsr/ret support
The Subroutine test won't pass due to a bug in the stack mapping code
such that objects may be missed during GC.
2008-11-13 17:59:21 -07:00
Joel Dice
fae0ccfe96 fix unused parameter warnings 2008-11-11 18:09:45 -07:00
Joel Dice
6f5613ebd9 minor code cleanup in MoveEvent::compile 2008-11-11 17:48:21 -07:00
Joel Dice
191bfb6141 fix 4-to-8 byte sign extensions for ia32 and clean up MoveEvent; all tests now pass on ia32 2008-11-11 17:39:26 -07:00
Joel Dice
acfd9689b2 Merge branch 'master' of oss:/var/local/git/avian into powerpc
Conflicts:

	makefile
	src/assembler.h
	src/compile.cpp
	src/compiler.cpp
	src/compiler.h
	src/finder.cpp
2008-11-11 12:15:19 -07:00
Joel Dice
e859502811 handle unresolved constants in moveCM 2008-11-11 11:56:43 -07:00
Joel Dice
671fd1c0f9 set popIndex for stack arguments in CallEvent constructor 2008-11-11 11:56:23 -07:00
Joel Dice
0bef625500 fix thinko in logCompile 2008-11-11 09:17:11 -07:00
Joel Dice
c80eb51c17 Merge branch 'master' into powerpc
Conflicts:

	makefile
	src/assembler.h
	src/compile.cpp
	src/compiler.cpp
	src/compiler.h
	src/finder.cpp
2008-11-11 08:21:48 -07:00
Joel Dice
2304a656cf in releaseRegister, if the register is not the exclusive site of a value, steal it 2008-11-10 21:25:36 -07:00
Joel Dice
54cda3ca61 specify register contraints for Negate instruction in MyArchitecture::plan 2008-11-10 20:23:33 -07:00
Joel Dice
96a7c71c30 fix loading 8-byte values on 32-bit systems 2008-11-10 19:12:36 -07:00
Joel Dice
81d532c4f0 handle overlap cases in moveRR 2008-11-10 19:11:32 -07:00
Joel Dice
5fc9ad058b more bugfixes; all tests pass on amd64 2008-11-10 17:07:44 -07:00
Joel Dice
00d8142de9 various bugfixes; all but one test are passing on amd64 2008-11-09 16:56:37 -07:00
Joel Dice
000aeb25c1 handle case where first instruction is the target of a branch properly 2008-11-08 16:21:30 -07:00
Joel Dice
decd24965a implement multiplyCR and divideCR 2008-11-08 15:42:26 -07:00
Joel Dice
61539bae31 fix stack mapping bugs which broke GC 2008-11-08 15:36:38 -07:00
Joel Dice
312539af64 fix moves involving sign or zero extension 2008-11-08 13:47:26 -07:00
Joel Dice
f01f4441d9 various bugfixes and instructions implemented to get more tests passing 2008-11-06 17:39:38 -07:00
Joel Dice
1ba497d90a fix Exceptions test for amd64 2008-11-02 15:25:51 -07:00
Joel Dice
04da77e95b snapshot 2008-11-02 13:35:35 -07:00
Joel Dice
3e81405a33 snapshot 2008-11-01 16:16:18 -06:00
Joel Dice
dd4dc18916 snapshot 2008-11-01 13:14:13 -06:00
Joel Dice
6f1d02dae7 remove the libstdc++ dependency once and for all
The trick is to make all destructors non-virtual.  This is safe because
we never use the delete operator, which is the only case where virtual
destructors are relevant.  This is a better solution than implementing
our own delete operator, because we want libraries loaded at runtime to
use the libstdc++ version, not ours.
2008-10-28 15:40:50 -06:00
Joel Dice
88a1faa2a2 set global system pointer to null in MySystem::dispose in windows.cpp 2008-10-28 12:15:27 -06:00
Joel Dice
01cc868797 remove debug code from builtin.cpp 2008-10-27 15:39:14 -06:00
Joel Dice
4d613f404f use dbghelp.dll to generate crash dump file on Windows XP and later
The dump is written to the directory specified via the avian.crash.dir
system property if that property is set and is not written otherwise.
2008-10-27 15:13:27 -06:00
Joel Dice
d20ee74d79 fix stack frame offset calculations for 64-bit values; insert dummy events for instructions which start with stack activity 2008-10-24 20:12:02 -06:00
Joel Dice
003afdc918 fix heap dump facility to visit all roots 2008-10-24 18:48:10 -06:00
Joel Dice
3b67417695 heap dump bugfixes 2008-10-22 18:05:34 -06:00