Commit Graph

1755 Commits

Author SHA1 Message Date
Joel Dice
99bb7924b0 fix stack frame mapping code for exception handlers
Previously, the stack frame mapping code (responsible for statically
calculating the map of GC roots for a method's stack frame during JIT
compilation) would assume that the map of GC roots on entry to an
exception handler is the same as on entry to the "try" block which the
handler is attached to.  Technically, this is true, but the algorithm
we use does not consider whether a local variable is still "live"
(i.e. will be read later) when calculating the map - only whether we
can expect to find a reference there via normal (non-exceptional)
control flow.  This can backfire if, within a "try" block, the stack
location which held an object reference on entry to the block gets
overwritten with a non-reference (i.e. a primitive).  If an exception
is later thrown from such a block, we might end up trying to treat
that non-reference as a reference during GC, which will crash the VM.

The ideal way to fix this is to calculate the true interval for which
each value is live and use that to produce the stack frame maps.  This
would provide the added benefit of ensuring that the garbage collector
does not visit references which, although still present on the stack,
will not be used again.

However, this commit uses the less invasive strategy of ANDing
together the root maps at each GC point within a "try" block and using
the result as the map on entry to the corresponding exception
handler(s).  This should give us safe, if not optimal, results.  Later
on, we can refine it as described above.
2010-02-04 18:03:32 -07:00
Joel Dice
c9b9db1621 reimplement Java object monitors (second try)
See commit 8120bee4dc for the original
problem description and solution.  That commit and a couple of related
ones had to be reverted when we found they had introduced GC-safety
regressions leading to crashes.

This commit restores the reverted code and fixes the regressions.
2010-02-04 17:56:21 -07:00
Joel Dice
48834be209 revert recent commits to reimplement Java object monitors
We're seeing race conditions which occasionally lead to assertion
failures and thus crashes, so I'm reverting these changes for now:

29309fb414
e92674cb73
8120bee4dc
2010-02-04 08:18:39 -07:00
Joel Dice
29309fb414 update Thread field offsets to reflect recent additions
Every time we add or remove fields to Thread, we need to update the
assembly code to reflect the new offsets.
2010-02-02 12:26:09 -07:00
Joel Dice
e92674cb73 fix race condition in monitorWait
We don't want to check Thread::waiting until we have re-acquired the
monitor, since another thread might notify us between releasing
Thread::lock and acquiring the monitor.
2010-02-02 12:24:05 -07:00
Joel Dice
3bc37d6e2a fix encoding of single byte register-to-memory moves on x86_64
We need to prefix instructions of the form "mov R,M" with a REX byte
when R is %spl, %bpl, %sil, or %dil.  Such moves are unencodable on
32-bit x86, and, because of the order in which we pick registers,
pretty rare on 64-bit systems, which is why this took so long to
notice.
2010-02-02 11:37:08 -07:00
Joel Dice
8120bee4dc reimplement Java object monitors to avoid running out of OS handles
Due to SWT's nasty habit of creating a new object monitor for every
task added to Display.asyncExec, we've found that, on Windows at
least, we tend to run out of OS handles due to the large number of
mutexes we create between garbage collections.

One way to address this might be to trigger a GC when either the
number of monitors created since the last GC exceeds a certain number
or when the total number of monitors in the VM reaches a certain
number.  Both of these risk hurting performance, especially if they
force major collections which would otherwise be infrequent.  Also,
it's hard to know what the values of such thresholds should be on a
given system.

Instead, we reimplement Java monitors using atomic compare-and-swap
(CAS) and thread-specific native locks for blocking in the case of
contention.  This way, we can create an arbitrary number of monitors
without creating any new native locks.  The total number of native
locks needed by the VM is bounded instead by the number of live
threads plus a small constant.

Note that if we ever add support for an architecture which does not
support CAS, we'll need to provide a fallback monitor implementation.
2010-02-01 18:40:47 -07:00
Joel Dice
45476eb591 fix handling of volatile longs and doubles on PowerPC
We were miscompiling methods which contained getfield, getstatic,
putfield, or putstatic instructions for volatile 64-bit primitives on
32-bit PowerPC due to not noticing that values in registers are clobbered
across function calls.

