Commit Graph

2806 Commits

Author SHA1 Message Date
Joel Dice
90fae940a7 throw IncompatibleClassChangeError on unexpected static status
If a class references a field or method as static and we find it's
actually non-static -- or vice-versa -- we ought to throw an error
rather than abort.
2012-05-11 13:19:55 -06:00
Joshua Warner
362d6594a8 fix minor memory leak with default bootimage symbols 2012-05-11 09:06:51 -06:00
Joshua Warner
3dcf886bbe allow passing bootimage / codeimage start and end symbol names to the bootimage-generator
The usage statement for the bootimage-generator now looks like this:
build/linux-x86_64-bootimage/bootimage-generator \
  -cp <classpath> \
  -bootimage <bootimage file> \
  -codeimage <codeimage file> \
  [-entry <class name>[.<method name>[<method spec>]]] \
  [-bootimage-symbols <start symbol name>:<end symbol name>] \
  [-codeimage-symbols <start symbol name>:<end symbol name>]
2012-05-10 14:49:59 -06:00
Joshua Warner
24061251cf fix readme.txt reference to binaryToObject 2012-05-10 12:11:31 -06:00
Joshua Warner
fa9814b86d remove lots of unnecessary sizeof computations with a convenient 'operator new' overload 2012-05-08 16:14:54 -06:00
Joshua Warner
fde7a3e7a1 give virtualThunks names based on index, to avoid conflicts 2012-05-07 15:05:40 -06:00
Joshua Warner
7c38ea75e4 give thunks symbol names in the bootimage build, use Heap::allocate instead of malloc 2012-05-07 10:00:59 -06:00
Joshua Warner
4266b0df7f fix step numbering in readme.txt 2012-05-07 08:29:43 -06:00
Joshua Warner
5c44ba859c minor correction to bootimage process in readme.txt 2012-05-07 08:13:04 -06:00
Joel Dice
797b4c25cc fix OpenJDK bootimage build regression 2012-05-04 20:13:26 -06:00
Joel Dice
1119675b7a override InputStream.available for FileInputStream and the instance returned by ZipFile.getInputStream 2012-05-04 19:55:53 -06:00
Joel Dice
ea4e0a2f5d fix a couple of subtle Thread.getStackTrace bugs
The first problem was that, on x86, we failed to properly keep track
of whether to expect the return address to be on the stack or not when
unwinding through a frame.  We were relying on a "stackLimit" pointer
to tell us whether we were looking at the most recently-called frame
by comparing it with the stack pointer for that frame.  That was
inaccurate in the case of a thread executing at the beginning of a
method before a new frame is allocated, in which case the most recent
two frames share a stack pointer, confusing the unwinder.  The
solution involves keeping track of how many frames we've looked at
while walking the stack.

The other problem was that compareIpToMethodBounds assumed every
method was followed by at least one byte of padding before the next
method started.  That assumption was usually valid because we were
storing the size following method code prior to the code itself.
However, the last method of an AOT-compiled code image is not followed
by any such method header and may instead be followed directly by
native code with no intervening padding.  In that case, we risk
interpreting that native code as part of the preceding method, with
potentially bizarre results.

