Commit Graph

2252 Commits

Author SHA1 Message Date
Joel Dice
459f4d5194 fix openjdk-src bootimage build
The main change here is to use a lazily-populated vector to associate
runtime data with classes instead of referencing them directly from
the class which requires updating immutable references in the heap
image.  The other changes employ other strategies to avoid trying to
update immutable references.
2010-11-26 12:41:31 -07:00
Joel Dice
4f23601b56 fix corner cases which led to crashes in JIT compiler
Compiling the entire OpenJDK class library into a bootimage revealed
some corner cases which broke the compiler, including synchronization
in a finally block and gotos targeting the first instruction of an
unsynchronized method.
2010-11-26 12:36:43 -07:00
Joel Dice
aea02e545f fix race condition in interrupting/joining threads as they are exiting
My recent commit to ensure that OS resources are released immediately
upon thread exit introduced a race condition where interrupting or
joining a thread as it exited could lead to attempts to use
already-released resources.  This commit adds locking to avoid the
race.
2010-11-16 10:50:19 -07:00
Joel Dice
3ff1f9c59f remove temporary debugging code from posix.cpp 2010-11-16 10:49:56 -07:00
Joel Dice
a611ccda6f Merge remote branch 'origin/master' into openjdk
Conflicts:
	makefile
	src/compile.cpp
	src/compiler.cpp
	src/type-generator.cpp
2010-11-16 10:18:08 -07:00
Joel Dice
937b7a7d34 Merge remote branch 'origin/arm' 2010-11-16 09:56:35 -07:00
Joel Dice
64601e6f3e name VM-internal classes for heapdump=true builds
This makes heap dumps more useful since these classes are now refered
to by name instead of number.

This commit also adds a couple of utilities for parsing heap dumps:
PrintDump and DumpStats.
2010-11-16 09:31:49 -07:00
Joel Dice
86188cfc04 fix OS X openjdk and openjdk-src builds 2010-11-15 20:28:53 -07:00
Joel Dice
bc326fb5e9 fix ARM bootimage=true build 2010-11-16 02:38:36 +00:00
Joel Dice
3fb834d008 fix pre-GCC-4.4 ARM build 2010-11-15 23:56:34 +00:00
Joel Dice
02bdec6f8c fix Cygwin/MSYS openjdk-src builds 2010-11-15 16:27:00 -07:00
Joel Dice
8e23893af0 fix PowerPC builds on OS X 10.5+
The primary change is to ensure we output a Mach-O file of appropriate
endianness when cross-compiling for an opposite-endian architecture.
Earlier versions of XCode's linker accepted files of either
endianness, reguardless of architecture, but later versions don't,
hence the change.
2010-11-14 18:45:37 -07:00
Joel Dice
6bf74bf380 optimize loads of constant values by using PC-relative addressing on ARM
Previously, loading an arbitrary 32-bit constant required up to four
instructions (128 bytes), since we did so one byte at a time via
immediate-mode operations.

The preferred way to load constants on ARM is via PC-relative
addressing, but this is challenging because immediate memory offsets
are limited to 4096 bytes in either direction.  We frequently need to
compile methods which are larger than 4096, or even 8192, bytes, so we
must intersperse code and data if we want to use PC-relative loads
everywhere.

This commit enables pervasive PC-relative loads by handling the
following cases:

 1. Method is shorter than 4096 bytes: append data table to end

 2. Method is longer than 4096 bytes, but no basic block is longer
 than 4096 bytes: insert data tables as necessary after blocks, taking
 care to minimize the total number of tables

 3. Method is longer than 4096 bytes, and some blocks are longer than
 4096 bytes: split large basic blocks and insert data tables as above
2010-11-13 19:42:29 -07:00
Joel Dice
46be43a0e3 fix MSYS OpenJDK build 2010-11-12 19:04:17 -07:00
Joel Dice
0ca6c3ed53 fix native Windows GCC 3.4 OpenJDK build 2010-11-12 18:29:12 -07:00
Joel Dice
26a59612bb fix native Windows GCC 3.4 build 2010-11-12 16:53:16 -07:00
Joel Dice
f21d2b68b8 fix another ARM immediate offset bug
Some memory operations can only handle 8-bit immediate values, so we
need to use a temporary register for those which don't fit.
2010-11-09 17:31:52 -07:00
Joel Dice
6f555d4202 minor code cleanup in compile.cpp 2010-11-09 17:31:42 -07:00
Joel Dice
f64d6c857b clean up OS resources immediately upon thread exit
Previously, we waited until the next GC to do this, but that can be
too long for workloads which create a lot of short-lived threads but
don't do much allocation.
2010-11-09 15:46:16 -07:00
Joel Dice
44f55673d6 fix handle leaks in Windows Process implementation 2010-11-09 14:56:26 -07:00
Joel Dice
2d60398e63 fix bug which caused Runtime.exec to block until process exits 2010-11-09 12:38:23 -07:00
Joel Dice
7978102cb6 use register for indexing if constant offset is too large (or too small)
Immediate indexes on ARM must be no more than 12 bits, so we must use
a temporary register for values which don't fit.
2010-11-09 11:36:38 -07:00
Joel Dice
70fcbc2788 freeze index site in BoundsCheckEvent::compile
This ensures we don't use it as a temporary register when generating
the comparison.
2010-11-09 11:34:56 -07:00
Joel Dice
110f41b7a0 ARM makefile tweaks 2010-11-09 11:28:58 -07:00
Joel Dice
ababc5748d fix regression in last commit
My last commit unintentionally changed the return type of Runtime.exec
to Runtime.MyProcess instead of Process.
2010-11-09 11:21:55 -07:00
Joel Dice
3d18f88ad9 fix Runtime.exec bugs
The first bug affected POSIX systems: if the app never called
Process.waitFor, we'd never call waitpid on the child and thus leak a
zombie process.  This patch ensures that we always call waitpid by
spawning a thread to handle it.