The solution is to create a separate Compiler::Operand instance for each
object monitor reference before and after the function call to avoid
confusing the compiler.  To avoid duplicate entries in the constant pool,
we add code look for and, if found, reuse any existing entry for the same
constant.
2010-01-27 17:46:04 -07:00
jet
ea4b4bfcbf Merge branch 'wip' of oss.readytalk.com:/var/local/git/avian into wip 2010-01-06 10:57:55 -07:00
Joel Dice
3686d2131d fix jsr/ret code generation bug
We were generating code to marshal values into place prior to a jump,
but placing it after the jump instruction, which made it useless.
2010-01-04 17:17:16 -07:00
Joel Dice
20f92bbd05 specify java.home system property in GNU Classpath build
Currently, we just set this to /tmp (or the equivalent) since Avian
doesn't really have a home.  This avoids a NullPointerException from
javax/xml/parsers/SAXParserFactory.
2010-01-04 17:14:00 -07:00
jet
8c8020811a Merge branch 'wip' of oss.readytalk.com:/var/local/git/avian into wip 2009-12-28 11:14:26 -07:00
Joel Dice
664cb3cd39 don't try to parse annotation tables more than once; use defining classloader when loading array classes during linking 2009-12-24 17:58:48 -07:00
Joel Dice
805d1d13d8 mark system classloader initialized when using GNU Classpath to avoid security exceptions; only look for field in interfaces after looking in class and superclasses 2009-12-24 17:57:07 -07:00
Joel Dice
40c65f66bf add (commented-out) debug logging to gnu.cpp 2009-12-24 17:54:02 -07:00
Joel Dice
7b2322e7f7 accept any source site in resolveTargetSites, whether it matches the next read or not 2009-12-24 17:47:58 -07:00
jet
77990b9489 Merge branch 'wip' of oss.readytalk.com:/var/local/git/avian into wip 2009-12-23 09:26:17 -07:00
Joel Dice
f588a62ae3 fix Classpath 0.98 compatibility issues 2009-12-22 21:34:04 -07:00
Joel Dice
30db38ebd6 replace calls to ExceptionOccurred with calls to ExceptionCheck
The latter is cheaper (avoids a state transition and possible memory
allocation) when we just want to know if an exception is thrown
without needing a handle to that exception.
2009-12-16 19:25:03 -07:00
Joel Dice
4c0ede8b9a reuse JNI references when possible
Before allocating a new reference in NewGlobalReference or when
creating a local reference, we look for a previously-allocated
reference pointing to the same object.  This is a linear search, but
usually the number of elements in the reference list is small, whereas
the memory, locking, and allocation overhead of creating duplicate
references can be large.
2009-12-16 19:16:51 -07:00
Joel Dice
7cf25a0fc3 fix process=interpret build 2009-12-14 18:01:28 -07:00
Joel Dice
d5f5c2351b use _ReadWriteBarrier intrinsic for MSVC build 2009-12-12 18:50:59 -07:00
Joel Dice
2b4361c060 fix GNU Classpath build 2009-12-05 19:40:46 -07:00
Joel Dice
b6ac05ba9d remove unecessary code from resolveSourceSites and resolveTargetSites 2009-12-05 15:49:53 -07:00
jent
4cf9e16897 Merge branch 'master' of oss.readytalk.com:/var/local/git/avian 2009-12-04 12:02:06 -07:00
jent
99a1c12682 Files to add Deflater and DeflaterOutputStream to java.util.zip for
avian
2009-12-04 12:01:31 -07:00
Joel Dice
0e4fabffb7 fix incorrect parameter to maybeRex call in sseMoveRR 2009-12-03 17:57:28 -07:00
Joel Dice
60333c88f5 fix continuations=true build for Windows x86_64 2009-12-03 12:46:29 -07:00
Joel Dice
7cdf63c045 fix continuations=true build for Darwin 2009-12-02 23:15:27 -07:00
Joel Dice
f0e66eea37 remove extra semicolon 2009-12-02 23:09:05 -07:00
Joel Dice
7a3bf85caf fix bootimage=true build for Windows 2009-12-02 20:08:07 -07:00
Joel Dice
b218117881 fix continuations=true build for Cygwin 2009-12-02 19:37:22 -07:00
Joel Dice
8b11f0c271 fix continuations=true build for Windows 2009-12-02 19:29:57 -07:00
Joel Dice
6118792ffd update copyright years 2009-12-02 19:08:29 -07:00
jet
e516f3ce1c Merge branch 'wip' of oss.readytalk.com:/var/local/git/avian into wip 2009-12-02 13:45:21 -07:00
Joel Dice
3777c9b429 fix MSVC build 2009-12-02 08:49:10 -07:00
Joel Dice
5a0e00ca39 GC safety bugfix 2009-12-01 22:41:12 -07:00
Joel Dice
80d3a286d1 check bootThunkTable as well as thunkTable in MyProcessor::getStackTrace
We need to check to see if we caught the thread somewhere in the thunk
code (i.e. about to call a helper function), in which case the stack
and base pointers are valid and may be used to create an accurate
trace.
2009-12-01 18:17:33 -07:00
Joel Dice
168e206812 fix GCC 3.4 build 2009-12-01 17:33:30 -07:00
Joel Dice
f216fe37ff fix regression which led to register exhaustion 2009-12-01 11:14:57 -07:00
Joel Dice
98275e175e powerpc bugfixes 2009-12-01 09:21:33 -07:00
Joel Dice
9ba71cf508 fix Darwin build 2009-12-01 08:23:11 -07:00
Joel Dice
0bdf1d8e82 use thunks for floating point ops if SSE is not available 2009-11-30 22:02:26 -07:00
Joel Dice
175cb8e89b more floating point bugfixes 2009-12-01 02:06:01 +00:00
Joel Dice
7fa10909f4 more bugfixes for handling 64-bit floats on 32-bit systems 2009-11-30 22:08:59 +00:00
jet
69c9bf5ff9 Merge branch 'wip' of oss.readytalk.com:/var/local/git/avian into wip 2009-11-30 14:00:51 -07:00
Joel Dice
851187f0ce refine memory barrier implementation and usage 2009-11-30 15:38:16 +00:00
Joel Dice
04454960ec various bugfixes for handling 64-bit floating point values on 32-bit systems 2009-11-30 15:10:34 +00:00
Joel Dice
d9de4c607c allow source operand of any type for move operations 2009-11-30 15:09:43 +00:00
Joel Dice
ec701b9994 whitespace tweaks 2009-11-30 15:08:45 +00:00
Joel Dice
79d281f7fa encourage loads from memory directly into SSE registers where appropriate 2009-11-30 02:17:08 +00:00
Joel Dice
1c61c1f421 fix x86 memoryBarrier implementation 2009-11-29 16:53:46 -07:00
Joel Dice
0b09c6aa30 avoid busy wait when entering "exclusive" state 2009-11-29 16:53:05 -07:00
Joel Dice
6d9e1270ca fix race conditions in atomic operations 2009-11-29 09:08:07 -07:00
Joel Dice
1558b85acf second attempt to fix "idle to active" fast path
If another thread succeeds in entering the "exclusive" state while we
use the fast path to transition the current thread to "active", we
must switch back to "idle" temporarily to allow the exclusive thread a
chance to continue, and then retry the transition to "active" via the
slow path.
2009-11-28 15:35:15 -07:00
Joel Dice
3418a8bcbe fix race condition introduced in previous commit 2009-11-28 15:24:02 -07:00
Joel Dice
75934c8342 provide fast paths for common thread state transitions
These paths reduce contention among threads by using atomic operations
and memory barriers instead of mutexes where possible.  This is
especially important for JNI calls, since each such call involves two
state transitions: from "active" to "idle" and back.
2009-11-28 15:01:54 -07:00
Joel Dice
f5490b800a Merge branch 'master' of oss.readytalk.com:/var/local/git/avian 2009-11-28 11:18:13 -07:00
Joel Dice
c615db31fb refine move cost calculation to avoid indirect moves (e.g. memory to memory) 2009-11-28 18:17:17 +00:00
Joel Dice
5ead8fab17 refactor code responsible for moving data in the compiler
This is partially to address incorrect code generation for 64-bit
floating-point values on x86_32 and partially to reduce unnecessary
moves.
2009-11-27 21:15:12 -07:00
Joel Dice
bd72745ff9 fix off-by-one error in intrinsic() 2009-11-27 21:01:27 -07:00
Joel Dice
f6a52e260b specify CONTEXT::ContextFlags before calling GetThreadContext
Previously, we assumed that the "context" parameter to
GetThreadContext was only an output parameter, but it actually uses at
the value of CONTEXT::ContextFlags on entry to decide what parts of
the structure to fill in.  We were getting lucking most of the time,
because whatever garbage was on the stack at that location had the
necessary bits set.  When we weren't so lucky, we got all zeros for
the register values which sometimes lead to a crash depending on the
state of the thread being examined.
2009-11-24 19:16:22 -07:00
Joel Dice
9f14d63592 initialize MyProcessor::getStackTrace::Visitor::trace in case visit is never called 2009-11-24 19:15:27 -07:00
Stan
728a6ba706 use MapViewOfFile instead of mmap on Windows 2009-11-24 08:24:37 -07:00
jet
993d210232 Merge branch 'wip' of oss.readytalk.com:/var/local/git/avian into wip 2009-11-23 10:04:16 -07:00
Joel Dice
a0d763d871 use cmpxchgq for 64-bit operands in atomicCompareAndSwap 2009-11-20 15:17:35 -07:00
Joel Dice
2276eece0e support atomicCompareAndSwap on powerpc for GCC versions prior to 4.1 2009-11-20 15:14:27 -07:00
Joel Dice
b83314e884 fix powerpc build 2009-11-20 10:42:02 -07:00
Joel Dice
15eada93ed implement atomicCompareAndSwap on x86_32 for GCC versions prior to 4.1 and for MSVC 2009-11-20 10:40:01 -07:00
Joel Dice
e91157a390 avoid acquiring a mutex recursively in markDirty 2009-11-19 19:41:49 -07:00
Joel Dice
5f5cc57d12 only use atomic operations if the compiler supports them 2009-11-19 19:32:54 -07:00
Joel Dice
fdde34694c use atomic operations in MyHeap::mark to avoid need for mutex 2009-11-19 18:13:00 -07:00
Joel Dice
c711ac5701 return null from NewString[UTF] if the char* parameter is null 2009-11-18 11:01:47 -07:00
jet
2f54eb5e55 Merge branch 'wip' of oss.readytalk.com:/var/local/git/avian into wip 2009-11-05 11:16:58 -07:00
Joel Dice
5b8a7ca566 temporarily disable use of SSE on 32-bit systems until a bug involving memory<->SSE-register moves is fixed 2009-11-04 15:16:06 +00:00
Joel Dice
fb5796b740 don't use SSE for long-to-double conversion on 32-bit systems 2009-11-04 00:02:38 +00:00
Joel Dice
82d2be8e71 implement JavaVM::AttachCurrentThreadAsDaemon 2009-11-03 14:52:14 -07:00
Joel Dice
4566e7a7dd avoid infinite loop in deadWord 2009-11-03 14:14:27 -07:00
jet
ad379e1b20 Merge branch 'wip' of oss.readytalk.com:/var/local/git/avian into wip 2009-11-03 11:50:21 -07:00
Joel Dice
ed4206b06d fix order-of-operations bug in compile loop
The code was capturing branch snapshots too early - before the call to
populateSources which might perform further moves.
2009-11-02 21:11:39 -07:00
jet
50dae3067d modified binaryToObject to support ARM 2009-10-30 15:04:15 -06:00
Joel Dice
e825da60aa update continuation constants to reflect new field offsets 2009-10-30 00:45:46 +00:00
jet
d901653979 Merge branch 'master' into wip
Conflicts:

	src/compile.cpp