The reason for the compareIpToMethodBounds assumption was that methods
which throw exceptions as their last instruction generate a
non-returning call, which nonetheless push a return address on the
stack which points past the end of the method, and the unwinder needs
to know that return address belongs to that method.  A better solution
is to add an extra trap instruction to the end of such methods, which
is what this patch does.
2012-05-04 18:51:58 -06:00
Joel Dice
58691a7fdb fix native Windows build
For some reason, Cygwin's MinGW-W64 compilers end up pulling in our
version of process.h from unistd.h.  That doesn't really make sense --
it should use the one from the sysroot, but we can work around it by
just not including unistd.h, since it's not needed on Windows anyway.
2012-05-03 14:55:51 -06:00
Joshua Warner
8c0ef382f8 write out bootimage directly from the bootimage-generator, eliminating one of the steps in a custom bootimage build 2012-05-03 12:04:34 -06:00
Joshua Warner
9cbd67ec61 darwin doesn't have <malloc.h>, apparently 2012-05-03 10:13:56 -06:00
Joshua Warner
1b5f37c9de correctly define the target platform in the case of a bootimage build 2012-05-03 10:13:56 -06:00
Joshua Warner
d76807d9e0 add back pointer-size assignment in makefile for i386 (accidentally removed) 2012-05-03 10:13:56 -06:00
Joshua Warner
132af5f70e fix windows build 2012-05-03 10:13:56 -06:00
Joshua Warner
53225edbfe remove debug logging 2012-05-03 10:13:56 -06:00
Joshua Warner
5724baad41 free symbol names after writing codeimage 2012-05-03 10:13:56 -06:00
Joshua Warner
a09736e749 write java symbols to bootimage 2012-05-03 10:13:56 -06:00
Joshua Warner
b742c58055 directly emit codeimage as a object (binaryToObject is statically linked in), as a stepping stone to including extra symbols in said codeimage 2012-05-03 10:13:55 -06:00
Joshua Warner
99bc9b1d55 prettify SymbolInfo array 2012-05-03 10:13:55 -06:00
Joshua Warner
2fa7fa0e83 correct bootimage dependency chain 2012-05-03 10:13:55 -06:00
Joel Dice
2107a09623 fix incorrect argument marshalling in Unsafe.{allocate|free}Memory
This was causing UnsafeTest to crash on PowerPC.
2012-05-02 18:02:28 -06:00
Joshua Warner
b0dd39aa86 fix darwin arm binaryToObject support (just a missing break...) 2012-04-30 09:43:24 -06:00
Joshua Warner
661f6c28a8 refactor binaryToObject to allow more flexibilty (in particular, allowing arbitrary symbols per object) 2012-04-27 12:08:44 -06:00
Joshua Warner
ca9b5b2f59 move OutputStream to ObjectWriter constructor in binaryToObject 2012-04-25 09:13:14 -06:00
Joshua Warner
a9ba4782ef improve build for binaryToObject 2012-04-25 09:13:04 -06:00
Joshua Warner
175db9ec54 allow streaming to more than just files in binaryToObject 2012-04-25 08:43:51 -06:00
Joshua Warner
9c308f751c refactor binaryToObject, to better support (eventually) putting symbols for compiled code in objects 2012-04-24 16:17:52 -06:00
Joel Dice
ba1f8aa68e don't fail build on missing iOS SDK unless actually building for iOS 2012-04-07 17:15:59 -06:00
Joel Dice
2fedfdea5b fix OS X build regression 2012-04-06 16:52:24 -06:00
Joel Dice
2b4407a962 fix iOS build regression 2012-04-05 10:04:53 -06:00
JET
6323c76540 added space before ';' in empty for loop to make Apple happy 2012-04-04 13:13:06 -06:00
JET
57092ece0d fixed Win32 getenv implementation 2012-04-03 10:38:48 -06:00
JET
2f225795fc added RuntimePermission and System.getenv() 2012-04-02 22:15:02 -06:00
Joel Dice
382f016415 remove debug logging 2012-03-26 18:12:58 -06:00
Joel Dice
994098baf1 make find[Field|Method]InClass non-inline functions
It seems that GCC 4.6.1 gets confused at LTO time when we take the
address of inline functions, so I'm switching them to non-inline
linkage to make it happy.
2012-03-26 18:09:35 -06:00
Joel Dice
1be6fe6f15 add -march=i586 to lflags as well as cflags where appropriate
When link time optimization is enabled, we need to remind the compiler
that we're targeting i586 when linking so it can resolve atomic
operations like __sync_bool_compare_and_swap.
2012-03-26 18:09:35 -06:00
Vaughn Dice
5be0edd628 Use latest iOS SDK found on local machine 2012-03-26 11:28:07 -06:00
Joshua Warner
8e6f5ac6e3 add ZipEntry.isDirectory (trivial implementation) 2012-03-21 10:38:30 -06:00
Joel Dice
f2e26791a4 handle constant-to-register "zero-extend" moves in x86.cpp
We've already been handling this case in arm.cpp and powerpc.cpp, but
apparently we've never hit this code path in x86.cpp before.  Indeed,
I've been unable to come up with a Java source code test that hits it;
it's only come up in Scala-generated bytecode.
2012-03-13 17:00:47 -06:00
Joel Dice
37044236d4 provide dummy implementation of JVM_GetThreadInterruptEvent 2012-03-13 10:31:08 -06:00
Joel Dice
58dc32382d fix memory management bugs in finder.cpp 2012-03-13 10:30:41 -06:00
Joel Dice
756f58210a add test for sun.misc.Unsafe functionality 2012-03-13 08:28:33 -06:00
Joel Dice
4aefa211a3 File.createNewFile should return false if the file already exists 2012-03-13 08:26:51 -06:00
Joel Dice
6cc0ddda7c implement JVM_HoldsLock 2012-03-11 05:06:08 -06:00
Joel Dice
04a34a75ed implement sun.misc.Unsafe.monitorEnter and monitorExit 2012-03-11 05:05:14 -06:00
Joel Dice
3e38628ad6 check superclasses in fieldForOffset, not just immediate class 2012-03-11 05:04:12 -06:00