Commit Graph

90 Commits

Author SHA1 Message Date
Joel Dice
999e90c332 fix MSVC build 2012-02-16 18:22:11 -07:00
Joel Dice
21d1a6c883 add __attribute__ ((used)) to EXPORT macro definition
This ensures that exported functions are not stripped when using the
-dead_strip option to the Apple linker.
2011-09-22 16:57:44 -06:00
Joel Dice
349d381d95 progress towards cross-endian bootimage builds
This fixes a number of bugs concerning cross-architecture bootimage
builds involving diffent endianesses.  There will be more work to do
before it works.
2011-09-16 20:53:08 -06:00
Joel Dice
e505cbe99d more progress towards cross-architecture bootimage builds
This commit fixes a lot of bugs.  All tests are now pass for Linux
x86_64 to Linux i386 cross builds.
2011-08-31 21:18:00 -06:00
Joel Dice
e3662f13a9 update copyright years and increment version number 2011-07-13 08:25:21 -06:00
Joel Dice
ed8a72af9e fix MSVC build 2011-04-10 12:55:12 -06:00
Joel Dice
78790a0f68 fix OpenJDK JCE support
This primarily required additions to classpath-openjdk.cpp to
intercept ZipFile, ZipEntry, and JarFile native methods to consult
embedded encryption policy jars when required.
2011-03-04 16:55:31 -07:00
Joel Dice
9e1ee7e974 enable Linux PowerPC build 2011-02-26 12:45:22 -07:00
Joel Dice
468edb97d2 work around GCC name mangling bug
It seems that older versions of GCC (4.0 and older, at least) generate
assembly files with duplicate symbols for function templates which
differ only by the attributes of the templated types.  Newer versions
have no such problem, but we need to support both, hence the
workaround in this commit of using a dedicated, non-template "alias"
function where we previously used "cast<alias_t>".
2011-02-14 11:47:59 -07:00
Joel Dice
8d50d0fd76 fix aliasing bug in util.cpp
We use a template function called "cast" to get raw access to fields
in in the VM.  In particular, we use this function in util.cpp to
treat reference fields as intptr_t fields so we can use the least
significant bit as the red/black flag in red/black tree nodes.
Unfortunately, this runs afoul of the type aliasing rules in C/C++,
and the compiler is permitted to optimize in a way that assumes such
aliasing cannot occur.  Such optimization caused all the nodes in the
tree to be black, leading to extremely unbalanced trees and thus slow
performance.

The fix in this case is to use the __may_alias__ attribute to tell the
compiler we're doing something devious.  I've also used this technique
to avoid other potential aliasing problems.  There may be others
lurking, so a complete audit of the VM might be a good idea.
2011-02-11 21:57:27 -07:00
Joel Dice
43cbfd3f3a support stack unwinding without using a frame pointer
Previously, we unwound the stack by following the chain of frame
pointers for normal returns, stack trace creation, and exception
unwinding.  On x86, this required reserving EBP/RBP for frame pointer
duties, making it unavailable for general computation and requiring
that it be explicitly saved and restored on entry and exit,
respectively.

On PowerPC, we use an ABI that makes the stack pointer double as a
frame pointer, so it doesn't cost us anything.  We've been using the
same convention on ARM, but it doesn't match the native calling
convention, which makes it unusable when we want to call native code
from Java and pass arguments on the stack.

So far, the ARM calling convention mismatch hasn't been an issue
because we've never passed more arguments from Java to native code
than would fit in registers.  However, we must now pass an extra
argument (the thread pointer) to e.g. divideLong so it can throw an
exception on divide by zero, which means the last argument must be
passed on the stack.  This will clobber the linkage area we've been
using to hold the frame pointer, so we need to stop using it.

One solution would be to use the same convention on ARM as we do on
x86, but this would introduce the same overhead of making a register
unavailable for general use and extra code at method entry and exit.

Instead, this commit removes the need for a frame pointer.  Unwinding
involves consulting a map of instruction offsets to frame sizes which
is generated at compile time.  This is necessary because stack trace
creation can happen at any time due to Thread.getStackTrace being
called by another thread, and the frame size varies during the
execution of a method.

So far, only x86(_64) is working, and continuations and tail call
optimization are probably broken.  More to come.
2011-01-16 19:05:05 -07:00
Joel Dice
a5742f5985 update copyright years 2010-12-05 20:21:09 -07:00
Joel Dice
86188cfc04 fix OS X openjdk and openjdk-src builds 2010-11-15 20:28:53 -07:00
Joel Dice
6cf3666ed9 fix timezone lookup for Windows openjdk-src build 2010-11-07 12:24:40 -07:00
Joel Dice
cddea7187d preliminary support for using OpenJDK's class library
Whereas the GNU Classpath port used the strategy of patching Classpath
with core classes from Avian so as to minimize changes to the VM, this
port uses the opposite strategy: abstract and isolate
classpath-specific features in the VM similar to how we abstract away
platform-specific features in system.h.  This allows us to use an
unmodified copy of OpenJDK's class library, including its core classes
and augmented by a few VM-specific classes in the "avian" package.
2010-09-10 15:05:29 -06:00
Joel Dice
6118792ffd update copyright years 2009-12-02 19:08:29 -07: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
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
f702795178 fix integer truncation bug 2009-10-17 18:35:19 -06:00
Joel Dice
1a0eef7e2d add support for building with MSVC on Windows 2009-08-26 18:26:44 -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
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
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
2f864ebea5 fix LLD definition for MinGW 4.4 2009-08-07 16:28:47 -06:00
jet
1ffe46a545 added ARM interpreted mode supported 2009-08-06 11:52:36 -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
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
14613193fa include return address size in frameSize passed to vmInvoke; fix printf warnings 2009-05-28 19:50:44 -06:00
Joel Dice
2608a2ee43 progress towards powerpc continuation and tail call support 2009-05-26 19:02:39 -06: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
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
20cf42c5e4 more work on boot image creation 2008-11-23 16:58:01 -07:00
Joel Dice
6e3bbd3c5f Merge branch 'master' of oss:/var/local/git/avian into powerpc 2008-07-17 17:34:52 -06:00
Joel Dice
920034e231 use JavaVMInitArgs instead of JDK1_1InitArgs in JNI_CreateJavaVM; support -Xbootclasspath option 2008-07-14 11:02:43 -06:00
Joel Dice
23043d140f snapshot 2008-07-05 14:21:13 -06:00
dicej
0ccf8d57ea rough sketch of powerpc support 2008-06-04 16:21:27 -06:00
Eric Scharff
584e1005e3 Fix Mac compiler warnings for fprintf format strings 2008-04-24 11:07:20 -06:00
Joel Dice
479c48f1dd fix printf warning 2008-04-15 23:26:58 -06:00
Joel Dice
2edaa82801 prepend copyright notice and license to all source files; add license.txt and readme.txt 2008-02-19 11:06:52 -07:00
Joel Dice
a8e9cc521c move some generally useful bitset functions from heap.cpp to common.h 2008-01-06 12:21:38 -07:00
Joel Dice
8e7f3b6821 add force_align_arg_pointer attribute to divideLong and moduloLong functions for OSX 2007-12-27 08:28:25 -07:00
Joel Dice
b3918a0d7d support encoding instructions with indexed and scaled memory offsets 2007-12-13 18:59:56 -07:00
Joel Dice
49ed41daa0 refactor stack walking interface in processor.h and sketch stack walking implementation in compile2.cpp 2007-11-25 16:00:55 -07:00
Eric Scharff
eb3bd1ce7c Got strip working for Mac OS X 2007-11-01 14:37:51 -06:00