2009-10-29 14:23:20 -06:00
jet
d3d228e69b moduloInt + arm work 2009-10-29 14:14:44 -06:00
jet
e00fc5d91a ARM port work 2009-10-29 10:12:30 -06:00
Joel Dice
3c893b2ee3 Merge commit 'origin/master' into wip 2009-10-27 10:36:19 -06:00
Joel Dice
1fd00dd55d revert all __attribute__ ((externally_visible)) changes because it's not clear yet how to detect whether it's supported 2009-10-27 10:35:26 -06:00
Joel Dice
e3b21e80ba Merge commit 'origin/master' into wip 2009-10-27 09:41:20 -06:00
Joel Dice
f57d80f1b7 ammend recent commit to avoid using __attribute__ ((externally_visible)) when it is not available (second try) 2009-10-27 09:41:00 -06:00
Joel Dice
8bf3487ff1 Merge commit 'origin/master' into wip 2009-10-27 09:35:13 -06:00
Joel Dice
51fcf1ef74 ammend recent commit to avoid using __attribute__ ((externally_visible)) when it is not available 2009-10-27 09:34:46 -06:00
Joel Dice
2efff818ea Merge commit 'origin/master' into wip 2009-10-27 09:17:54 -06:00
Joel Dice
4570b86da0 add __attribute__ ((externally_visible)) to EXPORT macros to facilitate whole-program optimization using GCC 4.5 2009-10-27 09:16:08 -06:00
Joel Dice
c8d5c1faed visit all frame locations in resolveOriginalSites
Previously, we only visited frame locations containing values, but
this invited the possibility of reusing the same site for two
locations in some cases.
2009-10-26 17:59:20 -06:00
Joel Dice
3b4be3decd defer to helper thunk for frem and drem 2009-10-24 19:29:20 -06:00
Joel Dice
95c3f37bfb fix various bugs involving doubles on 32-bit systems 2009-10-24 17:18:56 -06:00
Joel Dice
064ad572bc use truncation, not rounding in float2Int instructions 2009-10-20 15:43:24 -06:00
Joel Dice
f27ecaa199 fix memcpy argument order in Avian_avian_Singleton_getLong 2009-10-20 13:38:05 -06:00
Joel Dice
e06f0407cb fix powerpc bootimage build (second try) 2009-10-20 09:06:52 -06:00
Joel Dice
c044781807 fix powerpc bootimage build 2009-10-20 08:20:49 -06:00
Joel Dice
984f3106fd fix powerpc build 2009-10-19 10:31:34 -06:00
Joel Dice
1a63b72b41 clean up float-vs.-int tracking in constant pools 2009-10-17 20:11:03 -06:00
Joel Dice
15020d77a6 refactor intrinsic support
This ensures that the low-level, architecture specific code need not
be aware of the semantics and names of Java methods.
2009-10-17 19:26:14 -06:00
Joel Dice
f702795178 fix integer truncation bug 2009-10-17 18:35:19 -06:00
Joel Dice
cec6444911 fix bootimage build for case where the JIT code area is too far from the AOT code area to do immediate-offset jumps between them 2009-10-17 18:18:03 -06:00
Joel Dice
963bfb3e3f avoid array bounds warnings from GCC 4.3
These warnings are due to GCC being smart enough to do interprocedural
constant propagation but not smart enough to avoid false positives in
all cases when looking for array bounds errors.
2009-10-17 18:09:54 -06:00
Joel Dice
7b0378c180 support darwin/x86_64 2009-10-14 10:01:37 -06:00
Joel Dice
ef4a8430ad add binaryToObject utility
We use this utility instead of objcopy to embed data into object files
because it offers more control over e.g. section alignment, which is
important for bootimage builds.
2009-10-13 19:00:16 -06:00
Joel Dice
87950e86b8 add missing parameter to native SystemClassLoader methods 2009-10-13 18:42:49 -06:00
Joel Dice
9fcdfaf7ff implement binaryToElf utility and use it instead of objcopy on Linux
This is necessary because objcopy does not currently allow us to
specify the alignment requirement for the .boot section used to store
the boot image for AOT builds.  This may be a problem for Windows as
well, in which case we'll need to add a binaryToPE utility.
2009-10-11 16:09:23 -06:00
Joel Dice
c65b106112 whitespace tweak in binaryToMacho.cpp 2009-10-11 16:06:09 -06:00
Joel Dice
b878b84d32 set DebugCompile to false in compile.cpp 2009-10-11 16:05:37 -06:00
Joel Dice
b4c1c6badf fix process=interpret build 2009-10-10 18:23:14 -06:00
Joel Dice
44a6620aa1 disable use of SSE when compiling ahead-of-time 2009-10-10 17:46:43 -06:00
Joel Dice
38bf29300f enable SSE<->GPR moves when size matches word size 2009-10-10 22:27:35 +00:00
Joel Dice
78d9e51b7e replace hasMoreThanOneSite with uniqueSite; rename Value fields
uniqueSite also checks, if applicable, to see if the second word of a
value shares the specified site with the first value as its sole site.