The second bug affected Windows systems: we weren't closing the
child's ends of the stdin, stdout, and stderr pipes after process
creation, which lead to us blocking forever while reading from the
child's stdout or stderr.
2010-11-09 10:22:23 -07:00
Joel Dice
51ba49def6 enable ARM cross builds 2010-11-08 20:48:08 -07:00
Joel Dice
632e50efe6 fix non-continuations ARM build 2010-11-09 02:13:23 +00:00
Joel Dice
8ca5e9780e fix OS X build 2010-11-07 21:23:25 -07:00
Joel Dice
0f0427f23b implement continuations support for ARM 2010-11-08 04:18:10 +00:00
Joel Dice
36a8ba28e5 disable debug logging in compile.cpp 2010-11-08 04:15:31 +00:00
Joel Dice
5d5dbd860b fix ARM tails=true build
This requires adding LinkRegister to the list of reserved registers,
since it must be preserved in the thunk code generated by
compileDirectInvoke.  An alternative would be to explicitly preserve
it in that special case, but that would complicate the code quite a
bit.
2010-11-08 00:41:44 +00:00
Joel Dice
cfc09f8fdb Merge commit 'origin/master' into arm 2010-11-07 21:10:41 +00:00
Joel Dice
580e7e1b3f remove @Overload annotation since Java 1.5.0_19 chokes on it 2010-11-07 12:57:42 -07:00
Joel Dice
75de0a621b fix windows.cpp MySystem::now 2010-11-07 12:35:31 -07:00
Joel Dice
6cf3666ed9 fix timezone lookup for Windows openjdk-src build 2010-11-07 12:24:40 -07:00
Joel Dice
33b945c10b fix Windows openjdk (non-openjdk-src) build 2010-11-07 10:08:04 -07:00
Joel Dice
e1b808024a initial support for Windows OpenJDK build
All the tests are passing for openjdk-src builds, but the non-src
openjdk build is crashing and there's trouble loading time zone info
from the embedded java.home directory.
2010-11-06 22:21:19 -06:00
Joel Dice
df299f3564 fix build against latest JRE 1.6.0_22
This commit accomodates a new field in java.lang.Thread and implements
JVM_FindClassFromBootLoader.
2010-11-05 15:34:28 -06:00
Joel Dice
d0a6096eb0 add support for accessing embedded JARs as if they were directories
This allows OpenJDK to access time zone data which is normally found
under java.home, but which we must embed in the executable itself to
create a self-contained build.  The VM intercepts various file
operations, looking for paths which start with a prefix specified by
the avian.embed.prefix property and redirecting those operations to an
embedded JAR.

For example, if avian.embed.prefix is "/avian-embedded", and code
calls File.exists() with a path of
"/avian-embedded/javahomeJar/foo.txt", the VM looks for a function
named javahomeJar via dlsym, calls the function to find the memory
region containing the embeded JAR, and finally consults the JAR to see
if the file "foo.txt" exists.
2010-11-05 13:18:28 -06:00
Joel Dice
4cb796d2fb only return null from JVM_GetClassLoader when called from Unsafe.getUnsafe
sun.misc.Unsafe.getUnsafe expects a null result if the class loader is
the boot classloader and will throw a SecurityException otherwise
(whereas it should really be checking both for null and comparing
against the system classloader).  However, just returning null
whenever the loader is the boot loader can cause trouble for embedded
apps which put everything in the boot loader, including application
resources.

Therefore, we only return null if it's the boot loader and we're being
called from Unsafe.getUnsafe.
2010-11-04 11:43:50 -06:00
Joel Dice
cabad6926f enable standalone OpenJDK builds
As described in readme.txt, a standalone OpenJDK build embeds all
libraries, classes, and other files needed at runtime in the resulting
binary, eliminating dependencies on external resources.
2010-11-04 11:02:09 -06:00
Joel Dice
cb69ac23bd Merge remote branch 'origin/master' into openjdk
Conflicts:
	classpath/java/lang/String.java
	src/posix.cpp
2010-11-03 11:54:41 -06:00
Joel Dice
5ade8d1cf6 use GetSystemTimeAsFileTime instead of _ftime on Windows
It seems that _ftime has devolved to only giving 1-second resolution
on Windows 7.  GetSystemTimeAsFileTime does better, so that's what
we'll use.
2010-10-28 20:30:49 -06:00
Joel Dice
21deedc500 update openjdk.pro 2010-10-24 14:50:33 -06:00
Joel Dice
cdcc9caeb2 initial work towards ProGuard-enabled OpenJDK builds 2010-10-24 11:52:14 -06:00
Joel Dice
25ca40931d keep track of original class in resolveField so we can throw an exception with a useful message 2010-10-24 11:49:59 -06:00
Joel Dice
6f839323a7 use user-specified boot classpath exclusively when present 2010-10-24 11:49:12 -06:00
Joel Dice
ec6080fea6 update readme.txt to point to new classpath.jar path 2010-10-24 11:45:41 -06:00
Joel Dice
9c603c6525 fix member offset calculation inconsistencies in type-generator.cpp 2010-10-23 20:41:45 -06:00