Also renamed a couple of fields in Value for clarity.
2009-10-10 16:07:30 -06:00
Joel Dice
622b3d1c4e replace compare and branch instructions with combined versions
This allows the assembler to see the operand types of the comparison
and the condition for jumping in the same operation, which is
essential for generating efficient code in cases such as
multiple-precision compare-and-branch.
2009-10-10 15:03:23 -06:00
Joel Dice
609a1a9633 snapshot 2009-10-07 00:50:32 +00:00
Joel Dice
23197da679 fix handling of subroutines in methods of return type long on 32-bit systems 2009-10-06 03:17:12 +00:00
Joel Dice
4f78783ef1 various bugfixes for SSE-based floating-point support 2009-10-05 14:25:12 +00:00
Joel Dice
d25da6116a snapshot 2009-10-04 22:10:36 +00:00
Joel Dice
5dad9bddd6 snapshot 2009-10-04 19:56:48 +00:00
Joel Dice
6cef085d7e snapshot 2009-09-26 19:43:44 +00:00
Joel Dice
325f93b4d1 Merge branch 'master' into wip
Conflicts:

	src/compile.cpp
	src/compiler.cpp
	src/machine.h
	src/x86.cpp
2009-09-20 15:43:32 -06:00
Joel Dice
953cb69e5e move proxy and annotation code from C++ to Java
This allows code shrinkers to remove it if it's not used by the application.
2009-09-19 16:21:15 -06:00
Joel Dice
1a2eb3836c Merge branch 'master' of oss.readytalk.com:/var/local/git/avian 2009-09-18 18:01:57 -06:00
Joel Dice
7aa906d97b support runtime-visible annotations and java.lang.reflect.Proxy 2009-09-18 18:01:54 -06:00
Joel Dice
d0f8889e27 fix GC safety bugs in parseMethodTable and makeArrayClass 2009-09-18 12:20:35 -06:00
Joel Dice
b645c284b5 fix memory leak in debug build 2009-09-17 21:36:52 -06:00
Joel Dice
fcc4ff93e0 remove debug logging 2009-09-17 21:22:47 -06:00
Joel Dice
1dfa421a6c fix argument mixup in Runtime.exit 2009-09-17 18:28:42 -06:00
Joel Dice
bf2b17cfa6 fix misspelled comment 2009-09-04 17:08:45 -06:00
Joel Dice
b0ba70866e fix incorrect line numbers in NPE traces 2009-09-04 15:09:40 -06:00
Joel Dice
e47c149fb1 fix misuse of FindFirstFile 2009-09-03 17:57:32 -06:00
Joel Dice
6519047342 fix bootimage build 2009-09-03 09:06:04 -06:00
Joel Dice
84ac2e417d follow reference pointer before using in in refrenceTargetUnreachable in case it points to a moved object 2009-09-01 18:32:21 -06:00
Joel Dice
6aff383ee1 ensure Heap::needsMark and Heap::mark work correctly during GC 2009-09-01 18:31:18 -06:00
Joel Dice
4f794f533e fix handling of reachable, moved weak references in postVisit 2009-09-01 17:23:30 -06:00
Joel Dice
49005f0746 fix name-clash regression in heapdump.cpp 2009-09-01 13:09:53 -06:00
Joel Dice
27f35bf239 fix heapdump build 2009-09-01 12:15:33 -06:00
Joel Dice
73dc058c14 implement StackTraceElement.getFileName properly 2009-08-27 16:28:44 -06:00
Joel Dice
1a0eef7e2d add support for building with MSVC on Windows 2009-08-26 18:26:44 -06:00
Joel Dice
4297fa04b3 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
Joel Dice
4536f13ee4 superficial reformatting of previous commit 2009-08-21 09:44:18 -06:00
Joel Dice
637a676fb0 fix MinGW 3.4 build 2009-08-21 09:37:49 -06:00
Joel Dice
a56c1d8765 fix GC-safety bug in resolveSpec 2009-08-20 12:37:03 -06:00
Joel Dice
6196f61938 clear Thread::javaThread before entering zombie state, since clearing it in Thread::dispose is too late - the reference may already be invalid since we don't visit GC roots for zombie threads 2009-08-20 08:49:01 -06:00
Joel Dice
c4b5ecec90 implement Runtime.addShutdownHook and Thread.setDaemon; avoid segfaults due to an application calling e.g. CallStaticBooleanMethod when it really meant CallStaticVoidMethod 2009-08-19 14:27:03 -06:00
Joel Dice
df3baeb83b handle null value properly in SetObjectArrayElement 2009-08-19 07:36:52 -06:00
Joel Dice
0a2e611baa handle case of null thread local in SegFaultHandler::handleSignal 2009-08-18 15:47:08 -06:00
Joel Dice
0eba1eeaf2 leave thread in JoinedState instead of ZombieState in DetachCurrentThread 2009-08-18 15:29:25 -06:00
Joel Dice
01dcb1661b don't resolve all constant pool entries in linkClass - just the field and method specs 2009-08-18 15:27:21 -06:00
Joel Dice
6449c8275a fix process=interpret build 2009-08-18 14:41:21 -06:00
Joel Dice
c4edabdc02 implement ClassLoader.resolveClass and ensure class is linked in e.g. Class.getMethods; minor bugfixes 2009-08-18 14:26:28 -06:00
Joel Dice
dae0842c95 Merge branch 'master' of oss.readytalk.com:/var/local/git/avian 2009-08-17 13:10:36 -06:00
Joel Dice
062f6968a1 only emit a crash dump for access violations 2009-08-14 15:58:19 -06:00
Joel Dice
7fcbf9d85c fix reading 2-byte UTF-8 constants 2009-08-14 08:52:31 -06:00
Joel Dice
3facd3f735 treat SoftReferences as WeakReferences; do vtable or interface table lookups as necessary in MyProcessor::invoke; various bugfixes 2009-08-13 09:17:05 -06:00
Joel Dice
b3a5823536 set JNIEnvVTable::NewWeakGlobalRef to NewGlobalRef since we don't yet have a weak version 2009-08-13 09:07:05 -06:00
Joel Dice
99e5e65bd8 implement sun.misc.Unsafe methods; set gnu.cpu.endian property 2009-08-13 09:05:37 -06:00
Joel Dice
42622d0d25 Merge branch 'master' of oss.readytalk.com:/var/local/git/avian 2009-08-12 19:41:05 -06:00
Joel Dice
bf48f1e297 set java.version property in Avian_gnu_classpath_VMSystemProperties_preInit; add empty Avian_java_lang_VMClassLoader_resolveClass implementation 2009-08-12 19:37:29 -06:00
Joel Dice
61cb8b3deb handle zero-length lookup tables in lookupswitch 2009-08-12 19:32:12 -06:00
Joel Dice
bc884b4669 Merge branch 'master' of oss.readytalk.com:/var/local/git/avian 2009-08-11 18:50:04 -06:00
Joel Dice
22ae42b712 look for a native method implementation using the fast calling convention (Avian_*) before one using the standard convention (Java_*) to avoid false positives late in the search path 2009-08-11 18:49:58 -06:00
Josh warner
78ea4d20e3 added loneMatch to improve register allocation 2009-08-11 13:46:51 -06:00
Josh warner
f29199a285 fixed several operand type errors that appeared on 64-bit platforms 2009-08-11 13:30:31 -06:00
Josh warner
711680a183 fixed powerpc compile errors 2009-08-11 13:29:00 -06:00
Josh warner
cd59222f53 fixed propegation of result sizes 2009-08-11 13:27:25 -06:00
Josh warner
32167168f8 fixed incorrect opSize bug for 64-bit platforms 2009-08-11 13:25:22 -06:00
Joel Dice
535a152e86 Merge branch 'master' of ../avian-old 2009-08-11 12:42:14 -06:00
Joel Dice
935329d7cf fix 32-bit shift case in unsignedShiftRightC 2009-08-11 12:36:25 -06:00
Joel Dice
db58097165 re-enable finalization 2009-08-11 10:04:41 -06:00
Joel Dice
24abc8acfe Merge branch 'master' of ../avian 2009-08-11 09:43:29 -06:00
Joel Dice
83b0a217e0 disable debug trap 2009-08-11 09:40:54 -06:00
Joel Dice
a8b333fdc6 define LD and LX unconditionally for __x86_64__ since they should be the same for Windows and POSIX 2009-08-11 09:31:00 -06:00
Joel Dice
8ac06d8a47 initialize classloader map if necessary in Avian_java_lang_ClassLoader_defineClass 2009-08-11 09:25:35 -06:00
Joel Dice
336e822ba9 remove debug logging 2009-08-11 09:23:38 -06:00
Joel Dice
b1014b24f9 specify java.specification.version in Avian_gnu_classpath_VMSystemProperties_preInit 2009-08-11 09:21:26 -06:00
Joel Dice
fb5b0570c3 replace slashes with dots in class name before passing it to ClassLoader.loadClass 2009-08-11 09:20:49 -06:00
Joel Dice
28b5c46a0b fix GC safety bug in makeNewGeneral 2009-08-10 17:35:44 -06:00
Josh warner
af4d82ef7e Merge branch 'master' of git://oss.readytalk.com/avian 2009-08-10 13:42:57 -06:00
Josh warner
9910e310cb fixed register reserve logic in pickTarget 2009-08-10 13:42:37 -06:00
Josh warner
1d3ef1fc43 Merge branch 'master' of git://oss.readytalk.com/avian, fixed problems that occured in broader testing
Conflicts:
	src/compile.cpp
	src/compiler.cpp
	src/powerpc.cpp
	src/x86.S
	src/x86.cpp
2009-08-10 13:20:23 -06:00
Joel Dice
001000364d add classloader parameter to functions which may directly or indirectly load classes; include methods inherited from interfaces (but not explicitly declared) in method tables and virtual tables of abstract classes 2009-08-10 07:56:16 -06:00
Joel Dice
54bb64cfb2 freeze sites for dead values in resolveOriginalSites
Previously, we simply removed the element from the sites array, but
this led to problems when the junction sites are shared among multiple
junctions such that the value at a given index is live at one junction
and dead at another.
2009-08-10 07:51:19 -06:00
Joel Dice
1a2deff97d Merge branch 'master' of oss.readytalk.com:/var/local/git/avian 2009-08-09 14:43:53 -06:00
Joel Dice
2f864ebea5 fix LLD definition for MinGW 4.4 2009-08-07 16:28:47 -06:00
Joel Dice
2da6980eb5 print intptr_t's as pointers in compareIpToMethodBounds to avoid printf compatibility issues 2009-08-07 16:27:24 -06:00
Joel Dice
012d548bbb fix sign extension from int to long on x86_64 2009-08-07 14:48:30 -06:00
jet
1ffe46a545 added ARM interpreted mode supported 2009-08-06 11:52:36 -06:00
Josh warner
f8bbc609e8 corrected debug messages 2009-08-06 10:32:00 -06:00
Josh warner
a2e639a2d2 added floating point support, split plan function 2009-08-06 10:26:22 -06:00
Josh warner
61bc729974 added floating point support, split plan method 2009-08-06 10:17:48 -06:00
Josh warner
53c0656ee7 added floating point support, split plan method 2009-08-06 10:14:31 -06:00
Josh warner
7483fa154d added floating point support, instrinsics support 2009-08-06 10:01:57 -06:00
Josh warner
c3a389429e split source function, update interface for floating point / instrinsic support 2009-08-06 08:54:23 -06:00
Josh warner
c042354ea0 added detectFeature function, used to detect sse in x86.cpp 2009-08-06 08:49:26 -06:00
Josh warner
5cc605b56d added floating point support. 2009-08-06 08:48:15 -06:00
Josh warner
c7a1a7af77 added floating point support, split plan function. 2009-08-06 08:44:15 -06:00
Joel Dice
0c36b7b3b6 change popDouble return type to double 2009-08-05 15:00:27 -06:00
Joel Dice
63fa0668ff avoid poor performance due to deeply-nested branches in MultiRead::intersect 2009-08-04 18:28:34 -06:00
Joel Dice
e9ee4a618c implement Avian_java_lang_VMClassLoader_defineClass 2009-08-04 18:27:04 -06:00
Joel Dice
d5f4811b43 check for exception after calling resolveClass in parseInterfaceTable 2009-08-04 08:50:04 -06:00
Joel Dice
f8bf83bfec fix recent regression in findInHierarchy 2009-08-04 08:42:16 -06:00
Joel Dice
aa6e3048b3 set os.arch property in Avian_gnu_classpath_VMSystemProperties_preInit 2009-08-03 16:18:41 -06:00
Joel Dice
9f2abd5d8a fix out-of-date JNI method implementations to reflect newer static field table layout 2009-08-03 16:18:16 -06:00
Joel Dice
cb563f76e1 check superinterfaces when looking up methods and fields 2009-08-03 16:16:41 -06:00
Joel Dice
4ae3a1267a remove unused method 2009-08-03 16:16:01 -06:00
Joel Dice
c3a8ca505c avoid function pointer cast warning from GCC 3.4 2009-08-03 10:56:43 -06:00
Joel Dice
ad0592df6f print class name properly when throwing NoSuchMethodError 2009-07-29 10:32:16 -06:00
Joel Dice
7060a5d4f0 clear Machine::byteArrayMap before generating boot image since it will not be used when the image is loaded 2009-07-28 17:22:07 -06:00
Joel Dice
1b8777aa6b free correct object in Context::dispose 2009-07-28 17:20:23 -06:00
Joel Dice
7b183e8f4e don't run Java finalizers when exiting the VM 2009-07-28 16:58:01 -06:00
Joel Dice
14e73560bb fix order of operations in vmJump 2009-07-27 18:09:25 -06:00
Joel Dice
ad66ae2691 disable debug logging 2009-07-27 18:09:12 -06:00
Joel Dice
0447d9bed3 use __MINGW32__ instead of __WINDOWS__ in x86.cpp and assume Linux if it's not defined 2009-07-27 07:49:54 -06:00
Joel Dice
27d863790c Merge branch 'win64' into gnu
Conflicts:

	makefile
	src/compile-x86.S
	src/x86.S
	src/x86.cpp
2009-07-25 20:48:36 -06:00
Joel Dice
f869e5be21 Merge branch 'master' into gnu
Conflicts:

	classpath/java/util/TreeSet.java
2009-07-25 18:38:57 -06:00
Joel Dice
d3a249a3fa Merge branch 'master' of oss.readytalk.com:/var/local/git/avian 2009-07-25 18:36:27 -06:00
Joel Dice
08e9a99cb5 don't abort if pthread_kill fails in MySystem::visit 2009-07-24 19:03:33 -06:00
Joel Dice
cc3289d88a call pthread_kill unconditionally in Thread::interrupt() to ensure system calls such as epoll_wait are interrupted 2009-07-23 16:17:52 -06:00
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